com.bea.wlpi.server.workflowprocessor
Interface WorkflowProcessor


public interface WorkflowProcessor
extends javax.ejb.EJBObject

Provides behavior for workflow instances.

Author:
Copyright © 2000 BEA Systems, Inc. All Rights Reserved.
See Also:
WorkflowProcessorHome

Method Summary
 void eventTrigger(java.lang.String instanceId, java.lang.String eventId, org.w3c.dom.Node root)
          Handle an XML event that was raised by the event processor.
 com.bea.wlpi.server.workflow.Task getTaskForAction(java.lang.String actionId)
          This method returns a workflow task based on the incoming action ID.
 com.bea.wlpi.server.instance.WorkflowInstanceData getWorkflowInstanceData(java.lang.String instanceId)
          Retrieve the runtime state of the associated workflow instance.
 java.lang.String instantiate(java.lang.String orgId, java.lang.String initialNode, java.lang.String parentTemplateDefinitionId, java.lang.String parentId, java.lang.String parentNodeId, org.w3c.dom.Node root, java.util.List variableValues)
          Create a new workflow instance.
 java.lang.String instantiate(java.lang.String org, java.lang.String initialNode, java.lang.String parentTemplateDefinitionId, java.lang.String parentId, java.lang.String parentNodeId, org.w3c.dom.Node root, java.util.List variableValues, com.bea.b2b.wlpi.ConversationController controller, java.lang.String id)
          Create a new workflow instance.
 java.lang.String invokeWorkflowErrorHandler(java.lang.String instanceId, java.lang.String handlerName, java.lang.String xml)
          Invoke an error handler for a workflow instance.
 java.lang.String response(java.lang.String instanceId, java.lang.String nodeId, java.lang.String xml)
          Send the client's response to a previously received client request.
 void setVariable(java.lang.String instanceId, java.lang.String variable, java.lang.Object value)
          Assign a value to a workflow instance variable.
 void startedWorkflowDone(java.lang.String instanceId, java.lang.String nodeId, java.util.Collection output)
          Notification that a sub-workflow has completed.
 java.lang.String taskAssign(java.lang.String instanceId, java.lang.String taskId, java.lang.String assigneeId, boolean isRole, boolean bLoadBalance)
          Assign a task to a participant.
 java.lang.String taskDoit(java.lang.String instanceId, java.lang.String taskId)
          Execute a task instance.
 java.lang.String taskMarkDone(java.lang.String instanceId, java.lang.String taskId)
          Mark a task instance as complete.
 java.lang.String taskSetProperties(java.lang.String instanceId, java.lang.String taskId, int priority, boolean doneWithoutDoit, boolean doitIfDone, boolean unmarkDone, boolean modify, boolean reassign)
          Set the properties for a task instance.
 java.lang.String taskUnassign(java.lang.String instanceId, java.lang.String taskId)
          Assign a task.
 java.lang.String taskUnmarkDone(java.lang.String instanceId, java.lang.String taskId)
          Mark a task as incomplete.
 void timeTrigger(java.lang.String instanceId, java.lang.String nodeId)
          Handle a timed event that was raised by the time processor.
 
Methods inherited from interface javax.ejb.EJBObject
getEJBHome, getHandle, getPrimaryKey, isIdentical, remove
 

Method Detail

instantiate

public java.lang.String instantiate(java.lang.String orgId,
                                    java.lang.String initialNode,
                                    java.lang.String parentTemplateDefinitionId,
                                    java.lang.String parentId,
                                    java.lang.String parentNodeId,
                                    org.w3c.dom.Node root,
                                    java.util.List variableValues)
                             throws java.rmi.RemoteException,
                                    WorkflowException
Create a new workflow instance.

