org.enhydra.shark.utilities
Class WMEntityUtilities

java.lang.Object
  extended by org.enhydra.shark.utilities.WMEntityUtilities

public class WMEntityUtilities
extends java.lang.Object

The various utilities for WMEntity handling.

Author:
Sasa Bojanic

Constructor Summary
WMEntityUtilities()
           
 
Method Summary
static java.lang.String findEAAndGetValue(WMSessionHandle sh, XPDLBrowser xpdlb, WMEntity ent, java.lang.String eaName)
          Searchs for the extended attribute for the specified entity with a given name.
static WMEntity[] getAllActivities(WMSessionHandle shandle, XPDLBrowser xpdlb, WMEntity wpOrAs)
          Retrieves all the Shark entitites representing activities from the given workflow process or activity set.
static WMEntity[] getAllActivitySets(WMSessionHandle shandle, XPDLBrowser xpdlb, WMEntity wp)
          Retrieves all the Shark entitites representing activity sets for the given WorkflowProcess entity.
static WMEntity[] getAllApplications(WMSessionHandle shandle, XPDLBrowser xpdlb)
          Retrieves all the Shark entitites representing applications from all the packages and their workflow processes.
static WMEntity[] getAllApplications(WMSessionHandle shandle, XPDLBrowser xpdlb, WMEntity pkgOrWp)
          Retrieves all the Shark entitites representing applications from the given package or workflow process.
static WMEntity[] getAllPackages(WMSessionHandle shandle, XPDLBrowser xpdlb)
          Retrieves all the Shark entitites representing uploaded XPDL Packages.
static WMEntity[] getAllParticipants(WMSessionHandle shandle, XPDLBrowser xpdlb)
          Retrieves all the Shark entitites representing participants from all the packages and their workflow processes.
static WMEntity[] getAllParticipants(WMSessionHandle shandle, XPDLBrowser xpdlb, WMEntity pkgOrWp)
          Retrieves all the Shark entitites representing participants from the given package or workflow process.
static WMEntity[] getAllWorkflowProcesses(WMSessionHandle shandle, XPDLBrowser xpdlb, WMEntity pkg)
          Retrieves all the Shark entitites representing workflow processes for the given Package entity.
static WMAttribute getAttribute(WMSessionHandle shandle, XPDLBrowser xpdlb, WMEntity ent, java.lang.String attrName)
          Returns given entity's attribute referenced by the name or null if it does not exist.
static java.lang.String getAttributeValue(WMSessionHandle shandle, XPDLBrowser xpdlb, WMEntity ent, java.lang.String attrName)
          Returns given entity's attribute value or null if it does not exist.
static java.lang.String[][] getExtAttribNVPairs(WMSessionHandle sh, XPDLBrowser xpdlb, WMEntity ent)
          Returns (double) string array of all extended attributes for the given entity.
static java.util.Map getMapFromWMAttributeArray(WMAttribute[] attrs)
          Converts array of WMAttribute objects to a java Map where keys are WMAttribute names (variable Ids) and values are attribute/variable values.
static NameValue[] getNameValueArrayFromMap(java.util.Map context)
           
static WMEntity[] getOverallActivities(WMSessionHandle shandle, XPDLBrowser xpdlb, WMEntity wp)
          Retrieves all the Shark entitites representing activities from the given workflow process and their activity sets.
static WMEntity getSubEntity(WMSessionHandle shandle, XPDLBrowser xpdlb, WMEntity ent, java.lang.String subEntName)
          Returns given entity's sub-entity referenced by the name or null if it does not exist.
static WMAttribute[] getWMAttributeArrayFromMap(java.util.Map context, java.util.Map contextSignature)
          Converts variable Map to array of WMAttribute objects.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WMEntityUtilities

public WMEntityUtilities()
Method Detail

getExtAttribNVPairs

public static java.lang.String[][] getExtAttribNVPairs(WMSessionHandle sh,
                                                       XPDLBrowser xpdlb,
                                                       WMEntity ent)
                                                throws java.lang.Exception
Returns (double) string array of all extended attributes for the given entity. The first column of each row represents extended attribute's name attribute, and second column represents its value attribute.

Throws:
java.lang.Exception

findEAAndGetValue

public static java.lang.String findEAAndGetValue(WMSessionHandle sh,
                                                 XPDLBrowser xpdlb,
                                                 WMEntity ent,
                                                 java.lang.String eaName)
                                          throws java.lang.Exception
Searchs for the extended attribute for the specified entity with a given name. If attribute is found, the extended attribute's value attribute value is returned, and otherwise null is returned.

Throws:
java.lang.Exception

getAllPackages

