src/test/java/me/paulbares/bpmn/TestBasicApprovalWorkflow.java
public static void deployIfNecessary(ProcessEngine processEngine) {
    // To avoid having multiple Process Definition with the same key and since we are redeploying each time the
    // definition, do a query to see if it exists.
    String bpmnName = BasicApprovalWorflow.NAME;
    List<ProcessDefinition> list = processEngine.getRepositoryService()
            .createProcessDefinitionQuery()
            .processDefinitionKey(bpmnName)
            .list();
    if (list == null || list.isEmpty()) {
      // Deploying Process Definition
      final String resource = bpmnName + ".bpmn";
      Deployment deploy = processEngine.getRepositoryService()
              .createDeployment()
              .addModelInstance(resource, BasicApprovalWorflow.getBpmnModelInstance())
              .deploy();
      LOGGER.info("Process definition with key '{}' deployed. {}", bpmnName, deploy);
    } else {
      LOGGER.info("Process definition with key '{}' not deployed because already exists in the repository service.",
              bpmnName);
    }
  }
/**
   * Deploys the underlying process definition. Made public for testing purpose.
   */
Deploys the underlying process definition. Made public for testing purpose.
Deploys the underlying process definition . Made public for testing purpose .
public static void deployIfNecessary(ProcessEngine processEngine) {
    String bpmnName = BasicApprovalWorflow.NAME;
    List<ProcessDefinition> list = processEngine.getRepositoryService()
            .createProcessDefinitionQuery()
            .processDefinitionKey(bpmnName)
            .list();
    if (list == null || list.isEmpty()) {
      final String resource = bpmnName + ".bpmn";
      Deployment deploy = processEngine.getRepositoryService()
              .createDeployment()
              .addModelInstance(resource, BasicApprovalWorflow.getBpmnModelInstance())
              .deploy();
      LOGGER.info("Process definition with key '{}' deployed. {}", bpmnName, deploy);
    } else {
      LOGGER.info("Process definition with key '{}' not deployed because already exists in the repository service.",
              bpmnName);
    }
  }
public static void deployIfNecessary ( ProcessEngine processEngine ) { String bpmnName = BasicApprovalWorflow . NAME ; List < ProcessDefinition > list = processEngine . getRepositoryService ( ) . createProcessDefinitionQuery ( ) . processDefinitionKey ( bpmnName ) . list ( ) ; if ( list == null || list . isEmpty ( ) ) { final String resource = bpmnName + ".bpmn" ; Deployment deploy = processEngine . getRepositoryService ( ) . createDeployment ( ) . addModelInstance ( resource , BasicApprovalWorflow . getBpmnModelInstance ( ) ) . deploy ( ) ; LOGGER . info ( "Process definition with key '{}' deployed. {}" , bpmnName , deploy ) ; } else { LOGGER . info ( "Process definition with key '{}' not deployed because already exists in the repository service." , bpmnName ) ; } }
Deploys the underlying process definition.
Deploys the underlying process definition .
// To avoid having multiple Process Definition with the same key and since we are redeploying each time the // definition, do a query to see if it exists. // Deploying Process Definition