The WorkflowService provides three methods to activate the next activity instances, which return the activity instance that was activated. The activation methods cover the following cases:
These methods require the performActivity permission. For detailed information on this permission, refer to the section Permissions of chapter Declarative Security Usage in Infinity Process Platform Services API.
To activate the next activity instance from a given worklist query, use the following method:
ActivityInstance activateNextActivityInstance(WorklistQuery query);
The query parameter defines a WorklistQuery object. Note that a WorklistQuery can contain an ActivityStateFilter, which can reduce the set of returned activity instances. Without this filter, the state can be APPLICATION and SUSPENDED. This can be reduced to one of these states by applying a specific filter. For details on this filter, refer to section ActivityStateFilter of chapter Filter Criteria.
In case all activity instances in the previously fetched subset are already activated, the activation is performed again with the specified worklist query. The search is retried with the same query, if the query does return activity instances which all could not be activated. If the query does not return activity instances at all, the retry is stopped.
You can determine the number of retries via the carnot.properties property Infinity.Engine.Tuning.Query.ActivateNextActivityInstance.Retries. After the configured amount of retries, the query is stopped. The default value is five times.
In case you like to activate the next activity instance for a specified process instance, use the following method:
ActivityInstance activateNextActivityInstance(long activityInstanceOID)
Parameter activityInstanceOID specifies the OID of the last completed activity instance. An ObjectNotFoundException is thrown, if there is no activity instance with the specified OID.
To activate the next activity instance after a specified one in the same process instance, use:
ActivityInstance activateNextActivityInstanceForProcessInstance(long processInstanceOID)
Parameter processInstanceOID defines the OID of the process instance. An ObjectNotFoundException is thrown, if there is no process instance with the specified OID.