public static WMEntity[] getAllPackages(WMSessionHandle shandle,
                                        XPDLBrowser xpdlb)
                                 throws java.lang.Exception
Retrieves all the Shark entitites representing uploaded XPDL Packages.

Throws:
java.lang.Exception

getAllWorkflowProcesses

public static WMEntity[] getAllWorkflowProcesses(WMSessionHandle shandle,
                                                 XPDLBrowser xpdlb,
                                                 WMEntity pkg)
                                          throws java.lang.Exception
Retrieves all the Shark entitites representing workflow processes for the given Package entity.

Throws:
java.lang.Exception

getAllActivitySets

public static WMEntity[] getAllActivitySets(WMSessionHandle shandle,
                                            XPDLBrowser xpdlb,
                                            WMEntity wp)
                                     throws java.lang.Exception
Retrieves all the Shark entitites representing activity sets for the given WorkflowProcess entity.

Throws:
java.lang.Exception

getAllParticipants

public static WMEntity[] getAllParticipants(WMSessionHandle shandle,
                                            XPDLBrowser xpdlb)
                                     throws java.lang.Exception
Retrieves all the Shark entitites representing participants from all the packages and their workflow processes.

Throws:
java.lang.Exception

getAllParticipants

public static WMEntity[] getAllParticipants(WMSessionHandle shandle,
                                            XPDLBrowser xpdlb,
                                            WMEntity pkgOrWp)
                                     throws java.lang.Exception
Retrieves all the Shark entitites representing participants from the given package or workflow process.

Throws:
java.lang.Exception

getAllApplications

public static WMEntity[] getAllApplications(WMSessionHandle shandle,
                                            XPDLBrowser xpdlb)
                                     throws java.lang.Exception
Retrieves all the Shark entitites representing applications from all the packages and their workflow processes.

Throws:
java.lang.Exception

getAllApplications

public static WMEntity[] getAllApplications(WMSessionHandle shandle,
                                            XPDLBrowser xpdlb,
                                            WMEntity pkgOrWp)
                                     throws java.lang.Exception
Retrieves all the Shark entitites representing applications from the given package or workflow process.

Throws:
java.lang.Exception

getOverallActivities

public static WMEntity[] getOverallActivities(WMSessionHandle shandle,
                                              XPDLBrowser xpdlb,
                                              WMEntity wp)
                                       throws java.lang.Exception
Retrieves all the Shark entitites representing activities from the given workflow process and their activity sets.

Throws:
java.lang.Exception

getAllActivities

public static WMEntity[] getAllActivities(WMSessionHandle shandle,
                                          XPDLBrowser xpdlb,
                                          WMEntity wpOrAs)
                                   throws java.lang.Exception
Retrieves all the Shark entitites representing activities from the given workflow process or activity set.

Throws:
java.lang.Exception

getSubEntity

public static WMEntity getSubEntity(WMSessionHandle shandle,
                                    XPDLBrowser xpdlb,
                                    WMEntity ent,
                                    java.lang.String subEntName)
                             throws java.lang.Exception
Returns given entity's sub-entity referenced by the name or null if it does not exist.

Throws:
java.lang.Exception

getAttribute

public static WMAttribute getAttribute(WMSessionHandle shandle,
                                       XPDLBrowser xpdlb,
                                       WMEntity ent,
                                       java.lang.String attrName)
                                throws java.lang.Exception
Returns given entity's attribute referenced by the name or null if it does not exist.

Throws:
java.lang.Exception

getAttributeValue

public static java.lang.String getAttributeValue(WMSessionHandle shandle,
                                                 XPDLBrowser xpdlb,
                                                 WMEntity ent,
                                                 java.lang.String attrName)
                                          throws java.lang.Exception
Returns given entity's attribute value or null if it does not exist. Attribute name is specified as parameter.

Throws:
java.lang.Exception

getMapFromWMAttributeArray

public static java.util.Map getMapFromWMAttributeArray(WMAttribute[] attrs)
                                                throws java.lang.Exception
Converts array of WMAttribute objects to a java Map where keys are WMAttribute names (variable Ids) and values are attribute/variable values.

Throws:
java.lang.Exception

getWMAttributeArrayFromMap

public static WMAttribute[] getWMAttributeArrayFromMap(java.util.Map context,
                                                       java.util.Map contextSignature)
                                                throws java.lang.Exception
Converts variable Map to array of WMAttribute objects. Map keys become WMAttribute names and values WMAttribute values. Context signature of the corresponding process definition is mandatory parameter which can't be null.

Throws:
java.lang.Exception

getNameValueArrayFromMap

public static NameValue[] getNameValueArrayFromMap(java.util.Map context)
                                            throws java.lang.Exception
Throws:
java.lang.Exception