|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface WAPI
Enables client applications to connect to and interact with a workflow engine.
This interface is based on the WfMC's Interface 2 Client WAPI specification. Some of
the methods have been modified from the original specification to fit within the normal
design of Java applications. For instance, the WfMC specification functions always
return an error object (even for success) and uses out parameters to return values.
This interface returns the value and throws an exception when an error occurs. If no
error occurs then an exception is not thrown. The C WAPI uses query handles and
iterator functions to retrieve collections; this Java binding uses WMIterator
.
For the adoption in Shark, we have changed most of the methods signatures and switched almost all interfaces into classes, however original intention and functionality remained. We defined additional method to get immediate access to ProcessDefinition by its name.
Method Summary | |
---|---|
void |
abortProcessInstance(WMSessionHandle shandle,
java.lang.String procInstId)
Aborts a process instance. |
void |
abortProcessInstances(WMSessionHandle shandle,
java.lang.String procDefId,
WMFilter filter)
Aborts a group of process instances. |
void |
assignActivityInstanceAttribute(WMSessionHandle shandle,
java.lang.String procInstId,
java.lang.String actInstId,
java.lang.String attrName,
java.lang.Object attrValue)
Sets the value of an activity instance attribute. |
void |
assignActivityInstancesAttribute(WMSessionHandle shandle,
java.lang.String procDefId,
java.lang.String actDefId,
WMFilter filter,
java.lang.String attrName,
java.lang.Object attrValue)
Assigns an attribute value for a group of process instances. |
void |
assignProcessInstanceAttribute(WMSessionHandle shandle,
java.lang.String procInstId,
java.lang.String attrName,
java.lang.Object attrValue)
Sets the specified process instance attribute value. |
void |
assignProcessInstancesAttribute(WMSessionHandle shandle,
java.lang.String procDefId,
WMFilter filter,
java.lang.String attrName,
java.lang.Object attrValue)
Assigns an attribute value for a group of process instances. |
void |
assignWorkItemAttribute(WMSessionHandle shandle,
java.lang.String procInstId,
java.lang.String workItemId,
java.lang.String attrName,
java.lang.Object attrValue)
Sets the value of a work item attribute. |
void |
changeActivityInstancesState(WMSessionHandle shandle,
java.lang.String procDefId,
java.lang.String actDefId,
WMFilter filter,
WMActivityInstanceState newState)
Changes the state of selected activity instances. |
void |
changeActivityInstanceState(WMSessionHandle shandle,
java.lang.String procInstId,
java.lang.String actInstId,
WMActivityInstanceState newState)
Changes the state of an activity instance. |
void |
changeProcessDefinitionState(WMSessionHandle shandle,
java.lang.String procDefId,
WMProcessDefinitionState newState)
Changes the process definition state. |
void |
changeProcessInstancesState(WMSessionHandle shandle,
java.lang.String procDefId,
WMFilter filter,
WMProcessInstanceState newState)
Changes the state of selected process instances. |
void |
changeProcessInstanceState(WMSessionHandle shandle,
java.lang.String procInstId,
WMProcessInstanceState newState)
Changes the state of a process instance. |
void |
changeWorkItemState(WMSessionHandle shandle,
java.lang.String procInstId,
java.lang.String workItemId,
WMWorkItemState newState)
Changes the state of a work item. |
void |
completeWorkItem(WMSessionHandle shandle,
java.lang.String procInstId,
java.lang.String workItemId)
Completes the specified work item. |
WMSessionHandle |
connect(WMConnectInfo connectInfo)
Connects to a workflow service. |
java.lang.String |
createProcessInstance(WMSessionHandle shandle,
java.lang.String procDefId,
java.lang.String procInstName)
Creates a new process instance for the given process definition. |
void |
disconnect(WMSessionHandle shandle)
Disconnects from the workflow service. |
WMActivityInstance |
getActivityInstance(WMSessionHandle shandle,
java.lang.String procInstId,
java.lang.String actInstId)
Retrieves an activity instance. |
WMAttribute |
getActivityInstanceAttributeValue(WMSessionHandle shandle,
java.lang.String procInstId,
java.lang.String actInstId,
java.lang.String attrName)
Gets the value of an activity instance attribute. |
WMProcessDefinition |
getProcessDefinition(WMSessionHandle shandle,
java.lang.String procDefName)
Retrieves a process definition. |
WMProcessInstance |
getProcessInstance(WMSessionHandle shandle,
java.lang.String procInstId)
Retrieves a process instance. |
WMAttribute |
getProcessInstanceAttributeValue(WMSessionHandle shandle,
java.lang.String procInstId,
java.lang.String attrName)
Gets the specified process instance attribute value. |
WMWorkItem |
getWorkItem(WMSessionHandle shandle,
java.lang.String procInstId,
java.lang.String workItemId)
Retrieves a work item. |
WMAttribute |
getWorkItemAttributeValue(WMSessionHandle shandle,
java.lang.String procInstId,
java.lang.String workItemId,
java.lang.String attrName)
Retrieves the value of a work item attribute. |
WMAttributeIterator |
listActivityInstanceAttributes(WMSessionHandle shandle,
java.lang.String procInstId,
java.lang.String actInstId,
WMFilter filter,
boolean countFlag)
Opens a list of activity instance attributes. |
WMActivityInstanceIterator |
listActivityInstances(WMSessionHandle shandle,
WMFilter filter,
boolean countFlag)
Opens a list of activity instances. |
WMActivityInstanceStateIterator |
listActivityInstanceStates(WMSessionHandle shandle,
java.lang.String procInstId,
java.lang.String actInstId,
WMFilter filter,
boolean countFlag)
Opens a list of process instance states. |
WMProcessDefinitionIterator |
listProcessDefinitions(WMSessionHandle shandle,
WMFilter filter,
boolean countFlag)
Opens a list of process definitions. |
WMProcessDefinitionStateIterator |
listProcessDefinitionStates(WMSessionHandle shandle,
java.lang.String procDefId,
WMFilter filter,
boolean countFlag)
Opens a list of process definition states. |
WMAttributeIterator |
listProcessInstanceAttributes(WMSessionHandle shandle,
java.lang.String procInstId,
WMFilter filter,
boolean countFlag)
Opens a list of process instance attributes. |
WMProcessInstanceIterator |
listProcessInstances(WMSessionHandle shandle,
WMFilter filter,
boolean countFlag)
Opens a list of process instances. |
WMProcessInstanceStateIterator |
listProcessInstanceStates(WMSessionHandle shandle,
java.lang.String procInstId,
WMFilter filter,
boolean countFlag)
Opens a list of process instance states. |
WMAttributeIterator |
listWorkItemAttributes(WMSessionHandle shandle,
java.lang.String procInstId,
java.lang.String workItemId,
WMFilter filter,
boolean countFlag)
Opens a list of work item attributes. |
WMWorkItemIterator |
listWorkItems(WMSessionHandle shandle,
WMFilter filter,
boolean countFlag)
Opens a worklist. |
WMWorkItemStateIterator |
listWorkItemStates(WMSessionHandle shandle,
java.lang.String procInstId,
java.lang.String workItemId,
WMFilter filter,
boolean countFlag)
Opens a list of work item states. |
void |
reassignWorkItem(WMSessionHandle shandle,
java.lang.String sourceUser,
java.lang.String targetUser,
java.lang.String procInstId,
java.lang.String workItemId)
Reassigns a work item to another user. |
java.lang.String |
startProcess(WMSessionHandle shandle,
java.lang.String procInstId)
Starts a process instance. |
void |
terminateProcessInstance(WMSessionHandle shandle,
java.lang.String procInstId)
Terminates a process instance. |
void |
terminateProcessInstances(WMSessionHandle shandle,
java.lang.String procDefId,
WMFilter filter)
Terminates a group of process instances. |
Method Detail |
---|
WMSessionHandle connect(WMConnectInfo connectInfo) throws java.lang.Exception
connectInfo
- The connection info. In OBE, pass null
to skip the
JAAS login and retain the current security identity (if any).
java.lang.Exception
- Workflow client exception.void disconnect(WMSessionHandle shandle) throws java.lang.Exception
java.lang.Exception
- Workflow client exception.WMProcessDefinitionIterator listProcessDefinitions(WMSessionHandle shandle, WMFilter filter, boolean countFlag) throws java.lang.Exception
tsNext()
method.
filter
- The filter or null.countFlag
- True to return count value.
WMProcessDefinition
objects.
java.lang.Exception
- Workflow client exception.WMProcessDefinitionStateIterator listProcessDefinitionStates(WMSessionHandle shandle, java.lang.String procDefId, WMFilter filter, boolean countFlag) throws java.lang.Exception
tsNext()
method.
procDefId
- The unique process definition ID.filter
- The filter or null.countFlag
- True to return count value.
WMProcessDefinitionState
objects.
java.lang.Exception
- Workflow client exception.void changeProcessDefinitionState(WMSessionHandle shandle, java.lang.String procDefId, WMProcessDefinitionState newState) throws java.lang.Exception
procDefId
- The process definition id.newState
- The new process definition state.
java.lang.Exception
- Workflow client exception.java.lang.String createProcessInstance(WMSessionHandle shandle, java.lang.String procDefId, java.lang.String procInstName) throws java.lang.Exception
procDefId
- The process definition id.procInstName
- The name of the process instance.
java.lang.Exception
- Workflow client exception.java.lang.String startProcess(WMSessionHandle shandle, java.lang.String procInstId) throws java.lang.Exception
createProcessInstance()
procInstId
- The process instance id retrieved in a prior call to
createProcessInstance()
.
java.lang.Exception
- Workflow client exception.void terminateProcessInstance(WMSessionHandle shandle, java.lang.String procInstId) throws java.lang.Exception
procInstId
- The process instance id.
java.lang.Exception
- Workflow client exception.WMProcessInstanceStateIterator listProcessInstanceStates(WMSessionHandle shandle, java.lang.String procInstId, WMFilter filter, boolean countFlag) throws java.lang.Exception
tsNext()
method.
procInstId
- The unique process instance ID.filter
- The filter or null.countFlag
- True to return count value.
WMProcessInstanceState
objects.
java.lang.Exception
- Workflow client exception.void changeProcessInstanceState(WMSessionHandle shandle, java.lang.String procInstId, WMProcessInstanceState newState) throws java.lang.Exception
procInstId
- The process instance id.newState
- The new process instance state.
java.lang.Exception
- Workflow client exception.WMAttributeIterator listProcessInstanceAttributes(WMSessionHandle shandle, java.lang.String procInstId, WMFilter filter, boolean countFlag) throws java.lang.Exception
tsNext()
method.
filter
- The filter or null.countFlag
- True to return count value.
WMAttribute
objects.
java.lang.Exception
- Workflow client exception.WMAttribute getProcessInstanceAttributeValue(WMSessionHandle shandle, java.lang.String procInstId, java.lang.String attrName) throws java.lang.Exception
procInstId
- The process instance id.attrName
- The attribute name.
java.lang.Exception
- Workflow client exception.void assignProcessInstanceAttribute(WMSessionHandle shandle, java.lang.String procInstId, java.lang.String attrName, java.lang.Object attrValue) throws java.lang.Exception
procInstId
- The process instance id.attrName
- The attribute name.attrValue
- The attribute value.
java.lang.Exception
- Workflow client exception.WMActivityInstanceStateIterator listActivityInstanceStates(WMSessionHandle shandle, java.lang.String procInstId, java.lang.String actInstId, WMFilter filter, boolean countFlag) throws java.lang.Exception
tsNext()
method.
procInstId
- The process instance id.actInstId
- The activity instance id.filter
- The filter or null.countFlag
- True to return count value.
WMActivityInstanceState
objects.
java.lang.Exception
- Workflow client exception.void changeActivityInstanceState(WMSessionHandle shandle, java.lang.String procInstId, java.lang.String actInstId, WMActivityInstanceState newState) throws java.lang.Exception
procInstId
- The process instance id.actInstId
- The activity instance id.newState
- The new activity instance state.
java.lang.Exception
- Workflow client exception.WMAttributeIterator listActivityInstanceAttributes(WMSessionHandle shandle, java.lang.String procInstId, java.lang.String actInstId, WMFilter filter, boolean countFlag) throws java.lang.Exception
tsNext()
method.
procInstId
- The process instance id.actInstId
- The activity instance id.filter
- The filter or null.countFlag
- True to return count value.
WMAttribute
objects.
java.lang.Exception
- Workflow client exception.WMAttribute getActivityInstanceAttributeValue(WMSessionHandle shandle, java.lang.String procInstId, java.lang.String actInstId, java.lang.String attrName) throws java.lang.Exception
procInstId
- The process instance id.actInstId
- The activity instance id.attrName
- The attribute name.
java.lang.Exception
- Workflow client exception.void assignActivityInstanceAttribute(WMSessionHandle shandle, java.lang.String procInstId, java.lang.String actInstId, java.lang.String attrName, java.lang.Object attrValue) throws java.lang.Exception
procInstId
- The process instance id.actInstId
- The activity instance id.attrName
- The attribute name.attrValue
- The attribute value.
java.lang.Exception
- Workflow client exception.WMProcessInstanceIterator listProcessInstances(WMSessionHandle shandle, WMFilter filter, boolean countFlag) throws java.lang.Exception
tsNext()
method.
filter
- The filter or null.countFlag
- True to return count value.
WMProcessInstance
objects.
java.lang.Exception
- Workflow client exception.WMProcessInstance getProcessInstance(WMSessionHandle shandle, java.lang.String procInstId) throws java.lang.Exception
procInstId
- The process instance id.
java.lang.Exception
- Workflow client exception.WMActivityInstanceIterator listActivityInstances(WMSessionHandle shandle, WMFilter filter, boolean countFlag) throws java.lang.Exception
tsNext()
method.
filter
- The filter or null.countFlag
- True to return count value.
WMActivityInstance
objects.
java.lang.Exception
- Workflow client exception.WMActivityInstance getActivityInstance(WMSessionHandle shandle, java.lang.String procInstId, java.lang.String actInstId) throws java.lang.Exception
procInstId
- The process instance id.actInstId
- The activity instance id.
java.lang.Exception
- Workflow client exception.WMWorkItemIterator listWorkItems(WMSessionHandle shandle, WMFilter filter, boolean countFlag) throws java.lang.Exception
tsNext()
method.
filter
- The filter or null.countFlag
- True to return count value.
WMWorkItem
objects.
java.lang.Exception
- Workflow client exception.WMWorkItem getWorkItem(WMSessionHandle shandle, java.lang.String procInstId, java.lang.String workItemId) throws java.lang.Exception
procInstId
- The process instance id.workItemId
- The work item id.
java.lang.Exception
- Workflow client exception.void completeWorkItem(WMSessionHandle shandle, java.lang.String procInstId, java.lang.String workItemId) throws java.lang.Exception
procInstId
- The process instance id.workItemId
- The work item id.
java.lang.Exception
- Workflow client exception.WMWorkItemStateIterator listWorkItemStates(WMSessionHandle shandle, java.lang.String procInstId, java.lang.String workItemId, WMFilter filter, boolean countFlag) throws java.lang.Exception
tsNext()
method. N.B. This function is poorly documented in the
WfMC specification, which contains several 'copy/paste' errors. N.B. The
signature of this method differs from that described in the WAPI2 specification, in
that it has a procInstId parameter. This is because the specification's definition
for this function is clearly in error, having been copied badly from that for
WMOpenProcessDefinitionStatesList. The other WAPI functions that refer to work items
invariably require the procInstId parameter.
procInstId
- The process instance id.workItemId
- The process instance id.filter
- The filter or null.countFlag
- True to return count value.
WMWorkItemState
objects.
java.lang.Exception
- Workflow client exception.void changeWorkItemState(WMSessionHandle shandle, java.lang.String procInstId, java.lang.String workItemId, WMWorkItemState newState) throws java.lang.Exception
procInstId
parameter.
This is because the specification's definition for this function is
clearly in error, having been badly copied from that for
WMChangeDefinitionState
. The other WAPI functions that refer
to work items invariably require the procInstId
parameter.
procInstId
- The process instance id.workItemId
- The work item id.newState
- The new work item state.
java.lang.Exception
- Workflow client exception.void reassignWorkItem(WMSessionHandle shandle, java.lang.String sourceUser, java.lang.String targetUser, java.lang.String procInstId, java.lang.String workItemId) throws java.lang.Exception
sourceUser
- The current user.targetUser
- The new user.procInstId
- The process instance id.workItemId
- The work item id.
java.lang.Exception
- Workflow client exception.WMAttributeIterator listWorkItemAttributes(WMSessionHandle shandle, java.lang.String procInstId, java.lang.String workItemId, WMFilter filter, boolean countFlag) throws java.lang.Exception
tsNext()
method.
procInstId
- The process instance id.workItemId
- The work item id.filter
- The filter or null.countFlag
- True to return count value.
WMAttribute
objects.
java.lang.Exception
- Workflow client exception.WMAttribute getWorkItemAttributeValue(WMSessionHandle shandle, java.lang.String procInstId, java.lang.String workItemId, java.lang.String attrName) throws java.lang.Exception
procInstId
- The process instance id.workItemId
- The work item id.attrName
- The attribute name.
java.lang.Exception
- Workflow client exception.void assignWorkItemAttribute(WMSessionHandle shandle, java.lang.String procInstId, java.lang.String workItemId, java.lang.String attrName, java.lang.Object attrValue) throws java.lang.Exception
procInstId
- The process instance id.workItemId
- The work item id.attrName
- The attribute name.attrValue
- The attribute value.
java.lang.Exception
- Workflow client exception.void changeProcessInstancesState(WMSessionHandle shandle, java.lang.String procDefId, WMFilter filter, WMProcessInstanceState newState) throws java.lang.Exception
procDefId
- The ID of the process definition for which instances are to be
changed.filter
- A filter specification; can be null
.newState
- The new state to apply.
java.lang.Exception
- Workflow client exception.void changeActivityInstancesState(WMSessionHandle shandle, java.lang.String procDefId, java.lang.String actDefId, WMFilter filter, WMActivityInstanceState newState) throws java.lang.Exception
procDefId
- The ID of the process definition for which activity instances are
to be changed.actDefId
- The ID of the activity definition for which instances are to be
changed.filter
- A filter specification; can be null
.newState
- The new state to apply.
java.lang.Exception
- Workflow client exception.void terminateProcessInstances(WMSessionHandle shandle, java.lang.String procDefId, WMFilter filter) throws java.lang.Exception
procDefId
- The ID of the process definition for which instances are to be
terminated.filter
- A filter specification; can be null
.
java.lang.Exception
- Workflow client exception.void assignProcessInstancesAttribute(WMSessionHandle shandle, java.lang.String procDefId, WMFilter filter, java.lang.String attrName, java.lang.Object attrValue) throws java.lang.Exception
procDefId
- The ID of the process definition for which instance attributes are
to be assigned.filter
- A filter specification; can be null
.attrName
- The attribute name.attrValue
- The attribute value.
java.lang.Exception
- Workflow client exception.void assignActivityInstancesAttribute(WMSessionHandle shandle, java.lang.String procDefId, java.lang.String actDefId, WMFilter filter, java.lang.String attrName, java.lang.Object attrValue) throws java.lang.Exception
procDefId
- The ID of the process definition for which activity instance
attributes are to be assigned.actDefId
- The ID of the activity definition for which instance attributes are
to be assigned.filter
- A filter specification; can be null
.attrName
- The attribute name.attrValue
- The attribute value.
java.lang.Exception
- Workflow client exception.void abortProcessInstances(WMSessionHandle shandle, java.lang.String procDefId, WMFilter filter) throws java.lang.Exception
procDefId
- The ID of the process definition for which instances are to be
aborted.filter
- A filter specification; can be null
.
java.lang.Exception
- Workflow client exception.void abortProcessInstance(WMSessionHandle shandle, java.lang.String procInstId) throws java.lang.Exception
procInstId
- The ID of the process instance to abort.
java.lang.Exception
- Workflow client exception.WMProcessDefinition getProcessDefinition(WMSessionHandle shandle, java.lang.String procDefName) throws java.lang.Exception
procDefName
- The process definition unique name.
java.lang.Exception
- Workflow client exception.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |