Package org.camunda.automator.bpmnengine
Interface BpmnEngine
- All Known Implementing Classes:
BpmnEngineCamunda7,BpmnEngineCamunda8,BpmnEngineDummy
public interface BpmnEngine
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic classstatic classstatic class -
Method Summary
Modifier and TypeMethodDescriptionvoidlongcountNumberOfProcessInstancesCreated(String processId, io.camunda.operate.search.DateFilter startDate, io.camunda.operate.search.DateFilter endDate) longcountNumberOfProcessInstancesEnded(String processId, io.camunda.operate.search.DateFilter startDate, io.camunda.operate.search.DateFilter endDate) longcountNumberOfTasks(String processId, String taskId) deployBpmn(File processFile, ScenarioDeployment.Policy policy) Deploy a BPMN file (may contains multiple processes)voidvoidendProcessInstance(String processInstanceId, boolean cleanAll) we finish with this processinstanceid, engine can clean itvoidExecute a service taskvoidreturn the signature of the engine, to log it for examplegetVariables(String processInstanceId) Get variables of a process instanceIdintvoidinit()init the engine.booleanisReady()Engine is ready.registerServiceTask(String workerId, String topic, Duration lockTime, Object jobHandler, FixedBackoffSupplier backoffSupplier) searchProcessInstanceByVariable(String processId, Map<String, Object> filterVariables, int maxResult) Search process instance by a variable contentsearchServiceTasks(String processInstanceId, String serviceTaskId, String topic, int maxResult) searchTasksByProcessInstanceId(String processInstanceId, String taskId, int maxResult) Search task.searchUserTasks(String userTaskId, int maxResult) Return a list of tasksearchUserTasksByProcessInstance(String processInstanceId, String userTaskId, int maxResult) voidturnHighFlowMode(boolean hightFlowMode)
-
Method Details
-
init
void init()init the engine. This method will- Throws:
Exception- in case of error
-
connection
- Throws:
AutomatorException
-
disconnection
- Throws:
AutomatorException
-
isReady
boolean isReady()Engine is ready. If not, a connection() method must be call- Returns:
-
turnHighFlowMode
void turnHighFlowMode(boolean hightFlowMode) -
createProcessInstance
String createProcessInstance(String processId, String starterEventId, Map<String, Object> variables) throws AutomatorException- Parameters:
processId- Process ID (BPMN ID : ExpenseNode)starterEventId- BPMN ID (startEvent)variables- List of variables to create the process instance- Returns:
- a processInstanceId
- Throws:
AutomatorException- in case of error
-
endProcessInstance
we finish with this processinstanceid, engine can clean it- Parameters:
processInstanceId- Process instance Id to cleancleanAll- if true, the process instance must be clean.- Throws:
AutomatorException- in case of error
-
searchUserTasksByProcessInstance
List<String> searchUserTasksByProcessInstance(String processInstanceId, String userTaskId, int maxResult) throws AutomatorException - Parameters:
processInstanceId- Process Instance IduserTaskId- BPMN Id (Review)maxResult- maximum result to return.- Returns:
- list of taskId
- Throws:
AutomatorException- in case of error
-
searchUserTasks
Return a list of task- Parameters:
userTaskId- userTaskIdmaxResult- maxResult returned- Returns:
- list of TaskId
- Throws:
AutomatorException
-
executeUserTask
void executeUserTask(String userTaskId, String userId, Map<String, Object> variables) throws AutomatorException- Parameters:
userTaskId- BPMN Id (Review)userId- User id who executes the taskvariables- variable to update- Throws:
AutomatorException- in case of error
-
registerServiceTask
BpmnEngine.RegisteredTask registerServiceTask(String workerId, String topic, Duration lockTime, Object jobHandler, FixedBackoffSupplier backoffSupplier) - Parameters:
workerId- workerIdtopic- topic to registerlockTime- lock time for the jobjobHandler- C7: must implement ExternalTaskHandler. C8: must implement JobHandlerbackoffSupplier- backOffStrategy- Returns:
-
searchServiceTasks
List<String> searchServiceTasks(String processInstanceId, String serviceTaskId, String topic, int maxResult) throws AutomatorException - Parameters:
processInstanceId- process instance IDserviceTaskId- BPMN IP (Review)topic- topic to search to execute the service taskmaxResult- maximum result- Returns:
- list of taskId
- Throws:
AutomatorException- in case of error
-
executeServiceTask
void executeServiceTask(String serviceTaskId, String workerId, Map<String, Object> variables) throws AutomatorExceptionExecute a service task- Parameters:
serviceTaskId- BPMN ID (Review)workerId- Worker who execute the taskvariables- variable to updates- Throws:
AutomatorException- in case of error
-
searchTasksByProcessInstanceId
List<BpmnEngine.TaskDescription> searchTasksByProcessInstanceId(String processInstanceId, String taskId, int maxResult) throws AutomatorException Search task.- Parameters:
processInstanceId- filter on the processInstanceId. may be nulltaskId- filter on the taskIdmaxResult- maximum Result- Returns:
- List of task description
- Throws:
AutomatorException- in case of error
-
searchProcessInstanceByVariable
List<BpmnEngine.ProcessDescription> searchProcessInstanceByVariable(String processId, Map<String, Object> filterVariables, int maxResult) throws AutomatorExceptionSearch process instance by a variable content- Parameters:
processId- BPMN Process IDfilterVariables- Variable namemaxResult- maxResult- Returns:
- list of ProcessInstance which match the filter
- Throws:
AutomatorException- in case of error
-
getVariables
Get variables of a process instanceId- Parameters:
processInstanceId- the process instance ID- Returns:
- variables attached to the process instance ID
- Throws:
AutomatorException- in case of error
-
countNumberOfProcessInstancesCreated
long countNumberOfProcessInstancesCreated(String processId, io.camunda.operate.search.DateFilter startDate, io.camunda.operate.search.DateFilter endDate) throws AutomatorException - Throws:
AutomatorException
-
countNumberOfProcessInstancesEnded
long countNumberOfProcessInstancesEnded(String processId, io.camunda.operate.search.DateFilter startDate, io.camunda.operate.search.DateFilter endDate) throws AutomatorException - Throws:
AutomatorException
-
countNumberOfTasks
- Throws:
AutomatorException
-
deployBpmn
Deploy a BPMN file (may contains multiple processes)- Parameters:
processFile- process to deploypolicy- policy to deploy the process- Returns:
- the deploymentId
- Throws:
AutomatorException- in case of error
-
getTypeCamundaEngine
ConfigurationBpmEngine.CamundaEngine getTypeCamundaEngine() -
getSignature
String getSignature()return the signature of the engine, to log it for example- Returns:
- signature of the engine
-
getWorkerExecutionThreads
int getWorkerExecutionThreads()
-