Class BpmnEngineDummy
java.lang.Object
org.camunda.automator.bpmnengine.dummy.BpmnEngineDummy
- All Implemented Interfaces:
BpmnEngine
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.camunda.automator.bpmnengine.BpmnEngine
BpmnEngine.ProcessDescription, BpmnEngine.RegisteredTask, BpmnEngine.TaskDescription -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidlongcountNumberOfProcessInstancesCreated(String processName, io.camunda.operate.search.DateFilter startDate, io.camunda.operate.search.DateFilter endDate) longcountNumberOfProcessInstancesEnded(String processName, 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)
-
Constructor Details
-
BpmnEngineDummy
-
-
Method Details
-
init
public void init()Description copied from interface:BpmnEngineinit the engine. This method will- Specified by:
initin interfaceBpmnEngine
-
connection
- Specified by:
connectionin interfaceBpmnEngine- Throws:
AutomatorException
-
disconnection
- Specified by:
disconnectionin interfaceBpmnEngine- Throws:
AutomatorException
-
isReady
public boolean isReady()Engine is ready. If not, a connection() method must be call- Specified by:
isReadyin interfaceBpmnEngine- Returns:
-
createProcessInstance
public String createProcessInstance(String processId, String starterEventId, Map<String, Object> variables) throws AutomatorException- Specified by:
createProcessInstancein interfaceBpmnEngine- 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
public void endProcessInstance(String processInstanceId, boolean cleanAll) throws AutomatorException Description copied from interface:BpmnEnginewe finish with this processinstanceid, engine can clean it- Specified by:
endProcessInstancein interfaceBpmnEngine- Parameters:
processInstanceId- Process instance Id to cleancleanAll- if true, the process instance must be clean.- Throws:
AutomatorException- in case of error
-
searchUserTasksByProcessInstance
public List<String> searchUserTasksByProcessInstance(String processInstanceId, String userTaskId, int maxResult) throws AutomatorException - Specified by:
searchUserTasksByProcessInstancein interfaceBpmnEngine- Parameters:
processInstanceId- Process Instance IduserTaskId- BPMN Id (Review)maxResult- maximum result to return.- Returns:
- list of taskId
- Throws:
AutomatorException- in case of error
-
searchUserTasks
Description copied from interface:BpmnEngineReturn a list of task- Specified by:
searchUserTasksin interfaceBpmnEngine- Parameters:
userTaskId- userTaskIdmaxResult- maxResult returned- Returns:
- list of TaskId
- Throws:
AutomatorException
-
executeUserTask
public void executeUserTask(String userTaskId, String userId, Map<String, Object> variables) throws AutomatorException- Specified by:
executeUserTaskin interfaceBpmnEngine- Parameters:
userTaskId- BPMN Id (Review)userId- User id who executes the taskvariables- variable to update- Throws:
AutomatorException- in case of error
-
registerServiceTask
public BpmnEngine.RegisteredTask registerServiceTask(String workerId, String topic, Duration lockTime, Object jobHandler, FixedBackoffSupplier backoffSupplier) - Specified by:
registerServiceTaskin interfaceBpmnEngine- Parameters:
workerId- workerIdtopic- topic to registerlockTime- lock time for the jobjobHandler- C7: must implement ExternalTaskHandler. C8: must implement JobHandlerbackoffSupplier- backOffStrategy- Returns:
-
searchServiceTasks
public List<String> searchServiceTasks(String processInstanceId, String serviceTaskId, String topic, int maxResult) throws AutomatorException - Specified by:
searchServiceTasksin interfaceBpmnEngine- 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
public void executeServiceTask(String serviceTaskId, String workerId, Map<String, Object> variables) throws AutomatorExceptionDescription copied from interface:BpmnEngineExecute a service task- Specified by:
executeServiceTaskin interfaceBpmnEngine- Parameters:
serviceTaskId- BPMN ID (Review)workerId- Worker who execute the taskvariables- variable to updates- Throws:
AutomatorException- in case of error
-
searchTasksByProcessInstanceId
public List<BpmnEngine.TaskDescription> searchTasksByProcessInstanceId(String processInstanceId, String taskId, int maxResult) throws AutomatorException Description copied from interface:BpmnEngineSearch task.- Specified by:
searchTasksByProcessInstanceIdin interfaceBpmnEngine- 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
public List<BpmnEngine.ProcessDescription> searchProcessInstanceByVariable(String processId, Map<String, Object> filterVariables, int maxResult) throws AutomatorExceptionDescription copied from interface:BpmnEngineSearch process instance by a variable content- Specified by:
searchProcessInstanceByVariablein interfaceBpmnEngine- Parameters:
processId- BPMN Process IDfilterVariables- Variable namemaxResult- maxResult- Returns:
- list of ProcessInstance which match the filter
- Throws:
AutomatorException- in case of error
-
getVariables
Description copied from interface:BpmnEngineGet variables of a process instanceId- Specified by:
getVariablesin interfaceBpmnEngine- Parameters:
processInstanceId- the process instance ID- Returns:
- variables attached to the process instance ID
- Throws:
AutomatorException- in case of error
-
countNumberOfProcessInstancesCreated
public long countNumberOfProcessInstancesCreated(String processName, io.camunda.operate.search.DateFilter startDate, io.camunda.operate.search.DateFilter endDate) throws AutomatorException - Specified by:
countNumberOfProcessInstancesCreatedin interfaceBpmnEngine- Throws:
AutomatorException
-
countNumberOfProcessInstancesEnded
public long countNumberOfProcessInstancesEnded(String processName, io.camunda.operate.search.DateFilter startDate, io.camunda.operate.search.DateFilter endDate) throws AutomatorException - Specified by:
countNumberOfProcessInstancesEndedin interfaceBpmnEngine- Throws:
AutomatorException
-
countNumberOfTasks
- Specified by:
countNumberOfTasksin interfaceBpmnEngine- Throws:
AutomatorException
-
deployBpmn
public String deployBpmn(File processFile, ScenarioDeployment.Policy policy) throws AutomatorException Description copied from interface:BpmnEngineDeploy a BPMN file (may contains multiple processes)- Specified by:
deployBpmnin interfaceBpmnEngine- Parameters:
processFile- process to deploypolicy- policy to deploy the process- Returns:
- the deploymentId
- Throws:
AutomatorException- in case of error
-
getTypeCamundaEngine
- Specified by:
getTypeCamundaEnginein interfaceBpmnEngine
-
getSignature
Description copied from interface:BpmnEnginereturn the signature of the engine, to log it for example- Specified by:
getSignaturein interfaceBpmnEngine- Returns:
- signature of the engine
-
getWorkerExecutionThreads
public int getWorkerExecutionThreads()- Specified by:
getWorkerExecutionThreadsin interfaceBpmnEngine
-
turnHighFlowMode
public void turnHighFlowMode(boolean hightFlowMode) - Specified by:
turnHighFlowModein interfaceBpmnEngine
-