Package org.jbpm.kie.services.impl.admin
Class ProcessInstanceAdminServiceImpl
- java.lang.Object
-
- org.jbpm.kie.services.impl.admin.ProcessInstanceAdminServiceImpl
-
- All Implemented Interfaces:
ProcessInstanceAdminService
public class ProcessInstanceAdminServiceImpl extends Object implements ProcessInstanceAdminService
-
-
Constructor Summary
Constructors Constructor Description ProcessInstanceAdminServiceImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidacknowledgeError(String... errorId)Acknowledge given error that it was reviewed and understoodprotected voidapplyQueryContext(Map<String,Object> params, org.kie.api.runtime.query.QueryContext queryContext)voidcancelNodeInstance(long processInstanceId, long nodeInstanceId)Cancels node instance with given id within given process instance.protected List<Short>getAckMode(boolean includeAcknowledged)Collection<NodeInstanceDesc>getActiveNodeInstances(long processInstanceId)Returns all active node instances in given process instance;org.kie.internal.runtime.error.ExecutionErrorgetError(String errorId)Returns execution error identified by given error idList<org.kie.internal.runtime.error.ExecutionError>getErrors(boolean includeAcknowledged, org.kie.api.runtime.query.QueryContext queryContext)Returns all execution errors regardless of their typeList<org.kie.internal.runtime.error.ExecutionError>getErrorsByDeploymentId(String containerId, boolean includeAcknowledged, org.kie.api.runtime.query.QueryContext queryContext)Returns all execution errors for a given deployment regardless of their typeList<org.kie.internal.runtime.error.ExecutionError>getErrorsByProcessId(String deploymentId, String processId, boolean includeAcknowledged, org.kie.api.runtime.query.QueryContext queryContext)Returns execution errors for given process id and deployment idList<org.kie.internal.runtime.error.ExecutionError>getErrorsByProcessInstanceId(long processInstanceId, boolean includeAcknowledged, org.kie.api.runtime.query.QueryContext queryContext)Returns execution errors for given process instance idList<org.kie.internal.runtime.error.ExecutionError>getErrorsByProcessInstanceId(long processInstanceId, String nodeName, boolean includeAcknowledged, org.kie.api.runtime.query.QueryContext queryContext)Returns execution errors for given process instance id and nodeCollection<ProcessNode>getProcessNodes(long processInstanceId)Returns all process nodes found in given process instance.Collection<TimerInstance>getTimerInstances(long processInstanceId)Returns active timers for given process instance.voidretriggerNodeInstance(long processInstanceId, long nodeInstanceId)Retriggers (which includes cancel) node instance given with node instance id within process instance.voidsetCommandService(TransactionalCommandService commandService)voidsetIdentityProvider(org.kie.internal.identity.IdentityProvider identityProvider)voidsetProcessService(ProcessService processService)voidsetRuntimeDataService(RuntimeDataService runtimeDataService)voidtriggerNode(long processInstanceId, long nodeId)Triggers node to create new node instance with node id within process instance.voidupdateTimer(long processInstanceId, long timerId, long delay, long period, int repeatLimit)Updates active timer identified by timer id with delay that is given in seconds.voidupdateTimerRelative(long processInstanceId, long timerId, long delay, long period, int repeatLimit)Updates active timer identified by timer id with delay that is given in seconds and is relative to current time.
-
-
-
Method Detail
-
setProcessService
public void setProcessService(ProcessService processService)
-
setRuntimeDataService
public void setRuntimeDataService(RuntimeDataService runtimeDataService)
-
setIdentityProvider
public void setIdentityProvider(org.kie.internal.identity.IdentityProvider identityProvider)
-
setCommandService
public void setCommandService(TransactionalCommandService commandService)
-
getProcessNodes
public Collection<ProcessNode> getProcessNodes(long processInstanceId) throws ProcessInstanceNotFoundException
Description copied from interface:ProcessInstanceAdminServiceReturns all process nodes found in given process instance.- Specified by:
getProcessNodesin interfaceProcessInstanceAdminService- Parameters:
processInstanceId- unique id of process instance- Returns:
- list of process nodes in process instance
- Throws:
ProcessInstanceNotFoundException- in case process instance id with given id was not found
-
cancelNodeInstance
public void cancelNodeInstance(long processInstanceId, long nodeInstanceId) throws NodeInstanceNotFoundException, ProcessInstanceNotFoundExceptionDescription copied from interface:ProcessInstanceAdminServiceCancels node instance with given id within given process instance.- Specified by:
cancelNodeInstancein interfaceProcessInstanceAdminService- Parameters:
processInstanceId- unique id of process instancenodeInstanceId- node instance id within given process instance to be canceled- Throws:
NodeInstanceNotFoundException- in case node instance with given id is not activeProcessInstanceNotFoundException- in case process instance id with given id was not found
-
retriggerNodeInstance
public void retriggerNodeInstance(long processInstanceId, long nodeInstanceId) throws NodeInstanceNotFoundException, ProcessInstanceNotFoundExceptionDescription copied from interface:ProcessInstanceAdminServiceRetriggers (which includes cancel) node instance given with node instance id within process instance.- Specified by:
retriggerNodeInstancein interfaceProcessInstanceAdminService- Parameters:
processInstanceId- unique id of process instancenodeInstanceId- node instance id within given process instance to be retriggered- Throws:
NodeInstanceNotFoundException- in case node instance with given id is not activeProcessInstanceNotFoundException- in case process instance id with given id was not found
-
updateTimer
public void updateTimer(long processInstanceId, long timerId, long delay, long period, int repeatLimit) throws NodeInstanceNotFoundException, ProcessInstanceNotFoundExceptionDescription copied from interface:ProcessInstanceAdminServiceUpdates active timer identified by timer id with delay that is given in seconds. Delay is absolute meaning it is as it would be set when timer was created.
Example:
In case timer was initially created with delay of 1 hour and after 30 min we decide to update it to 2 hours it will then expire in 1,5 hour from the time it was updated.- Specified by:
updateTimerin interfaceProcessInstanceAdminService- Parameters:
processInstanceId- unique id of process instancetimerId- timer id that should be updateddelay- absolute delay in secondsperiod- in case of repeatable timer how often it should repeat in milliseconds - if not applicable should be set to -1repeatLimit- in case of repeatable timer how many times it should trigger - if not applicable should be set to -1- Throws:
NodeInstanceNotFoundException- in case node instance with given id is not activeProcessInstanceNotFoundException- in case process instance id with given id was not found
-
updateTimerRelative
public void updateTimerRelative(long processInstanceId, long timerId, long delay, long period, int repeatLimit) throws NodeInstanceNotFoundException, ProcessInstanceNotFoundExceptionDescription copied from interface:ProcessInstanceAdminServiceUpdates active timer identified by timer id with delay that is given in seconds and is relative to current time.
Example:
In case timer was initially created with delay of 1 hour and after 30 min we decide to update it to 2 hours it will then expire in 2 hours from the time it was updated.- Specified by:
updateTimerRelativein interfaceProcessInstanceAdminService- Parameters:
processInstanceId- unique id of process instancetimerId- timer id that should be updateddelay- absolute delay in secondsperiod- in case of repeatable timer how often it should repeat in milliseconds - if not applicable should be set to -1repeatLimit- in case of repeatable timer how many times it should trigger - if not applicable should be set to -1- Throws:
NodeInstanceNotFoundException- in case node instance with given id is not activeProcessInstanceNotFoundException- in case process instance id with given id was not found
-
getTimerInstances
public Collection<TimerInstance> getTimerInstances(long processInstanceId) throws ProcessInstanceNotFoundException
Description copied from interface:ProcessInstanceAdminServiceReturns active timers for given process instance.- Specified by:
getTimerInstancesin interfaceProcessInstanceAdminService- Parameters:
processInstanceId- unique id of process instance- Returns:
- list of timer found for given process instance
- Throws:
ProcessInstanceNotFoundException- in case process instance id with given id was not found
-
triggerNode
public void triggerNode(long processInstanceId, long nodeId) throws NodeNotFoundException, ProcessInstanceNotFoundExceptionDescription copied from interface:ProcessInstanceAdminServiceTriggers node to create new node instance with node id within process instance. This results in new instance of a task within process instance.- Specified by:
triggerNodein interfaceProcessInstanceAdminService- Parameters:
processInstanceId- unique id of process instancenodeId- node id to be triggered (new instance of that node to be created)- Throws:
NodeNotFoundException- in case node with given id does not exist in process instanceProcessInstanceNotFoundException- in case process instance id with given id was not found
-
getActiveNodeInstances
public Collection<NodeInstanceDesc> getActiveNodeInstances(long processInstanceId) throws ProcessInstanceNotFoundException
Description copied from interface:ProcessInstanceAdminServiceReturns all active node instances in given process instance;- Specified by:
getActiveNodeInstancesin interfaceProcessInstanceAdminService- Parameters:
processInstanceId- unique id of process instance- Returns:
- found active node instances
- Throws:
ProcessInstanceNotFoundException- in case process instance id with given id was not found
-
acknowledgeError
public void acknowledgeError(String... errorId) throws ExecutionErrorNotFoundException
Description copied from interface:ProcessInstanceAdminServiceAcknowledge given error that it was reviewed and understood- Specified by:
acknowledgeErrorin interfaceProcessInstanceAdminService- Parameters:
errorId- unique id of the error- Throws:
ExecutionErrorNotFoundException- thrown when there is no unacknowledged error with that id
-
getError
public org.kie.internal.runtime.error.ExecutionError getError(String errorId) throws ExecutionErrorNotFoundException
Description copied from interface:ProcessInstanceAdminServiceReturns execution error identified by given error id- Specified by:
getErrorin interfaceProcessInstanceAdminService- Parameters:
errorId- unique id of the error- Returns:
- returns execution error instance
- Throws:
ExecutionErrorNotFoundException- is thrown in case no error was found for given error id
-
getErrors
public List<org.kie.internal.runtime.error.ExecutionError> getErrors(boolean includeAcknowledged, org.kie.api.runtime.query.QueryContext queryContext)
Description copied from interface:ProcessInstanceAdminServiceReturns all execution errors regardless of their type- Specified by:
getErrorsin interfaceProcessInstanceAdminService- Parameters:
includeAcknowledged- indicates whether to include acknowledged errors or notqueryContext- control parameters for pagination- Returns:
- list of found errors
-
getErrorsByProcessId
public List<org.kie.internal.runtime.error.ExecutionError> getErrorsByProcessId(String deploymentId, String processId, boolean includeAcknowledged, org.kie.api.runtime.query.QueryContext queryContext)
Description copied from interface:ProcessInstanceAdminServiceReturns execution errors for given process id and deployment id- Specified by:
getErrorsByProcessIdin interfaceProcessInstanceAdminService- Parameters:
deploymentId- deployment id that contains given processprocessId- process id of the processincludeAcknowledged- indicates whether to include acknowledged errors or notqueryContext- control parameters for pagination- Returns:
- list of found errors
-
getErrorsByProcessInstanceId
public List<org.kie.internal.runtime.error.ExecutionError> getErrorsByProcessInstanceId(long processInstanceId, boolean includeAcknowledged, org.kie.api.runtime.query.QueryContext queryContext)
Description copied from interface:ProcessInstanceAdminServiceReturns execution errors for given process instance id- Specified by:
getErrorsByProcessInstanceIdin interfaceProcessInstanceAdminService- Parameters:
processInstanceId- process instance id of the processincludeAcknowledged- indicates whether to include acknowledged errors or notqueryContext- control parameters for pagination- Returns:
- list of found errors
-
getErrorsByProcessInstanceId
public List<org.kie.internal.runtime.error.ExecutionError> getErrorsByProcessInstanceId(long processInstanceId, String nodeName, boolean includeAcknowledged, org.kie.api.runtime.query.QueryContext queryContext)
Description copied from interface:ProcessInstanceAdminServiceReturns execution errors for given process instance id and node- Specified by:
getErrorsByProcessInstanceIdin interfaceProcessInstanceAdminService- Parameters:
processInstanceId- process instance id of the processnodeName- name of the node that error should be found forincludeAcknowledged- indicates whether to include acknowledged errors or notqueryContext- control parameters for pagination- Returns:
- list of found errors
-
getErrorsByDeploymentId
public List<org.kie.internal.runtime.error.ExecutionError> getErrorsByDeploymentId(String containerId, boolean includeAcknowledged, org.kie.api.runtime.query.QueryContext queryContext)
Description copied from interface:ProcessInstanceAdminServiceReturns all execution errors for a given deployment regardless of their type- Specified by:
getErrorsByDeploymentIdin interfaceProcessInstanceAdminService- Parameters:
containerId- deployment id that contains the errorsincludeAcknowledged- indicates whether to include acknowledged errors or notqueryContext- control parameters for pagination- Returns:
- list of found errors
-
applyQueryContext
protected void applyQueryContext(Map<String,Object> params, org.kie.api.runtime.query.QueryContext queryContext)
-
-