Parameters:
orgId - The ID of the organization within which the instance is to run.
initialNode - The ID of the start node to activate.
parentTemplateDefinitionId - The ID of the parent template definition (if instantiating a sub-workflow).
parentId - The ID of the parent workflow instance (if instantiating a sub-workflow).
parentNodeId - The ID of the node in the parent workflow to be notified of events in subflows life-cycle (if instantiating a sub-workflow).
root - The XML/DOM document element of the trigger event that caused this method to be called.
variableValues - List of VariableInfo objects to initialize the workflow instance variables.
Returns:
The ID of the new workflow instance.
Throws:
java.rmi.RemoteException - if a communications error occurred.
WorkflowException - if the workflow could not be instantiated.

instantiate

public java.lang.String instantiate(java.lang.String org,
                                    java.lang.String initialNode,
                                    java.lang.String parentTemplateDefinitionId,
                                    java.lang.String parentId,
                                    java.lang.String parentNodeId,
                                    org.w3c.dom.Node root,
                                    java.util.List variableValues,
                                    com.bea.b2b.wlpi.ConversationController controller,
                                    java.lang.String id)
                             throws WorkflowException,
                                    java.rmi.RemoteException
Create a new workflow instance.

Parameters:
orgId - Id of organization within which instance is to run.
initialNode - Id of start node to activate.
parentTemplateDefinitionId - Id of parent template definition (if instantiating a sub-workflow).
parentId - Id of parent workflow instance (if instantiating a sub-workflow).
parentNodeId - Id of node in parent workflow to be notified of events in subflows life-cycle (if instantiating a sub-workflow).
root - XML/DOM document element of trigger event which caused this method to be called.
variableValues - List of VariableInfo objects to initialize the workflow instance variables.
Returns:
Id of new workflow instance.
Throws:
java.rmi.RemoteException - if a communications error occurred.
WorkflowException - if the workflow could not be instantiated.

taskDoit

public java.lang.String taskDoit(java.lang.String instanceId,
                                 java.lang.String taskId)
                          throws java.rmi.RemoteException,
                                 WorkflowException
Execute a task instance. The default implementation causes the actions associated with the task's "executed" event to be performed in sequence.

Parameters:
instanceId - The ID of the workflow instance.
taskId - The ID of the task instance.
Returns:
A response string (in XML format) compliant with the client request document type definition. The response contains details of all workflow and task updates that occurred as a consequence of the call and may also contain requests that the client is expected to handle. Such requests are generated by the ActionSendXMLToClient action (and subclasses thereof) and are compliant with the call executable program, call Java class, display message box or set variable values document type definitions. Additional request types are likely to be defined in the future. Custom clients are free to define their own services and XML formats (provided these do not create ambiguities when referenced from the generic client request document type definition).
Throws:
java.rmi.RemoteException - if a communications error occurred.
WorkflowException - if the method is called by a client process and the task is not assigned to that user, or the task is complete but the task's properties do not permit it to be executed when complete, or if an exception prevents the task from being executed.

taskMarkDone

public java.lang.String taskMarkDone(java.lang.String instanceId,
                                     java.lang.String taskId)
                              throws java.rmi.RemoteException,
                                     WorkflowException
Mark a task instance as complete. The default implementation sets the task "completed" date to the current date/time and causes any actions associated with the task's "markeddone" event to be performed in sequence.

Parameters:
instanceId - The ID of the workflow instance.
taskId - The ID of the task instance.
Returns:
A response string as described under taskDoit(java.lang.String, java.lang.String).
Throws:
java.rmi.RemoteException - if a communications error occurred.
WorkflowException - if the method is called by a client process and the task's properties do not permit it to be marked complete or if an exception prevents the task from being marked complete.

taskUnmarkDone

public java.lang.String taskUnmarkDone(java.lang.String instanceId,
                                       java.lang.String taskId)
                                throws java.rmi.RemoteException,
                                       WorkflowException
Mark a task as incomplete. The default implementation clears the task's "completed" date, but does not cause the execution of any actions defined for the task's "activated" event.

