|
ALBPM Process API (PAPI) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
ProcessServiceSession contains methods to store presentation and views, to add attachments and notes,
and to process activities and instances. Methods for creating views and presentations as well as methods for getting
activities, attachments, instances, notes, and processes are in ProcessServiceNESession.
// Creates the ProcessService.
ProcessService processService = ProcessService.create(...);
// Creates the passport which will connect the user.
ConnectionPassport passport = processService.createPassport("userId);
// Sets the password of the user.
passport.setPassword("userPassport");
// Creates a new session with the passport and the user's host.
ProcessServiceSession session = processService.createSession(passport, "userHost");
| Method Summary | |
void |
abortActivity(String instanceId,
String activityName,
int taskIn)
Locates instance identified by instanceId in activity activityName and aborts the running task identified by taskIn. |
void |
addBookmarks(InstanceStamp[] instancesStamp)
Adds bookmarks. |
void |
checkInAttachment(Attachment attachment,
String remarks,
File file)
Checks in an attachment. If successful, this will always generate a new attachment version. |
void |
checkOutAttachment(Attachment attachment,
String directory)
Writes the attachment to the specified directory. |
void |
checkOutAttachmentToStream(Attachment attachment,
OutputStream stream)
Writes the attachment to the specified output stream. |
InstanceInfo |
commitExternalActivity(String instanceStampId,
int taskIn,
Arguments args)
Executes the commit method of an external activity using the specified InstanceStampId and task identification number. |
InstanceInfo |
commitExternalActivity(String instanceId,
String activityName,
Arguments args)
Executes the commit method of the main task of an external activity using the specified instanceId and activityId. |
InstanceInfo |
commitExternalActivity(String instanceId,
String activityName,
int taskIn,
Arguments args)
Executes the commit method of an external activity using the specified instanceId, activityId, and task identification number. |
TaskExecution |
customRunActivity(String instanceId,
String activityName,
Arguments args)
Executes the main task for this instance using an instanceId and activityId. Allows a PAPI client to customize client-side invocations. |
TaskExecution |
customRunActivity(String instanceId,
String activityName,
int taskIn,
Arguments args)
Executes the task for this instance using an instanceId, activityId, and task identification number. Allows a PAPI client to customize client-side invocations. |
TaskExecution |
customRunGlobal(String instanceId,
String activityName,
Arguments args)
Executes the specified Global Activity for this instance using an instanceId and activityName. Allows a PAPI client to customize client-side invocations. |
TaskExecution |
customRunTask(String instanceStampId,
int taskIn,
Arguments args)
Executes the specified task for this instance using an instanceStampId and task identification number. Allows a PAPI client to customize client-side invocations. |
TaskExecution |
customRunTask(String instanceId,
String activityName,
int taskIn,
Arguments args)
Deprecated. use customRunActivity(String,String,int,Arguments) instead |
List |
getDelegateParticipants(InstanceStamp instance)
Gets a list of participants that this instance can be delegated to. |
List |
getEscalateParticipants(InstanceStamp instance)
Gets a list of participants that this instance can be escalated to. |
InstanceInfo[] |
getGrabbableInstances(String activityId)
Returns all the instances that can be grabbed from the activity specified by the activity ID. |
List |
getParticipantsForInstance(InstanceStamp instance)
Gets a list of Participants that are in the role specified by the activity in the InstanceStamp. |
void |
instanceAttach(InstanceInfo instanceInfo,
String name,
String description,
String remarks,
File file)
Attaches a file attachment to this process instance. |
void |
instanceAttach(InstanceInfo instanceInfo,
String name,
String description,
String remarks,
File file,
String contentType)
Attaches a file with the specified content type to this process instance. |
boolean |
instanceCanBeAborted(InstanceInfo instance)
Returns true if the instance can be aborted. |
boolean |
instanceCanBeBack(InstanceInfo instance)
Returns true if the instance can be routed back. |
boolean |
instanceCanBeDelegate(InstanceInfo instance)
Returns true if the instance can be delegated. |
boolean |
instanceCanBeEscalate(InstanceInfo instance)
Returns true if this instance can be escalated. |
boolean |
instanceCanBeProcessed(InstanceInfo instance)
Returns true if the instance can be processed. |
boolean |
instanceCanBeReassign(InstanceInfo instance)
Returns true if the instance can be reassigned. |
boolean |
instanceCanBeReassignedToPeer(InstanceInfo instance)
Returns true if this instance can be reassigned to a peer. |
boolean |
instanceCanBeResumed(InstanceInfo instance)
Returns true if the instance can be resumed. |
boolean |
instanceCanBeSelected(InstanceInfo instance)
Returns true if the instance can be selected by the current participant. |
boolean |
instanceCanBeSent(InstanceInfo instance)
Returns true if the instance can be sent. |
boolean |
instanceCanBeSuspended(InstanceInfo instance)
Returns true if the instance can be suspended. |
boolean |
instanceCanBeUngrabbed(InstanceInfo instance)
Returns true if the instance can be ungrabbed. |
boolean |
instanceCanBeUnselected(InstanceInfo instance)
Returns true if the instance can be unselected by the current participant
An instance can be unselected if the instance is currently selected by the participant |
void |
instanceReassign(InstanceStamp instance,
String participantId)
Reassigns the instance to the specified participant. |
void |
instancesAbort(InstanceStamp[] instances)
Aborts the specified instances. |
void |
instancesAddConsult(InstanceStamp[] instances,
String remark,
String toParticipant)
Adds consultations for the specified instances for the specified participant. |
void |
instancesAddNote(InstanceStamp[] instances,
String note)
Adds a note to the specified instances. |
List |
instancesGetTargetActivities(InstanceStamp[] instances)
Returns the activities that can receive the specified group of instances. |
Map |
instancesGetTargetParticipantsForActivity(InstanceStamp[] instances,
String activityName,
String filter,
int max)
Returns the participants who can receive the specified group of instances in the specified activity. |
void |
instancesGrab(InstanceStamp[] instances,
String grabActivityName)
Grabs a group of instances by the specified activity. |
void |
instancesResume(InstanceStamp[] instances)
Resumes a group of instances. |
void |
instancesSelect(InstanceStamp[] instances)
Selects a group of instances by the current participant. |
void |
instancesSend(InstanceStamp[] instances)
Sends a group of instances. |
void |
instancesSendBack(InstanceStamp[] instances,
boolean skip)
Sends back a group of instances. |
void |
instancesSendTo(InstanceStamp[] instances,
String activityName)
Routes a group of instances to the specified activity. |
void |
instancesSendTo(InstanceStamp[] instances,
String activityName,
String participant)
Routes a group of instances to the specified activity and participant. |
void |
instancesSuspend(InstanceStamp[] instances)
Suspends a group of instances. |
ParticipantsForActivities |
instancesTargetParticipants(InstanceStamp[] instances)
Returns the participants who can receive this array of instances. |
void |
instancesUngrab(InstanceStamp[] instances)
Ungrabs a group of instances. |
void |
instancesUnselect(InstanceStamp[] instances)
Unselects a group of instances. |
boolean |
isChangeParticipantPasswordSupported()
Returns true if the directory supports changing the participant password. |
boolean |
isExclusive()
Deprecated. now all sessions are not exclusive |
void |
obtainEditionLock(Attachment attachment)
Obtains a version lock for the attachment. |
Arguments |
prepareExternalActivity(String instanceStampId,
int taskIn,
Arguments args)
Executes the prepare method of an external activity for the task given an instanceStampId and task identification number. |
Arguments |
prepareExternalActivity(String instanceId,
String activityName,
Arguments args)
Executes the prepare method for the main task of the activity given an instanceId and an activityId. |
Arguments |
prepareExternalActivity(String instanceId,
String activityName,
int taskIn,
Arguments args)
Executes the prepare method for the specified task of the activity given an instanceId, activityId, and task identification number. |
void |
releaseEditionLock(Attachment attachment)
Releases the version lock for the attachment. |
void |
releaseEditionLock(Attachment attachment,
File file)
Releases the version lock for the attachment and deletes the specified file. |
void |
removeBookmarks(InstanceStamp[] instancesStamp)
Removes bookmarks. |
void |
removePresentation(String presentationId)
Removes the presentation specified by presentationId. |
void |
removeView(String viewId)
Removes the view specified by viewId. |
InstanceInfo |
runActivity(String instanceStampId,
Arguments args)
Executes the main task for the instance given an instanceStampId. |
InstanceInfo |
runActivity(String instanceStampId,
int taskIn,
Arguments args)
Executes the specified task for this instance given an instanceStampId and a task identification number. |
InstanceInfo |
runActivity(String instanceId,
String activityName,
Arguments args)
Executes the main task for the instance given an instanceId and activity name. |
InstanceInfo |
runActivity(String instanceId,
String activityName,
int taskIn,
Arguments args)
Executes the specified Task for this instance given an instanceId, activity name, and task identification number. |
InstanceInfo |
runGlobal(String instanceId,
String activityName,
Arguments args)
Runs a global activity. |
void |
runTask(String instanceStampId,
int taskIn,
Arguments args)
Deprecated. use runActivity(String,int,Arguments) instead |
void |
runTask(String instanceId,
String activityName,
int taskIn,
Arguments args)
Deprecated. use runActivity(String, String, int, Arguments) instead |
void |
setCanReceiveMail(boolean canReceiveMail)
Sets whether or not the user can receive mail. |
void |
storePresentation(Presentation presentation)
Stores a presentation. |
void |
storeUserProperties(String category,
Map properties)
Stores user properties with the same behavior as ProcessServiceNESession.storeUserProperties. |
void |
storeView(View view)
Stores the specified view. |
boolean |
taskCanBeProcessed(InstanceInfo instance,
int taskNumber)
Returns true if the specified task for this instance can be executed by the current participant. |
boolean |
taskCanBeSelected(InstanceInfo instance,
int taskNumber)
Returns true if the specified task for this instance can be selected by the current participant. |
boolean |
taskCanBeUnselected(InstanceInfo instance,
int taskNumber)
Returns true if the specified task for this instance can be unselected by the current participant. |
void |
tasksSelect(String instanceId,
String activityName,
int[] taskNumbers)
Selects the instance. |
void |
tasksUnselect(String instanceId,
String activityName,
int[] taskNumbers)
Unselects the instance. |
String |
toString()
Returns the name of the class. |
void |
updateUserPassword(String oldPassword,
String newPassword)
Updates the user password. |
| Method Detail |
public boolean instanceCanBeDelegate(InstanceInfo instance)
true if the instance can be delegated.
An instance can be delegated if the interactive activity has been defined as reassignable in Studio and
the participant has been given permission to delegate in Process Administrator.
instance - InstanceInfo to check if the instance can be delegated
true if the instance can be delegatedpublic boolean instanceCanBeEscalate(InstanceInfo instance)
true if this instance can be escalated.
An instance can be escalated if the interactive activity has been defined as reassignable in Studio and
the participant has been given permission to escalate in Process Administrator.
instance - InstanceInfo to check if the instance can be escalated
true if the instance can be escalatedpublic boolean instanceCanBeReassignedToPeer(InstanceInfo instance)
true if this instance can be reassigned to a peer.
An instance can be reassigned to a peer if the interactive activity has been defined as reassignable in Studio
and the participant has been given permission for peer assignment in Process Administrator.
instance - InstanceInfo to check if the instance can be reassigned to a peer
true if the instance can be reassigned to a peer
public List instancesGetTargetActivities(InstanceStamp[] instances)
throws BatchOperationException
instances - array of InstanceStamp with the instances to be queried
BatchOperationException - if the session could not perform the operation for each instanceInstancesException if not all instances are available to
perform the operation.InstanceOperationException if the operation fails on an
instance.InstanceNotFoundException if an instance not exist.InstanceNotInActivityException if an instance is no
longer in activity where the stamp specify.
public Map instancesGetTargetParticipantsForActivity(InstanceStamp[] instances,
String activityName,
String filter,
int max)
throws OperationException,
MaxSizeParticipantsExceededException,
NoParticipantMatchesRole
instances - array of InstanceStamp with the instances to be queriedactivityName - the activity name for the activity where the instance will be sentfilter - the pattern to execute the search for the participantsmax - maximum number of participants to be returned; if it is exceeded,
MaxSizeParticipantsExceededException will be thrown
OperationException - if the session could not perform the operationProcessNotAvailableException if the process of an instance is not
availableInstanceNotFoundException if an instance was not foundMaxSizeParticipantsExceededException - if the maximum number of participants is exceeded
NoParticipantMatchesRole - if there are not participants assigned to the role of the activity
public void setCanReceiveMail(boolean canReceiveMail)
throws OperationException
canReceiveMail - true if the user can receive mail
OperationExceptionpublic boolean isChangeParticipantPasswordSupported()
true if the directory supports changing the participant password.
true if the directory supports changing the participant password
public List getDelegateParticipants(InstanceStamp instance)
throws OperationException,
BatchOperationException
instance - InstanceStamp to get the list of participants; cannot be null
OperationException - if the session could not perform the operation
May be one of the following subclasses of OperationException:
ProcessNotAvailableException if the process is not availableInstanceNotFoundException if the instance does not existBatchOperationException - if the session could not perform the operation on the instanceInstancesException if not all instances are available to
perform the operation.InstanceNotFoundException if an instance not exist.InstanceNotInActivityException if an instance is no
longer in activity where the stamp specify.
public List getEscalateParticipants(InstanceStamp instance)
throws OperationException,
BatchOperationException
instance - InstanceStamp to get the list of participants; cannot be null
OperationException - if the session could not perform the operationProcessNotAvailableException if the process is not availableInstanceNotFoundException if the instance does not existBatchOperationException - if the session could not perform the operation on the instanceInstancesException if not all instances are available to
perform the operation.InstanceNotFoundException if an instance not exist.InstanceNotInActivityException if an instance is no
longer in activity where the stamp specify.public boolean isExclusive()
false.
isExclusive in interface ProcessServiceNESession
public InstanceInfo[] getGrabbableInstances(String activityId)
throws OperationException,
BatchOperationException
activityId - ID of the grab activity; cannot be null
OperationException - if the session could not perform the operationProcessNotAvailableException if the process is not availableBatchOperationException - if the session could not perform the operation on every activityProcessesNotAvailableException if not all instances are available to
perform the operation..InstancesNotAvailableInEngineException if the engine where
a process was deployes is not available.ProcessNotAvailableException if a process is not available.
public List getParticipantsForInstance(InstanceStamp instance)
throws OperationException,
BatchOperationException
instance - InstanceStamp to get the list of participants; cannot be null
OperationException - if the session could not perform the operationProcessNotAvailableException if the process is not availableInstanceNotFoundException if the instance does not existBatchOperationException - if the session could not perform the operation on the instanceInstancesException if not all participants are available to
perform the operation.InstanceNotFoundException if an instance not exist.InstanceNotInActivityException if an instance is no
longer in activity where the stamp specify.
public void addBookmarks(InstanceStamp[] instancesStamp)
throws OperationException
instancesStamp - array of InstanceStamps; a bookmark will be added for each InstanceStamp;
cannot be null.
OperationException - if the session could not bookmark the instances
public void checkInAttachment(Attachment attachment,
String remarks,
File file)
throws OperationException
attachment - the attachment to check in; cannot be nullremarks - version-specific remarks to add to the attachment; cannot be null;
the maximum length of remarks is Attachment.REMARK_LENGTHfile - file to check in for the new attachment version; cannot be null
OperationException - if the session could not perform the operation
May be one of the following subclasses of OperationException:
ProcessNotAvailableException if the process is not availableInvalidAttachmentArgumentLengthException if the remarks argument
of the attachment exceeds the limit of the argument lengthAttachmentFileNotFoundException if the file does not existAttachmentOperationException if the attachment could not be checked in
public void checkOutAttachment(Attachment attachment,
String directory)
throws OperationException
attachment - attachment to write; cannot be nulldirectory - directory where the file will be written;
this directory must already exist; if this is a relative directory, it is
relative to where the PAPI program is running
OperationException - if the session could not perform the operation
May be one of the following subclasses of OperationException:
ProcessNotAvailableException if the process is not availableAttachmentOperationException if the attachment could not be written to the
specified directory, if a version lock has not been obtained, or if the current user does not
hold the version lock
public void checkOutAttachmentToStream(Attachment attachment,
OutputStream stream)
throws OperationException
//get a process service session
ProcessServiceSession processSession = ...;
//get the attachment id, probably from an InstanceInfo
String attachmentId = ...;
//get the attachment associated with this attachmentId
Attachment attachment = processSession.getAttachment(attachmentId);
//check out the attachment
processSession.obtainEditionLock(attachment);
//get the output stream
OutputStream outputStream = response.getOutputStream;
//set the appropriate headers
response.setContentType(attachment.getContentType());
//put the filename in quotes
response.setHeader("Content-Disposition", "attachment; filename=\"" + attachment.getName() + "\"");
//write the file to the output stream
processSession.checkOutAttachmentToStream(attachment, outputStream);
attachment - attachment to write; cannot be nullstream - OutputStream to write the attachment to; cannot be null
OperationException - if the session could not perform the operation
May be one of the following subclasses of OperationException:
ProcessNotAvailableException if the process is not availableAttachmentOperationException if the attachment could not be written to the
specified directory, if a version lock has not been obtained, or if the current user does not
hold the version lock
public InstanceInfo commitExternalActivity(String instanceStampId,
int taskIn,
Arguments args)
throws OperationException
instanceStampId - instance stamp that identifies the target instance; cannot be nulltaskIn - identification number of task to executeargs - arguments to be passed to the commit method of the external activity;
null means no arguments
OperationException - if the session could not perform the operation
May be one of the following subclasses of OperationException:
ProcessNotAvailableException if the process is not availableInstanceNotFoundException if the instance in the instance stamp
does not existActivityNotFoundException if the activity in the instance stamp
does not exist.InstanceNotInActivityException if the instance is not in the
activityNoPermissionException if the participant session does not have
the execution permissionActivityFailedException if the execution fails
public InstanceInfo commitExternalActivity(String instanceId,
String activityName,
Arguments args)
throws OperationException
instanceId - instance ID that identifies the target instance; cannot be nullactivityName - Activity name that identifies the activity to execute; cannot be nullargs - arguments to be passed to the commit method of the external activity;
null means no arguments
OperationException - if the session could not perform the operation
May be one of the following subclasses of OperationException:
ProcessNotAvailableException if the process is not availableInstanceNotFoundException if the instance does not existActivityNotFoundException if the activity does not existInstanceNotInActivityException if the instance is not in the
activityNoPermissionException if the participant session does not have
the execution permissionActivityFailedException if the execution fails
public InstanceInfo commitExternalActivity(String instanceId,
String activityName,
int taskIn,
Arguments args)
throws OperationException
instanceId - instance ID that identifies the target instance; cannot be nullactivityName - activity name that identifies the activity to execute; cannot be nulltaskIn - identification number of task to executeargs - arguments to be passed to the commit method of the external activity
null means no arguments
OperationException - if the session could not perform the operation
May be one of the following subclasses of OperationException:
ProcessNotAvailableException if the process is not availableInstanceNotFoundException if the instance does not existActivityNotFoundException if the activity does not existInstanceNotInActivityException if the instance is not in the
activityNoPermissionException if the participant session does not have
the execution permissionActivityFailedException if the execution fails
public TaskExecution customRunActivity(String instanceId,
String activityName,
int taskIn,
Arguments args)
throws OperationException
// Define the arguments of the activity.
Arguments arguments = Arguments.create();
argument.putArgument("MyStringArgument", "StringValue");
argument.putArgument("MyIntegerArgument", 1000);
// Search the instance to execute.
Filter filter = ProcessService.createFilter();
filter.setMatchAll(true);
filter.addAttribute(session.getVar("OrderNumber"), Comparison.IS, new Integer(12345));
filter.addAttribute(session.getVar(VarDefinition.ACTIVITY_ID, Comparison.IS, "ActivityToExecute");
InstanceInfo[] instances = session.getInstancesByFilter(new String[] { "/OU/MyProcess" }, filter);
Instance instance = instances[0];
// Select the task to execute.
Activity activity = instance.getActivity();
Task task = activity.getTask("TaskToExecute");
// Execute the activity.
TaskExecution execution = session.customRunActivity(instance.getId(), instance.getActivityName(),
task.getIn(), arguments);
for (Invocation inv = execution.next(); inv != null; inv = execution.next()) {
execution.setInvocationResult(inv.invoke());
}
// Call getArguments() so argument replacement is performed
execution.getArguments();
// Get the output arguments
String myOutputStringArgument = (String) arguments.getArgument("MyOutputStringArgument");
String result = (String) arguments.getArgument(Arguments.RESULT);
instanceId - instance ID that identifies the InstanceInfo to execute; cannot be null.activityName - activity name that identifies the target activity to execute; cannot be nulltaskIn - task identification number of the task to executeargs - arguments to pass to the task; null means no arguments
OperationException - if the session could not perform the operation
May be one of the following subclasses of OperationException:
ProcessNotAvailableException if the process is not availableInstanceNotFoundException if the instance does not existActivityNotFoundException if the activity does not existInstanceNotInActivityException if the instance is not in the
activityNoPermissionException if the participant session does not have
the execution permissionActivityFailedException if the execution fails
public TaskExecution customRunActivity(String instanceId,
String activityName,
Arguments args)
throws OperationException
// Define the arguments of the activity.
Arguments arguments = Arguments.create();
argument.putArgument("MyStringArgument", "StringValue");
argument.putArgument("MyIntegerArgument", 1000);
// Search the instance to execute.
Filter filter = ProcessService.createFilter();
filter.setMatchAll(true);
filter.addAttribute(session.getVar("OrderNumber"), Comparison.IS, new Integer(12345));
filter.addAttribute(session.getVar(VarDefinition.ACTIVITY_ID, Comparison.IS, "ActivityToExecute");
InstanceInfo[] instances = session.getInstancesByFilter(new String[] { "/OU/MyProcess" }, filter);
Instance instance = instances[0];
// Execute the activity.
TaskExecution execution = session.customRunActivity(instance.getId(), instance.getActivityName(), arguments);
for (Invocation inv = execution.next(); inv != null; inv = execution.next()) {
execution.setInvocationResult(inv.invoke());
}
// Call getArguments() so argument replacement is performed
execution.getArguments();
// Get the output arguments
String myOutputStringArgument = (String) arguments.getArgument("MyOutputStringArgument");
String result = (String) arguments.getArgument(Arguments.RESULT);
instanceId - instance ID that identifies the InstanceInfo to execute; cannot be nullactivityName - activity name that identifies the target activity to execute; cannot be nullargs - arguments to pass to the task; null means no arguments
OperationException - if the session could not perform the operation
May be one of the following subclasses of OperationException:
ProcessNotAvailableException if the process is not availableInstanceNotFoundException if the instance does not existActivityNotFoundException if the activity does not existInstanceNotInActivityException if the instance is not in the
activityNoPermissionException if the participant session does not have
the execution permissionActivityFailedException if the execution fails
public TaskExecution customRunGlobal(String instanceId,
String activityName,
Arguments args)
throws OperationException
// Define the arguments of the activity.
Arguments arguments = Arguments.create();
argument.putArgument("MyStringArgument", "StringValue");
argument.putArgument("MyIntegerArgument", 1000);
// Search the instance to execute.
Filter filter = ProcessService.createFilter();
filter.setMatchAll(true);
filter.addAttribute(session.getVar("OrderNumber"), Comparison.IS, new Integer(12345));
InstanceInfo[] instances = session.getInstancesByFilter(new String[] { "/OU/MyProcess" }, filter);
Instance instance = instances[0];
// Execute the activity.
TaskExecution execution = session.customRunActivity(instance.getId(),
"GlobalInstanceActivityToExecute",
arguments);
for (Invocation inv = execution.next(); inv != null; inv = execution.next()) {
execution.setInvocationResult(inv.invoke());
}
// Call getArguments() so argument replacement is performed
execution.getArguments();
// Get the output arguments
String myOutputStringArgument = (String) arguments.getArgument("MyOutputStringArgument");
String result = (String) arguments.getArgument(Arguments.RESULT);
instanceId - instance ID that identifies the InstanceInfo to execute; cannot be nullactivityName - activity name that identifies the target activity to execute; cannot be nullargs - arguments to pass to the task; null means no arguments
OperationException - if the session could not perform the operation
May be one of the following subclasses of OperationException:
ProcessNotAvailableException if the process is not availableInstanceNotFoundException if the instance does not existActivityNotFoundException if the activity does not existNoPermissionException if the participant session does not have
the execution permissionActivityFailedException if the execution fails
public TaskExecution customRunTask(String instanceId,
String activityName,
int taskIn,
Arguments args)
throws OperationException
customRunActivity(String,String,int,Arguments) instead
instanceId - instance ID that identifies the InstanceInfo to execute; cannot be nullactivityName - activity name that identifies the target activity to execute; cannot be nulltaskIn - task identification number of the task to executeargs - arguments to pass to the task; null means no arguments
OperationException - if the session could not perform the operation
May be one of the following subclasses of OperationException:
ProcessNotAvailableException if the process is not availableInstanceNotFoundException if the instance does not existActivityNotFoundException if the activity does not existInstanceNotInActivityException if the instance is not in the
activityNoPermissionException if the participant session does not have
the execution permissionActivityFailedException if the execution fails
public TaskExecution customRunTask(String instanceStampId,
int taskIn,
Arguments args)
throws OperationException
instanceStampId - instance stamp that identifies the target instance; cannot be nulltaskIn - identification number of task to executeargs - arguments to pass to the task; null means no arguments
OperationException - if the session could not perform the operation
May be one of the following subclasses of OperationException:
ProcessNotAvailableException if the process is not availableInstanceNotFoundException if the instance does not existActivityNotFoundException if the activity does not existInstanceNotInActivityException if the instance is not in the
activityNoPermissionException if the participant session does not have
the execution permissionActivityFailedException if the execution fails
public void instanceAttach(InstanceInfo instanceInfo,
String name,
String description,
String remarks,
File file)
throws NoPermissionException,
OperationException,
IOException
null.
instanceInfo - InstanceInfo to attach the file to; cannot be nullname - name of the attachment; cannot be null; the maximum length of the name is
Attachment.FILENAME_LENGTHdescription - brief description of the attachment; cannot be null; the maximum length of the
description is Attachment.DESCRIPT_LENGTHremarks - version-specific remarks to add to the attachment; cannot be null; the maximum
length of remarks is Attachment.REMARK_LENGTHfile - file to attach to this instance; cannot be null
NoPermissionException - if this participant does not have permission to attach the file to the instance
OperationException - if the session could not perform the operation
May be one of the following subclasses of OperationException:
ProcessNotAvailableException if the process is not availableInstanceNotFoundException if the instance does not existInvalidAttachmentArgumentLengthException if the name, description,
or remarks argument of the attachment exceeds the limit of the argument lengthAttachmentFileNotFoundException if the file does not existAttachmentOperationException if the attachment failsIOException - if an I/O error occurs
public void instanceAttach(InstanceInfo instanceInfo,
String name,
String description,
String remarks,
File file,
String contentType)
throws NoPermissionException,
OperationException,
IOException
instanceInfo - InstanceInfo to attach the file to; cannot be nullname - name of the attachment; cannot be null; the maximum length of the name is
Attachment.FILENAME_LENGTHdescription - brief description of the attachment; cannot be null; the maximum length of the
description is Attachment.DESCRIPT_LENGTHremarks - version-specific remarks to add to the attachment; cannot be null; the maximum
length of remarks is Attachment.REMARK_LENGTHfile - file to attach to this instance; cannot be nullcontentType - content type of the file, e.g. "text/html" or "application/ms-word"; cannot be null
NoPermissionException - if this participant does not have permission to attach the file to the instance
OperationException - if the session could not perform the operation.ProcessNotAvailableException if the process is not availableInstanceNotFoundException if the instance does not existInvalidAttachmentArgumentLengthException if the name, description,
or remarks argument of the attachment exceeds the limit of the argument lengthAttachmentFileNotFoundException if the file does not existAttachmentOperationException if the attachment failsIOException - if an I/O error occurspublic boolean instanceCanBeAborted(InstanceInfo instance)
true if the instance can be aborted.
An instance can be aborted if the interactive activity has been defined as abortable in Studio
and the participant has been given permission to abort in the Process Administrator.
instance - InstanceInfo to verify that the instance can be aborted
true if the instance can be abortedpublic boolean instanceCanBeBack(InstanceInfo instance)
true if the instance can be routed back.
An instance can be routed back if it is outside of the main process flow in an exception flow,
grab flow, or interruption flow.
instance - InstanceInfo to verify that the instance can be routed back
true if the instance can be routed backpublic boolean instanceCanBeProcessed(InstanceInfo instance)
true if the instance can be processed.
Processed means that the main task associated with this instance can be executed.
instance - InstanceInfo to verify that the instance can be processed
true if the instance can be processedpublic boolean instanceCanBeReassign(InstanceInfo instance)
true if the instance can be reassigned.
An instance can be reassigned if the interactive activity has been defined as reassignable in Studio and
the participant has been given permission to reassign in Process Administrator,
or if the instance is selected and the participant has been given permission to escalate or
delegate in Process Administrator.
instance - InstanceInfo to verify that the instance can be reassigned
true if the instance can be reassignedpublic boolean instanceCanBeResumed(InstanceInfo instance)
true if the instance can be resumed.
An instance can be resumed if the instance is suspended and the participant has been given permission to suspend
in Process Administrator.
instance - InstanceInfo to verify that the instance can be resumed
true if the instance can be resumedpublic boolean instanceCanBeSelected(InstanceInfo instance)
true if the instance can be selected by the current participant.
An instance can be selected if all items of the instance are currently unselected or selected by
the current participant.
instance - InstanceInfo to verify that the instance can be selected
true if the instance can be selected by the current participantpublic boolean instanceCanBeSent(InstanceInfo instance)
true if the instance can be sent.
An instance can be sent if all mandatory items of the instance are currently completed and the articipant
has been given permission to route in Process Administrator.
instance - InstanceInfo to verify that the instance can be sent
true if the instance can be sentpublic boolean instanceCanBeSuspended(InstanceInfo instance)
true if the instance can be suspended.
An instance can be suspended if the interactive activity has been defined as suspendable in Studio,
the instance is running, and the participant has been given permission to suspend
in Process Administrator.
instance - InstanceInfo to verify that the instance can be suspended
true if the instance can be suspendedpublic boolean instanceCanBeUngrabbed(InstanceInfo instance)
true if the instance can be ungrabbed.
An instance can be ungrabbed if the instance is grabbed and the participant has been given permission to grab
in Process Administrator.
instance - InstanceInfo to verify that the instance can be ungrabbed
true if the instance can be ungrabbedpublic boolean instanceCanBeUnselected(InstanceInfo instance)
true if the instance can be unselected by the current participant
An instance can be unselected if the instance is currently selected by the participant
instance - InstanceInfo to verify that the instance can be unselected
true if the instance can be unselected by the current participant
public void instanceReassign(InstanceStamp instance,
String participantId)
throws OperationException,
BatchOperationException
instance - InstanceStamp of instance to be reassigned; cannot be nullparticipantId - UID of participant to reassign the instance to; cannot be null
OperationException - if the session could not perform the operation.PrivilegedOperationException if the participant does not have
permissions to perform the operation.BatchOperationException - if the session could not perform the operation on every object
May be one of the following subclasses of BatchOperationException:
InstancesException if the operation fails.InstanceOperationException if the operation fails on an
instance.InstanceNotFoundException if an instance not exist.InstanceNotInActivityException if an instance is no
longer in activity where the stamp specify.InstanceSelectDisableException if an instance can not be reassigned
because the activity where the instance is can not be select.InstanceNotRunningException if an instance is not running.InstanceAlreadySelectedException if an instance is selected by
other participant (not by current participant).ParticipantNotInTargetRoleException if the target participant does
not have the role where the instance is.
public void instancesAbort(InstanceStamp[] instances)
throws OperationException,
BatchOperationException
instances - array of InstanceStamp specifying the instances to be aborted; cannot be null
OperationException - if the session could not perform the operation.PrivilegedOperationException if the participant does not have
permissions to perform the operation.BatchOperationException - if the session could not perform the operation for each instance
May be one of the following subclasses of BatchOperationException:
InstancesException if the session could not perform the
operation on every instance.InstanceOperationException if the operation fails on an
instance.InstanceNotFoundException if an instance not exist.InstanceNotInActivityException if an instance is no
longer in activity where the stamp specify.InstanceNotRunningException if an instance is not running.InstanceAlreadyTerminatedException if an instance is terminated.
public void instancesAddConsult(InstanceStamp[] instances,
String remark,
String toParticipant)
throws OperationException,
BatchOperationException
instances - consult will be added to each InstanceStamp in this array; cannot be nullremark - remark to include in consult; cannot be nulltoParticipant - UID of participant to be consulted; cannot be null
OperationException - if the session could not perform the operation
BatchOperationException - if the session could not perform the operation for each instance
May be one of the following subclasses of BatchOperationException:
InstancesException if the session could not perform the
operation on every instance.InstanceOperationException if the operation fails on an
instance.InstanceNotFoundException if an instance not exist.InstanceNotInActivityException if an instance is no
longer in activity where the stamp specify.
public void instancesAddNote(InstanceStamp[] instances,
String note)
throws OperationException,
BatchOperationException
instances - note will be added to each InstanceStamp in this array; cannot be nullnote - note content; cannot be null
OperationException - if the session could not perform the operation
BatchOperationException - if the session could not perform the operation for each instance
May be one of the following subclasses of BatchOperationException:
InstancesException if the session could not perform the
operation on every instance.InstanceOperationException if the operation fails on an
instance.InstanceNotFoundException if an instance not exist.InstanceNotInActivityException if an instance is no
longer in activity where the stamp specify.
public void instancesGrab(InstanceStamp[] instances,
String grabActivityName)
throws OperationException,
BatchOperationException
instances - array of InstanceStamps to grab; cannot be nullgrabActivityName - name of the grab activity; cannot be null
OperationException - if the session could not perform the operation.PrivilegedOperationException if the participant does not have
permissions to perform the operation.BatchOperationException - if the session could not perform the operation for each instance.InstancesException if the session could not perform the
operation on every instance.InstanceOperationException if the operation fails on an
instance.InstanceNotFoundException if an instance not exist.InstanceNotInActivityException if an instance is no
longer in activity where the stamp specify.NoValidTransitionAvailableException if an instance can no be
grabbed to the grab activity.InstanceNotRunningException if an instance is not running.ParticipantNotInTargetRoleException if the target participant does
not have the role where the instance is.
public void instancesResume(InstanceStamp[] instances)
throws OperationException,
BatchOperationException
instances - array of InstanceStamps to resume; cannot be null
OperationException - if the session could not perform the operation.
BatchOperationException - if the session could not perform the operation for each instance
May be one of the following subclasses of BatchOperationException:
InstancesException if the session could not perform the
operation on every instance.InstanceOperationException if the operation fails on an
instance.InstanceNotFoundException if an instance not exist.InstanceNotInActivityException if an instance is no
longer in activity where the stamp specify.InstanceNotSuspendedException if an instance is not suspended.
public void instancesSelect(InstanceStamp[] instances)
throws OperationException,
BatchOperationException
instances - array of InstanceStamps to select; cannot be null
OperationException - if the session could not perform the operation
BatchOperationException - if the session could not perform the operation for each instance
May be one of the following subclasses of BatchOperationException:
InstancesException if the session could not perform the
operation on every instance.InstanceOperationException if the operation fails on an
instance.InstanceNotFoundException if an instance not exist.InstanceNotInActivityException if an instance is no
longer in activity where the stamp specify.InstanceSelectDisableException if an instance can not be reassigned
because the activity where the instance is can not be select.InstanceNotRunningException if an instance is not running.InstanceAlreadySelectedException if an instance is selected by
other participant (not by current participant).ParticipantNotInTargetRoleException if the target participant does
not have the role where the instance is.InstanceAlreadySelectedException if the instance is selected.
public void instancesSend(InstanceStamp[] instances)
throws OperationException,
BatchOperationException
instances - array of InstanceStamps to route; cannot be null
OperationException - if the session could not perform the operation
BatchOperationException - if the session could not perform the operation for each instance
May be one of the following subclasses of BatchOperationException:
InstancesException if the session could not perform the
operation on every instance.InstanceOperationException if the operation fails on an
instance.InstanceNotFoundException if an instance not exist.InstanceNotInActivityException if an instance is no
longer in activity where the stamp specify.InstanceNotRunningException if an instance is not running.NotUniqueTransitionException if an instance has more than one
target activity.NoValidTransitionAvailableException if an instance does not have
target activities.
public void instancesSendBack(InstanceStamp[] instances,
boolean skip)
throws OperationException,
BatchOperationException
instances - array of InstanceStamps to route; cannot be nullskip - if true, skip the activity which threw the exception or the activity which
was interrupted
OperationException - if the session could not perform the operation.
BatchOperationException - if the session could not perform the operation for each instance.InstancesException if the session could not perform the
operation on every instance.InstanceOperationException if the operation fails on an
instance.InstanceNotFoundException if an instance not exist.InstanceNotInActivityException if an instance is no
longer in activity where the stamp specify.InstanceNotRunningException if an instance is not running.
public void instancesSendTo(InstanceStamp[] instances,
String activityName,
String participant)
throws OperationException,
BatchOperationException
instances - array of InstanceStamps to route; cannot be nullactivityName - name of activity to route to; cannot be nullparticipant - UID of participant to route to; cannot be null
OperationException - if the session could not perform the operation
BatchOperationException - if the session could not perform the operation for each instance
May be one of the following subclasses of BatchOperationException:
InstancesException if the session could not perform the
operation on every instanceInstanceOperationException if the operation fails on an
instance.InstanceNotFoundException if an instance not exist.InstanceNotInActivityException if an instance is no
longer in activity where the stamp specify.InstanceNotRunningException if an instance is not running.NoValidTransitionAvailableException if an instance does not have
transition to the target activity.ParticipantNotInTargetRoleException if the target participant does
not have the role where the instance will be sent.
public void instancesSendTo(InstanceStamp[] instances,
String activityName)
throws OperationException,
BatchOperationException
instances - array of InstanceStamps to route; cannot be nullactivityName - name of activity to route to; cannot be null
OperationException - if the session could not perform the operation
BatchOperationException - if the session could not perform the operation for each instance
May be one of the following subclasses of BatchOperationException:
InstancesException if the session could not perform the
operation on every instanceInstanceOperationException if the operation fails on an
instance.InstanceNotFoundException if an instance not exist.InstanceNotInActivityException if an instance is no
longer in activity where the stamp specify.InstanceNotRunningException if an instance is not running.NoValidTransitionAvailableException if an instance does not have
transition to the target activity.
public void instancesSuspend(InstanceStamp[] instances)
throws OperationException,
BatchOperationException
instances - array of InstanceStamps to suspend; cannot be null
OperationException - if the session could not perform the operation
BatchOperationException - if the session could not perform the operation for each instance
May be one of the following subclasses of BatchOperationException:
InstancesException if the session could not perform the
operation on every instance.InstanceOperationException if the operation fails on an
instance.InstanceNotFoundException if an instance not exist.InstanceNotInActivityException if an instance is no
longer in activity where the stamp specify.InstanceNotRunningException if an instance is not running.InstanceAlreadySuspendedException if an instance is suspended.
public ParticipantsForActivities instancesTargetParticipants(InstanceStamp[] instances)
throws OperationException,
BatchOperationException
instances - array of InstanceStamps to check for participants; cannot be null
OperationException - if the session could not perform the operation
BatchOperationException - if the session could not perform the operation for each instance
May be one of the following subclasses of BatchOperationException:
InstancesException if the session could not perform the
operation on every instance.InstanceOperationException if the operation fails on an
instance.InstanceNotFoundException if an instance not exist.InstanceNotInActivityException if an instance is no
longer in activity where the stamp specify.InstanceNotRunningException if an instance is not running.
public void instancesUngrab(InstanceStamp[] instances)
throws OperationException,
BatchOperationException
instances - array of InstanceStamps to ungrab; cannot be null
OperationException - if the session could not perform the operation
BatchOperationException - if the session could not perform the operation for each instance
May be one of the following subclasses of BatchOperationException:
InstancesException if the session could not perform the
operation on every instance.InstanceOperationException if the operation fails on an
instance.InstanceNotFoundException if an instance not exist.InstanceNotInActivityException if an instance is no
longer in activity where the stamp specify.InstanceNotRunningException if an instance is not running.InstanceNotGrabbedException if an instance is not grabbad.InstanceSuspendedException if an instance is suspended.
public void instancesUnselect(InstanceStamp[] instances)
throws OperationException,
BatchOperationException
instances - array of InstanceStamps to unselect; cannot be null
OperationException - if the session could not perform the operation
BatchOperationException - if the session could not perform the operation for each instance
May be one of the following subclasses of BatchOperationException:
InstancesException if the session could not perform the
operation on every instance.InstanceOperationException if the operation fails on an
instance.InstanceNotFoundException if an instance not exist.InstanceNotInActivityException if an instance is no
longer in activity where the stamp specify.InstanceSelectDisableException if an instance can not be reassigned
because the activity where the instance is can not be select.InstanceNotRunningException if an instance is not running.InstanceSelectedByOtherException if an instance is selected by
other participant (not by current participant).
public void obtainEditionLock(Attachment attachment)
throws OperationException
checkOutAttachment(Attachment, String).checkOutAttachmentToStream(Attachment, java.io.OutputStream).
attachment - attachment to receive the lock; cannot be null
OperationException - if the session could not perform the operation
May be one of the following subclasses of OperationException:
ProcessNotAvailableException if the process is not availableAttachmentOperationException if the version lock fails
public Arguments prepareExternalActivity(String instanceStampId,
int taskIn,
Arguments args)
throws OperationException
instanceStampId - instance stamp ID that identifies the target instance; cannot be nulltaskIn - task identification number of the task to executeargs - input arguments passed to the external activity; null means no arguments
OperationException - if the session could not perform the operation
May be one of the following subclasses of OperationException:
ProcessNotAvailableException if the process is not availableInstanceNotFoundException if the instance does not existActivityNotFoundException if the activity does not existInstanceNotInActivityException if the instance is not in the
activityNoPermissionException if the participant session does not have
the execution permissionActivityFailedException if the execution fails
public Arguments prepareExternalActivity(String instanceId,
String activityName,
Arguments args)
throws OperationException
instanceId - ID that identifies the target instance; cannot be nullactivityName - name of the target activity; cannot be nullargs - input arguments passed to the external activity; null means no arguments
OperationException - if the session could not perform the operation
May be one of the following subclasses of OperationException:
ProcessNotAvailableException if the process is not availableInstanceNotFoundException if the instance does not existActivityNotFoundException if the activity does not existInstanceNotInActivityException if the instance is not in the
activityNoPermissionException if the participant session does not have
the execution permissionActivityFailedException if the execution fails
public Arguments prepareExternalActivity(String instanceId,
String activityName,
int taskIn,
Arguments args)
throws OperationException
instanceId - ID that identifies the target instance; cannot be nullactivityName - name of the target activity; cannot be nulltaskIn - task identification number of the task to executeargs - input arguments passed to the external activity; null means no arguments
OperationException - if the session could not perform the operation
May be one of the following subclasses of OperationException:
ProcessNotAvailableException if the process is not availableInstanceNotFoundException if the instance does not existActivityNotFoundException if the activity does not existInstanceNotInActivityException if the instance is not in the
activityNoPermissionException if the participant session does not have
the execution permissionActivityFailedException if the execution fails
public void releaseEditionLock(Attachment attachment,
File file)
throws OperationException
attachment - the version lock on the attachment will be released; cannot be nullfile - local file to be removed; cannot be null
OperationException - if the session could not perform the operation
May be one of the following subclasses of OperationException:
ProcessNotAvailableException if the process is not availableAttachmentOperationException if the lock release fails
public void releaseEditionLock(Attachment attachment)
throws OperationException
attachment - the version lock will be released for the attachment; cannot be null
OperationException - if the session could not perform the operation
May be one of the following subclasses of OperationException:
ProcessNotAvailableException if the process is not availableAttachmentOperationException if the lock release fails
public void removeBookmarks(InstanceStamp[] instancesStamp)
throws OperationException
instancesStamp - array of InstanceStamps to remove from the bookmarks; cannot be null
OperationException - if the session could not perform the operation
May be one of the following subclasses of OperationException:
ProcessNotAvailableException if the process is not available
public void removePresentation(String presentationId)
throws OperationException
presentationId - ID of presentation to remove; if the ID does not match a presentation,
this method will have no effect; if a view referenced the specified presentationId,
the view will be set to use the default presentation ID; default presentation IDs
cannot be removed
OperationException - if the session could not perform the operation
public void removeView(String viewId)
throws OperationException
viewId - ID of the view to remove; default views cannot be removed; if the current participant is
not the owner of the view, the view will not be removed
OperationException - if the session could not perform the operation
May be one of the following subclasses of OperationException:
ViewHasChildrenException if the view has children
public InstanceInfo runActivity(String instanceStampId,
Arguments args)
throws OperationException
// Define the arguments of the activity.
Arguments arguments = Arguments.create();
argument.putArgument("MyStringArgument", "StringValue");
argument.putArgument("MyIntegerArgument", 1000);
// Search the instance to execute.
Filter filter = ProcessService.createFilter();
filter.setMatchAll(true);
filter.addAttribute(session.getVar("OrderNumber"), Comparison.IS, new Integer(12345));
filter.addAttribute(session.getVar(VarDefinition.ACTIVITY_ID, Comparison.IS, "ActivityToExecute");
InstanceInfo[] instances = session.getInstancesByFilter(new String[] { "/OU/MyProcess" }, filter);
Instance instance = instances[0];
// Execute the activity.
InstanceInfo instance = session.runActivity(instance.getStamp(), arguments);
// Get the output arguments
String myOutputStringArgument = (String) arguments.getArgument("MyOutputStringArgument");
String result = (String) arguments.getArgument(Arguments.RESULT);
instanceStampId - ID of the InstanceStamp that contains the instance and activity name;
cannot be nullargs - arguments to pass to the task; null means no arguments
OperationException - if the session could not perform the operation
May be one of the following subclasses of OperationException:
ProcessNotAvailableException if the process is not availableInstanceNotFoundException if the instance does not existActivityNotFoundException if the activity does not existInstanceNotInActivityException if the instance is not in the
activityNoPermissionException if the participant session does not have
the execution permissionActivityFailedException if the execution fails.TaskNotFoundException if the task not exist.InstanceSentByAbortActionException if the instance was aborted
after the execution (Instance.action = Action.ABORT).InstanceSentByBackOrSkipActionException if the instance was sent
back or skip (Instance.action = Action.BACK or Instance.action = Action.SKIP).InstanceSentByThrowException if the instance was sent to exception
catcher (by user defined exception).
public InstanceInfo runActivity(String instanceStampId,
int taskIn,
Arguments args)
throws OperationException
// Define the arguments of the activity.
Arguments arguments = Arguments.create();
argument.putArgument("MyStringArgument", "StringValue");
argument.putArgument("MyIntegerArgument", 1000);
// Search the instance to execute.
Filter filter = ProcessService.createFilter();
filter.setMatchAll(true);
filter.addAttribute(session.getVar("OrderNumber"), Comparison.IS, new Integer(12345));
filter.addAttribute(session.getVar(VarDefinition.ACTIVITY_ID, Comparison.IS, "ActivityToExecute");
InstanceInfo[] instances = session.getInstancesByFilter(new String[] { "/OU/MyProcess" }, filter);
Instance instance = instances[0];
// Select the task to execute.
Process process = session.getProcess("/OU/MyProcess#Variation-1.0");
Activity activity = process.getActivity("ActivityToExecute");
Task task = activity.getTask("TaskToExecute");
// Execute the activity.
InstanceInfo instance = session.runActivity(instance.getStamp(), task.getIn(), arguments);
// Get the output arguments
String myOutputStringArgument = (String) arguments.getArgument("MyOutputStringArgument");
String result = (String) arguments.getArgument(Arguments.RESULT);
instanceStampId - ID of the InstanceStamp that contains the instance and activity name;
cannot be nulltaskIn - task identification number of the task to executeargs - arguments to pass to the task; null means no arguments
OperationException - if the session could not perform the operation
May be one of the following subclasses of OperationException:
ProcessNotAvailableException if the process is not availableInstanceNotFoundException if the instance does not existActivityNotFoundException if the activity does not existInstanceNotInActivityException if the instance is not in the
activityNoPermissionException if the participant session does not have
the execution permissionActivityFailedException if the execution failsTaskNotFoundException if the task not exist.InstanceSentByAbortActionException if the instance was aborted
after the execution (Instance.action = Action.ABORT).InstanceSentByBackOrSkipActionException if the instance was sent
back or skip (Instance.action = Action.BACK or Instance.action = Action.SKIP).InstanceSentByThrowException if the instance was sent to exception
catcher (by user defined exception).
public InstanceInfo runActivity(String instanceId,
String activityName,
Arguments args)
throws OperationException
// Define the arguments of the activity.
Arguments arguments = Arguments.create();
argument.putArgument("MyStringArgument", "StringValue");
argument.putArgument("MyIntegerArgument", 1000);
// Search the instance to execute.
Filter filter = ProcessService.createFilter();
filter.setMatchAll(true);
filter.addAttribute(session.getVar("OrderNumber"), Comparison.IS, new Integer(12345));
filter.addAttribute(session.getVar(VarDefinition.ACTIVITY_ID, Comparison.IS, "ActivityToExecute");
InstanceInfo[] instances = session.getInstancesByFilter(new String[] { "/OU/MyProcess" }, filter);
Instance instance = instances[0];
// Execute the activity.
InstanceInfo instance = session.runActivity(instance.getId(), instance.getActivityName(), arguments);
// Get the output arguments
String myOutputStringArgument = (String) arguments.getArgument("MyOutputStringArgument");
String result = (String) arguments.getArgument(Arguments.RESULT);
instanceId - ID of the instance to execute; cannot be nullactivityName - name of the activity; cannot be null;
the main task of this activity will be executedargs - arguments to pass to the task; null means no arguments
OperationException - if the session could not perform the operation
May be one of the following subclasses of OperationException:
ProcessNotAvailableException if the process is not availableInstanceNotFoundException if the instance does not existActivityNotFoundException if the activity does not existInstanceNotInActivityException if the instance is not in the
activityNoPermissionException if the participant session does not have
the execution permissionActivityFailedException if the execution failsTaskNotFoundException if the task not exist.InstanceSentByAbortActionException if the instance was aborted
after the execution (Instance.action = Action.ABORT).InstanceSentByBackOrSkipActionException if the instance was sent
back or skip (Instance.action = Action.BACK or Instance.action = Action.SKIP).InstanceSentByThrowException if the instance was sent to exception
catcher (by user defined exception).
public void abortActivity(String instanceId,
String activityName,
int taskIn)
throws OperationException
instanceId - Id of the instance. Cannot be null.activityName - name of activity. Cannot be null.taskIn - task identification number of the Task to be aborted.
OperationException - if the session could not perform the operation.
public InstanceInfo runActivity(String instanceId,
String activityName,
int taskIn,
Arguments args)
throws OperationException
// Define the arguments of the activity.
Arguments arguments = Arguments.create();
argument.putArgument("MyStringArgument", "StringValue");
argument.putArgument("MyIntegerArgument", 1000);
// Search the instance to execute.
Filter filter = ProcessService.createFilter();
filter.setMatchAll(true);
filter.addAttribute(session.getVar("OrderNumber"), Comparison.IS, new Integer(12345));
filter.addAttribute(session.getVar(VarDefinition.ACTIVITY_ID, Comparison.IS, "ActivityToExecute");
InstanceInfo[] instances = session.getInstancesByFilter(new String[] { "/OU/MyProcess" }, filter);
Instance instance = instances[0];
// Select the task to execute.
Activity activity = instance.getActivity();
Task task = activity.getTask("TaskToExecute");
// Execute the activity.
InstanceInfo instance = session.runActivity(instance.getId(), instance.getActivityName(),
task.getIn(), arguments);
// Get the output arguments
String myOutputStringArgument = (String) arguments.getArgument("MyOutputStringArgument");
String result = (String) arguments.getArgument(Arguments.RESULT);
instanceId - ID of the instance to execute; cannot be nullactivityName - name of the activity; cannot be null;
the main task of this activity will be executedtaskIn - task identification number of the task to executeargs - arguments to pass to the task; null means no arguments
OperationException - if the session could not perform the operation
May be one of the following subclasses of OperationException:
ProcessNotAvailableException if the process is not availableInstanceNotFoundException if the instance does not existActivityNotFoundException if the activity does not existInstanceNotInActivityException if the instance is not in the
activityNoPermissionException if the participant session does not have
the execution permissionActivityFailedException if the execution failsTaskNotFoundException if the task not exist.InstanceSentByAbortActionException if the instance was aborted
after the execution (Instance.action = Action.ABORT).InstanceSentByBackOrSkipActionException if the instance was sent
back or skip (Instance.action = Action.BACK or Instance.action = Action.SKIP).InstanceSentByThrowException if the instance was sent to exception
catcher (by user defined exception).
public InstanceInfo runGlobal(String instanceId,
String activityName,
Arguments args)
throws OperationException
// Define the arguments of the activity.
Arguments arguments = Arguments.create();
argument.putArgument("MyStringArgument", "StringValue");
argument.putArgument("MyIntegerArgument", 1000);
// Search the instance to execute.
Filter filter = ProcessService.createFilter();
filter.addAttribute(session.getVar("OrderNumber"), Comparison.IS, new Integer(12345));
InstanceInfo[] instances = session.getInstancesByFilter(new String[] { "/OU/MyProcess" }, filter);
Instance instance = instances[0];
// Execute the activity.
InstanceInfo instance = session.runActivity(instance.getId(), "GlobalInstanceActivityToExecute", arguments);
String myOutputStringArgument = (String) arguments.getArgument("MyOutputStringArgument");
String result = (String) arguments.getArgument(Arguments.RESULT);
instanceId - ID of instance to execute; cannot be nullactivityName - name of activity to execute; cannot be nullargs - arguments to pass to the activity; null means no arguments
OperationException - if the session could not perform the operation
May be one of the following subclasses of OperationException:
ProcessNotAvailableException if the process is not availableInstanceNotFoundException if the instance does not existActivityNotFoundException if the activity does not existNoPermissionException if the participant session does not have
the execution permissionActivityFailedException if the execution fails
public void runTask(String instanceId,
String activityName,
int taskIn,
Arguments args)
throws OperationException
runActivity(String, String, int, Arguments) instead
instanceId - ID of the instance to execute; cannot be nullactivityName - name of the activity; cannot be nulltaskIn - task identification number of the task to executeargs - arguments to pass to the task; null means no arguments
OperationException - if the session could not perform the operation
May be one of the following subclasses of OperationException:
ProcessNotAvailableException if the process is not availableInstanceNotFoundException if the instance does not existActivityNotFoundException if the activity does not existInstanceNotInActivityException if the instance is not in the
activityNoPermissionException if the participant session does not have
the execution permissionActivityFailedException if the execution failsTaskNotFoundException if the task not exist.InstanceSentByAbortActionException if the instance was aborted
after the execution (Instance.action = Action.ABORT).InstanceSentByBackOrSkipActionException if the instance was sent
back or skip (Instance.action = Action.BACK or Instance.action = Action.SKIP).InstanceSentByThrowException if the instance was sent to exception
catcher (by user defined exception).
public void runTask(String instanceStampId,
int taskIn,
Arguments args)
throws OperationException
runActivity(String,int,Arguments) instead
instanceStampId - ID of the InstanceStamp that contains the instance and activity name Cannot be null.taskIn - task identification number of the task to executeargs - arguments to pass to the task; null means no arguments
OperationException - if the session could not perform the operation
May be one of the following subclasses of OperationException:
ProcessNotAvailableException if the process is not availableInstanceNotFoundException if the instance does not existActivityNotFoundException if the activity does not existInstanceNotInActivityException if the instance is not in the
activityNoPermissionException if the participant session does not have
the execution permissionActivityFailedException if the execution failsTaskNotFoundException if the task not exist.InstanceSentByAbortActionException if the instance was aborted
after the execution (Instance.action = Action.ABORT).InstanceSentByBackOrSkipActionException if the instance was sent
back or skip (Instance.action = Action.BACK or Instance.action = Action.SKIP).InstanceSentByThrowException if the instance was sent to exception
catcher (by user defined exception).
public void storePresentation(Presentation presentation)
throws OperationException
presentation - presentation to store; cannot be null
OperationException - if the session could not perform the operation
public void storeUserProperties(String category,
Map properties)
throws OperationException
storeUserProperties in interface ProcessServiceNESessioncategory - properties categoryproperties - properties map, where the key is the property key and the value is the property value
OperationException - if the session could not perform the operation
public void storeView(View view)
throws OperationException
View.isTransient() will return true and the view will not be retrievable
using ProcessServiceNESession.getView(String).
view - view to store; cannot be null
OperationException - if the session could not perform the operation
public boolean taskCanBeProcessed(InstanceInfo instance,
int taskNumber)
instance - InstanceInfo to check; cannot be nulltaskNumber - task identification number to check
true if the specified task for this instance can be executed by the current participant
public boolean taskCanBeSelected(InstanceInfo instance,
int taskNumber)
instance - InstanceInfo to check; cannot be nulltaskNumber - task identification number to check
true if the specified task for this instance can be selected by the current participant
public boolean taskCanBeUnselected(InstanceInfo instance,
int taskNumber)
true if the specified task for this instance can be unselected by the current participant.
Note that only process instance items in interactive activities can be unselected.
instance - InstanceInfo to check; cannot be nulltaskNumber - task identification number to check
true if the specified task for this instance can be unselected by the current participant
public void tasksSelect(String instanceId,
String activityName,
int[] taskNumbers)
throws OperationException,
BatchOperationException
instanceId - ID of the instance for which tasks will be selected; cannot be nullactivityName - name of the activity that containf the tasks to select; cannot be nulltaskNumbers - array of task identification numbers to select
OperationException - if the session could not perform the operation
BatchOperationException - if the session could not perform the operation on every task
May be one of the following subclasses of BatchOperationException:
TasksException if the session could not perform the
operation on every task
public void tasksUnselect(String instanceId,
String activityName,
int[] taskNumbers)
throws OperationException,
BatchOperationException
instanceId - ID of instance for which tasks will be unselected; cannot be nullactivityName - name of the activity that contains the tasks to unselect; cannot be nulltaskNumbers - array of task identification numbers to unselect
OperationException - if the session could not perform the operation
BatchOperationException - if the session could not perform the operation on every task
May be one of the following subclasses of BatchOperationException:
TasksException if the session could not perform the
operation on every taskpublic String toString()
public void updateUserPassword(String oldPassword,
String newPassword)
throws OperationException
isChangeParticipantPasswordSupported() returns false.
oldPassword - old participant password; cannot be nullnewPassword - new participant password; cannot be null
OperationException - if the session could not perform the operation
|
ALBPM Process API (PAPI) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||