Interface BpmnEngine

All Known Implementing Classes:
BpmnEngineCamunda7, BpmnEngineCamunda8, BpmnEngineDummy

public interface BpmnEngine
  • Method Details

    • init

      void init()
      init the engine. This method will
      Throws:
      Exception - in case of error
    • connection

      void connection() throws AutomatorException
      Throws:
      AutomatorException
    • disconnection

      void disconnection() throws AutomatorException
      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

      void endProcessInstance(String processInstanceId, boolean cleanAll) throws AutomatorException
      we finish with this processinstanceid, engine can clean it
      Parameters:
      processInstanceId - Process instance Id to clean
      cleanAll - 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 Id
      userTaskId - BPMN Id (Review)
      maxResult - maximum result to return.
      Returns:
      list of taskId
      Throws:
      AutomatorException - in case of error
    • searchUserTasks

      List<String> searchUserTasks(String userTaskId, int maxResult) throws AutomatorException
      Return a list of task
      Parameters:
      userTaskId - userTaskId
      maxResult - 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 task
      variables - 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 - workerId
      topic - topic to register
      lockTime - lock time for the job
      jobHandler - C7: must implement ExternalTaskHandler. C8: must implement JobHandler
      backoffSupplier - backOffStrategy
      Returns:
    • searchServiceTasks

      List<String> searchServiceTasks(String processInstanceId, String serviceTaskId, String topic, int maxResult) throws AutomatorException
      Parameters:
      processInstanceId - process instance ID
      serviceTaskId - BPMN IP (Review)
      topic - topic to search to execute the service task
      maxResult - maximum result
      Returns:
      list of taskId
      Throws:
      AutomatorException - in case of error
    • executeServiceTask

      void executeServiceTask(String serviceTaskId, String workerId, Map<String,Object> variables) throws AutomatorException
      Execute a service task
      Parameters:
      serviceTaskId - BPMN ID (Review)
      workerId - Worker who execute the task
      variables - 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 null
      taskId - filter on the taskId
      maxResult - 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 AutomatorException
      Search process instance by a variable content
      Parameters:
      processId - BPMN Process ID
      filterVariables - Variable name
      maxResult - maxResult
      Returns:
      list of ProcessInstance which match the filter
      Throws:
      AutomatorException - in case of error
    • getVariables

      Map<String,Object> getVariables(String processInstanceId) throws AutomatorException
      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

      long countNumberOfTasks(String processId, String taskId) throws AutomatorException
      Throws:
      AutomatorException
    • deployBpmn

      String deployBpmn(File processFile, ScenarioDeployment.Policy policy) throws AutomatorException
      Deploy a BPMN file (may contains multiple processes)
      Parameters:
      processFile - process to deploy
      policy - 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()