Parameters:
instanceId - The ID of the workflow instance.
taskId - The ID of the task instance.
Returns:
A response string as described under taskDoit(java.lang.String, java.lang.String).
Throws:
java.rmi.RemoteException - if a communications error occurred.
WorkflowException - if the method is called by a client process and the task's properties do not permit it to be marked incomplete or if an exception prevents the task from being marked incomplete.

taskAssign

public java.lang.String taskAssign(java.lang.String instanceId,
                                   java.lang.String taskId,
                                   java.lang.String assigneeId,
                                   boolean isRole,
                                   boolean bLoadBalance)
                            throws java.rmi.RemoteException,
                                   WorkflowException
Assign a task to a participant. The actual participant to whom the system assigns the task depends on: 1.) whether any task reroutes are currently in force for the nominated assignee and 2.) the value of the bLoadBalance argument.

Parameters:
instanceId - The ID of the workflow instance.
taskId - The ID of the task instance.
assigneeId - The ID of participant to whom the task is to be assigned.
isRole - true if the assignee ID is that of a role, false if that of a user.
bLoadBalance - true to request the system to perform load-balancing within the specified role. This argument is ignored if the isRole argument is false.
Returns:
A response string as described under taskDoit(java.lang.String, java.lang.String).
Throws:
java.rmi.RemoteException - if a communications error occurred.
WorkflowException - if the method is called by a client process and the task's properties do not permit it to be reassigned or if an exception prevents task assignment.

taskUnassign

public java.lang.String taskUnassign(java.lang.String instanceId,
                                     java.lang.String taskId)
                              throws java.rmi.RemoteException,
                                     WorkflowException
Assign a task.

Parameters:
instanceId - The ID of the workflow instance.
taskId - The ID of the task instance.
Returns:
A response string as described under taskDoit(java.lang.String, java.lang.String).
Throws:
java.rmi.RemoteException - if a communications error occurred.
WorkflowException - if the method is called by a client process and the task's properties do not permit it to be reassigned or if an exception prevents task assignment.

taskSetProperties

public java.lang.String taskSetProperties(java.lang.String instanceId,
                                          java.lang.String taskId,
                                          int priority,
                                          boolean doneWithoutDoit,
                                          boolean doitIfDone,
                                          boolean unmarkDone,
                                          boolean modify,
                                          boolean reassign)
                                   throws java.rmi.RemoteException,
                                          WorkflowException
Set the properties for a task instance.

Parameters:
instanceId - The ID of the workflow instance.
taskId - The ID of the task instance.
priority - The default task instance priority (0=low, 1=medium or 2=high).
doneWithoutDoit - true to permit a user to mark a task instance as complete (by calling the taskMarkDone(java.lang.String, java.lang.String) method).
doitIfDone - true to permit a user to execute a task instance after it has been marked as complete (by calling the taskDoit(java.lang.String, java.lang.String) method).
unmarkDone - true to permit a user to mark a task instance as incomplete (by calling the taskUnmarkDone(java.lang.String, java.lang.String) method).
modify - true to permit a user to modify a task instance's runtime properties (by calling this method).
reassign - true to permit a user to reassign a task instance to another participant (by calling the taskAssign(java.lang.String, java.lang.String, java.lang.String, boolean, boolean) method).
Returns:
A response string as described under taskDoit(java.lang.String, java.lang.String).
Throws:
java.rmi.RemoteException - if a communications error occurred.
WorkflowException - if the method is called by a client process and the task's properties do not permit it to be modified or if an exception prevents the setting of the properties.

response

public java.lang.String response(java.lang.String instanceId,
                                 java.lang.String nodeId,
                                 java.lang.String xml)
                          throws java.rmi.RemoteException,
                                 WorkflowException
Send the client's response to a previously received client request. This request will generally have been raised by an ActionSendXMLToClient action, using one of the standard DTDs or a client-define custom DTD. The response DTD matches the request DTD and the XML document contains the results of executing the server's request. The originating action typically uses the XPath function to extract the required values from the document. Clients are free to define custom request and response DTDs.

