| java.lang.Object org.obe.engine.WorkflowEngineUtilities
WorkflowEngineUtilities | public class WorkflowEngineUtilities (Code) | | Utility class to support the engine run-time.
author: Anthony Eden author: Adrian Price |
Inner Class :public static class AttributeDescription | |
Method Summary | |
public static int | activityStateToProcessState(int newState) Maps activity state to process state. | public static int | activityStateToWorkItemState(int newState) Maps activity state to work item state. | public static void | applyResults(Parameter[] parms, ProcessInstance processInstance, boolean ignoreNullSchemaTypeValues) Applies the results of a tool invocation to a process instance. | public static void | applyResults(ActualParameter[] actualParms, ProcessInstance processInstance, ApplicationEvent event, ApplicationEventBroker broker) Applies data from an application event to a process instance. | public static Date | calculateDeadlineDate(Activity activity, Deadline deadline, Date startedDate, CalendarFactory calendarFactory) Calculates the deadline date for an activity. | public static Date | calculateDueDate(WorkflowProcess workflow, Date startedDate, CalendarFactory calendarFactory) Calculates the due date for a workflow. | public static Date | calculateDueDate(Activity activity, String performer, String user, Date startedDate, CalendarFactory calendarFactory) Calculates the due date for an activity. | public static Date | calculateExpiryDate(Duration expiration, String calendar, CalendarFactory calendarFactory) Calculates the expiration date for an application event.
Parameters: expiration - The duration for which the event will be valid. Parameters: calendar - The name of the business calendar to use. Parameters: calendarFactory - The calendar factory to use. | public static Date | calculateTargetDate(WorkflowProcess workflow, Date startedDate, CalendarFactory calendarFactory) Calculates the target date for a workflow. | public static Date | calculateTargetDate(Activity activity, String performer, String user, Date startedDate, CalendarFactory calendarFactory) Calculates the target date for an activity. | public static void | checkValid(WorkflowProcess workflow, boolean internal) Validates that a WorkflowProcess is available for instantiation. | public static String | createEventCondition(EventTypeMetaData metaData, ActualParameter[] actualParms, EngineContext ctx) Synthesizes a conditional expression from a set of formal and actual
parameter specifications. | public static Object[] | createEventKeys(EventTypeMetaData metaData, ActualParameter[] actualParms, EngineContext ctx) Creates the keys for a key-based event subscription.
Parameters: metaData - Event type meta data. Parameters: actualParms - The actual parameters from the<obe:Event> element in the workflow process. Parameters: ctx - The engine context. | public static Parameter[] | createParameters(FormalParameter[] formalParms, ActualParameter[] actualParms, EngineContext ctx) | public static Parameter[] | createParameters(Application toolDef, ActualParameter[] actualParms, EngineContext ctx) | public static AttributeDescription | describeAttribute(WorkflowProcess workflow, String id, boolean includeSystemAttrs) Describes a process attribute.
Parameters: workflow - The workflow definition. Parameters: id - The attribute ID. Parameters: includeSystemAttrs - true to include system attributes. | public static AssignmentStrategyDef | findAssignmentStrategy(Activity activity) | public static String | findCalendar(WorkflowProcess workflow) Finds the name of the business calendar to use.
Parameters: workflow - Workflow definition to search. | public static String | findCalendar(String performer, Activity activity) Finds the name of the business calendar to use.
Parameters: performer - The ID of the performer for whom the computation isbeing made. | public static CompletionStrategy | findCompletionStrategy(Activity activity, ServiceManager svcMgr) | public static DataField | findDataField(WorkflowProcess workflow, String id) Finds the definition of a process attribute.
Parameters: id - The attribute ID. | public static DataType | findDataType(WorkflowProcess workflow, String id, boolean includeSystemAttrs) Describes a process attribute.
Parameters: workflow - The workflow definition. Parameters: id - The attribute ID. Parameters: includeSystemAttrs - true to include system attributes. | public static Evaluator | getEvaluator(XPDLPackage pkg, ServiceManager svcMgr) | public static Map | introspectToMap(Class beanClass, Class stopClass) Introspects properties of the specified class(es) into a map. | public static String | mapPerformerId(Participant performerDef) | public static ToolInvocation[] | prepareToolInvocations(WorkItem workItem, int toolIndex, EngineContext ctx) Returns everything necessary to invoke the tool(s) associated with a work
item.
Parameters: workItem - The work item corresponding to the tool. Parameters: toolIndex - The index of the tool to prepare (ignored in favour ofworkItem.getToolIndex() if workItem isnon-null or if the toolset mode is PARALLEL. Parameters: ctx - The workflow context in which to prepare the tool invocation. | public static int | processStateToActivityState(int newState) Maps process state to activity state. | public static void | sortForValidity(WorkflowProcess[] workflows) Sorts the workflows collection in ordered of descending validity,
namely: validFrom DESC, validTo DESC, created DESC. | public static void | validatePackage(XPDLPackage pkg) |
activityStateToProcessState | public static int activityStateToProcessState(int newState)(Code) | | Maps activity state to process state. When an activity instance with a
SubFlow implementation transitions to the newState state,
any child process belonging to that activity instance for which it would
be a legal transition, should transition to the state returned by this
method.
Parameters: newState - The new process instance state. The required activity instance state. |
activityStateToWorkItemState | public static int activityStateToWorkItemState(int newState)(Code) | | Maps activity state to work item state. When an activity instance
transitions to the newState state, work items belonging
to that activity instance and for which it would be a legal transition,
should transition to the state returned by this method.
Parameters: newState - The new activity state. The required work item state. |
applyResults | public static void applyResults(Parameter[] parms, ProcessInstance processInstance, boolean ignoreNullSchemaTypeValues) throws RepositoryException, AttributeReadOnlyException(Code) | | Applies the results of a tool invocation to a process instance. INOUT-
and OUT-type process variables are updated with the values provided by
the application or procedure. IN-type parameters are ignored.
Parameters: parms - Parameter values returned by the tool invocation. Parameters: processInstance - The process instance to which the values are to beapplied. Parameters: ignoreNullSchemaTypeValues - true to ignore (i.e.,not store) null values for attributes whose type is defined by anSchemaType XML schema and which does not map to aBasicType. The reason for this is to enable worklist handlerclients to support optional file uploads to such attributes. throws: RepositoryException - If the value could not be stored in theattribute. throws: AttributeReadOnlyException - If the attribute in question is read-only (applies to most system attributes). |
applyResults | public static void applyResults(ActualParameter[] actualParms, ProcessInstance processInstance, ApplicationEvent event, ApplicationEventBroker broker) throws WMWorkflowException(Code) | | Applies data from an application event to a process instance.
Parameters: actualParms - The actual parameters passed by the eventsubscription. Parameters: processInstance - The process instance to update. Parameters: event - The application event. Parameters: broker - The event broker to use. throws: WMWorkflowException - If the event type could not be found or ifan attribute could not be updated. |
calculateDueDate | public static Date calculateDueDate(WorkflowProcess workflow, Date startedDate, CalendarFactory calendarFactory) throws RepositoryException(Code) | | Calculates the due date for a workflow.
Parameters: workflow - Parameters: startedDate - Parameters: calendarFactory - The due date, or null if the workflow does not specify a limit. |
calculateExpiryDate | public static Date calculateExpiryDate(Duration expiration, String calendar, CalendarFactory calendarFactory) throws RepositoryException(Code) | | Calculates the expiration date for an application event.
Parameters: expiration - The duration for which the event will be valid. Parameters: calendar - The name of the business calendar to use. Parameters: calendarFactory - The calendar factory to use. The expiration date. throws: RepositoryException - If the calendar could not be found. |
calculateTargetDate | public static Date calculateTargetDate(WorkflowProcess workflow, Date startedDate, CalendarFactory calendarFactory) throws RepositoryException(Code) | | Calculates the target date for a workflow.
Parameters: workflow - Parameters: startedDate - Parameters: calendarFactory - The target date, or null if the workflow does not specify aduration. |
checkValid | public static void checkValid(WorkflowProcess workflow, boolean internal) throws WMInvalidProcessDefinitionException(Code) | | Validates that a WorkflowProcess is available for instantiation.
Parameters: workflow - The WorkflowProcess Parameters: internal - true if instantiating internally. throws: WMInvalidProcessDefinitionException - if the process definition isdisabled, under revision, private and non-subflow, or has not yet comeinto force, or has expired. |
createEventCondition | public static String createEventCondition(EventTypeMetaData metaData, ActualParameter[] actualParms, EngineContext ctx) throws WMWorkflowException(Code) | | Synthesizes a conditional expression from a set of formal and actual
parameter specifications. The key/value pairs for all parameters are
ANDed together in the resulting conditional expression.
Parameters: metaData - The event definition contains the formal parameters whichdefine the keys referenced in the resulting conditional expression. Parameters: actualParms - The actual parameters define the values to matchagainst their corresponding keys. Parameters: ctx - The workflow context in which to evaluate the actualparameters. A conditional expression in the specified scripting language. throws: WMWorkflowException - |
createEventKeys | public static Object[] createEventKeys(EventTypeMetaData metaData, ActualParameter[] actualParms, EngineContext ctx) throws WMWorkflowException(Code) | | Creates the keys for a key-based event subscription.
Parameters: metaData - Event type meta data. Parameters: actualParms - The actual parameters from the<obe:Event> element in the workflow process. Parameters: ctx - The engine context. Event keys for the IN- and INOUT-type formal event parameters. throws: WMWorkflowException - |
describeAttribute | public static AttributeDescription describeAttribute(WorkflowProcess workflow, String id, boolean includeSystemAttrs) throws WMInvalidAttributeException(Code) | | Describes a process attribute.
Parameters: workflow - The workflow definition. Parameters: id - The attribute ID. Parameters: includeSystemAttrs - true to include system attributes. A description of the attribute. |
findCalendar | public static String findCalendar(WorkflowProcess workflow)(Code) | | Finds the name of the business calendar to use.
Parameters: workflow - Workflow definition to search. The business calendar name, or "default" if a calendar was not specified by the WorkflowProcess or Package. |
findCalendar | public static String findCalendar(String performer, Activity activity) throws WMInvalidTargetUserException(Code) | | Finds the name of the business calendar to use.
Parameters: performer - The ID of the performer for whom the computation isbeing made. The corresponding participant can have its own calendar,which will over-ride any activity-, workflow- or package-level calendar. Parameters: activity - The activity definition to search. The business calendar ID, or "default" ifa calendar was not specified by the Activity, WorkflowProcess or Package. |
findDataType | public static DataType findDataType(WorkflowProcess workflow, String id, boolean includeSystemAttrs) throws WMInvalidAttributeException(Code) | | Describes a process attribute.
Parameters: workflow - The workflow definition. Parameters: id - The attribute ID. Parameters: includeSystemAttrs - true to include system attributes. The corresponding DataType. |
introspectToMap | public static Map introspectToMap(Class beanClass, Class stopClass)(Code) | | Introspects properties of the specified class(es) into a map. The
results are cached internally on beanClass, with the result
that sequential calls with the same beanClass but different
stopClass will yield property information generated from the
first such call.
Parameters: beanClass - Parameters: stopClass - A map of PropertyDescriptor s, keyed on propertyname. |
prepareToolInvocations | public static ToolInvocation[] prepareToolInvocations(WorkItem workItem, int toolIndex, EngineContext ctx) throws RepositoryException, WMWorkflowException(Code) | | Returns everything necessary to invoke the tool(s) associated with a work
item.
Parameters: workItem - The work item corresponding to the tool. Parameters: toolIndex - The index of the tool to prepare (ignored in favour ofworkItem.getToolIndex() if workItem isnon-null or if the toolset mode is PARALLEL. Parameters: ctx - The workflow context in which to prepare the tool invocation. Tool invocation details. throws: WMInvalidToolException - if the tool cannot be found. |
processStateToActivityState | public static int processStateToActivityState(int newState)(Code) | | Maps process state to activity state. When a process instance
transitions to the newState state, activities belonging
to that process instance and for which it would be a legal transition,
should transition to the state returned by this method.
Parameters: newState - The new process instance state. The required activity instance state. |
sortForValidity | public static void sortForValidity(WorkflowProcess[] workflows)(Code) | | Sorts the workflows collection in ordered of descending validity,
namely: validFrom DESC, validTo DESC, created DESC. The 'most valid'
workflow is therefore always at index 0.
Parameters: workflows - |
|
|