Parameters:
instanceId - The ID of the workflow instance.
nodeId - The ID of the object that raised the client request to which this call is responding.
xml - The client's request-specific response (in XML format) compliant with the document type definition called program response, called Java class response, message box response, set variables response or a custom format defined by the client.
Returns:
A further response string as described under taskDoit(java.lang.String, java.lang.String).
Throws:
java.rmi.RemoteException - if a communications error occurred.
WorkflowException - if an exception occurred while processing the response document.

eventTrigger

public void eventTrigger(java.lang.String instanceId,
                         java.lang.String eventId,
                         org.w3c.dom.Node root)
                  throws java.rmi.RemoteException,
                         WorkflowException
Handle an XML event that was raised by the event processor.

Parameters:
instanceId - Id of workflow instance.
eventId - Id of the event trigger record.
root - XML/DOM document element of trigger event that caused this method to be called.
Throws:
java.rmi.RemoteException - if a communications error occurred.
WorkflowException - if an exception occurred while processing the event notification.

timeTrigger

public void timeTrigger(java.lang.String instanceId,
                        java.lang.String nodeId)
                 throws java.rmi.RemoteException,
                        WorkflowException
Handle a timed event that was raised by the time processor.

Parameters:
instanceId - The ID of the workflow instance.
nodeId - The ID of the workflow node that scheduled the timed event.
Throws:
java.rmi.RemoteException - if a communications error occurred.
WorkflowException - if an exception occurred while processing the timed event notification.

startedWorkflowDone

public void startedWorkflowDone(java.lang.String instanceId,
                                java.lang.String nodeId,
                                java.util.Collection output)
                         throws java.rmi.RemoteException,
                                WorkflowException
Notification that a sub-workflow has completed.

Parameters:
instanceId - The ID of the workflow instance.
nodeId - The ID of the workflow node that started the sub-workflow.
output - A collection of VariableInfo objects containing the output variable values, representing the final runtime state of the subflow instance.
Throws:
java.rmi.RemoteException - if a communications error occurred.
WorkflowException - if an exception occurred while processing the notification.

setVariable

public void setVariable(java.lang.String instanceId,
                        java.lang.String variable,
                        java.lang.Object value)
                 throws java.rmi.RemoteException,
                        WorkflowException
Assign a value to a workflow instance variable.

Parameters:
instanceId - The ID of the workflow instance.
variable - The name of the variable.
value - The value to assign.
Throws:
java.rmi.RemoteException - if a communications error occurred.
WorkflowException - if the assignment failed.

invokeWorkflowErrorHandler

public java.lang.String invokeWorkflowErrorHandler(java.lang.String instanceId,
                                                   java.lang.String handlerName,
                                                   java.lang.String xml)
                                            throws java.rmi.RemoteException,
                                                   WorkflowException
Invoke an error handler for a workflow instance. The api passes the specified XML document to the error handler.

Parameters:
instanceId - The id of the workflow instance for which the error handler should be invoked.
handlerName - The name of the error handler to invoke.
xml - The XML document to pass to the error handler.
Returns:
A response string as described under taskDoit(java.lang.String, java.lang.String).
Throws:
java.rmi.RemoteException - if a communications error occurred.
WorkflowException - if the error handler exits with the rollback option.

getWorkflowInstanceData

public com.bea.wlpi.server.instance.WorkflowInstanceData getWorkflowInstanceData(java.lang.String instanceId)
                                                                          throws java.rmi.RemoteException,
                                                                                 WorkflowException
Retrieve the runtime state of the associated workflow instance.

Parameters:
instanceId - The workflow instance ID.
Returns:
The workflow instance state.
Throws:
java.rmi.RemoteException - if a communications error occurred.
WorkflowException - if an error occurred while accessing the workflow instance.

getTaskForAction

public com.bea.wlpi.server.workflow.Task getTaskForAction(java.lang.String actionId)
                                                   throws java.rmi.RemoteException
This method returns a workflow task based on the incoming action ID. It returns null if no node is found

Parameters:
String - actionId Action id value