Examples of WorkflowDefinition


Examples of org.activiti.workflow.simple.definition.WorkflowDefinition

  }
 
  @Test
  public void testParallelConversion() {
    // Create definition
    WorkflowDefinition workflowDefinition = new WorkflowDefinition()
    .name("testWorkflow")
    .description("This is a test workflow")
    .inParallel()
      .inList()
        .addHumanStep("first task", "kermit")
        .addHumanStep("second task", "kermit")
      .endList()
      .inList()
        .addHumanStep("gonzo task", "gonzo")
      .endList()
    .endParallel();

    // Write result to byte-array
    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    Writer writer = new OutputStreamWriter(baos);
    converter.writeWorkflowDefinition(workflowDefinition, writer);

    // Parse definition based on written JSON
    WorkflowDefinition parsedDefinition = converter.readWorkflowDefinition(baos.toByteArray());

    // Check if parsed definition matches the original one
    assertEquals(workflowDefinition.getName(), parsedDefinition.getName());
    assertEquals(workflowDefinition.getDescription(), parsedDefinition.getDescription());
    ParallelStepsDefinition parallelDef = null;
    for (StepDefinition step : parsedDefinition.getSteps()) {
      if (step instanceof ParallelStepsDefinition) {
        parallelDef = (ParallelStepsDefinition) step;
      }
    }
    assertNotNull(parallelDef);
View Full Code Here

Examples of org.activiti.workflow.simple.definition.WorkflowDefinition

          try {
           
            byte[] bpmnBytes = null;
            String filename = null;
            if (SimpleTableEditorConstants.TABLE_EDITOR_CATEGORY.equals(modelData.getCategory())) {
              WorkflowDefinition workflowDefinition = ExplorerApp.get().getSimpleWorkflowJsonConverter()
                  .readWorkflowDefinition(repositoryService.getModelEditorSource(modelData.getId()));
             
              filename = workflowDefinition.getName();
              WorkflowDefinitionConversion conversion =
                      ExplorerApp.get().getWorkflowDefinitionConversionFactory().createWorkflowDefinitionConversion(workflowDefinition);
              bpmnBytes = conversion.getBpmn20Xml().getBytes("utf-8");
            } else {
              JsonNode editorNode = new ObjectMapper().readTree(repositoryService.getModelEditorSource(modelData.getId()));
View Full Code Here

Examples of org.activiti.workflow.simple.definition.WorkflowDefinition

      private static final long serialVersionUID = 1L;

      public void buttonClick(ClickEvent event) {
       
        // Convert to simple workflow definition
        WorkflowDefinition workflowDefinition = ExplorerApp.get().getSimpleWorkflowJsonConverter()
            .readWorkflowDefinition(model);

        // Update model name
        modelData.setName(deployModelPopupWindow.getProcessName());
        workflowDefinition.setName(deployModelPopupWindow.getProcessName());
       
        WorkflowDefinitionConversion conversion =
                ExplorerApp.get().getWorkflowDefinitionConversionFactory().createWorkflowDefinitionConversion(workflowDefinition);
        conversion.convert();
       
View Full Code Here

Examples of org.activiti.workflow.simple.definition.WorkflowDefinition

                    "}" +
                    "" +
                    "execution.setVariable('reportData', reportData.toBytes());";
   
    // Generate bpmn model
    WorkflowDefinition workflowDefinition = new WorkflowDefinition()
      .name(processDefinition.getName() + " task duration report")
      .description(reportDescription)
      .addScriptStep(script);
   
    // Convert to BPMN 2.0 XML
View Full Code Here

Examples of org.activiti.workflow.simple.definition.WorkflowDefinition

    }
  }
 
  @Test
  public void testSimplestProcess() {
    WorkflowDefinition workflowDefinition = new WorkflowDefinition()
    .name("testWorkflow")
    .description("This is a test workflow");
 
    // Validate
    ProcessInstance processInstance = activitiRule.getRuntimeService().startProcessInstanceByKey(convertAndDeploy(workflowDefinition));
View Full Code Here

Examples of org.activiti.workflow.simple.definition.WorkflowDefinition

 
  @Test
  public void testUserTasksWithOnlyAssignees() {
    String[] assignees = new String[] {"kermit", "gonzo", "mispiggy"};
   
    WorkflowDefinition workflowDefinition = new WorkflowDefinition()
      .name("testWorkflow")
      .description("This is a test workflow")
      .addHumanStep("first task", assignees[0])
      .addHumanStep("second step", assignees[1])
      .addHumanStep("third step", assignees[2]);
View Full Code Here

Examples of org.activiti.workflow.simple.definition.WorkflowDefinition

 
  @Test
  public void testThreeUserTasksInParallel() throws Exception {
    TaskService taskService = activitiRule.getTaskService();
   
    WorkflowDefinition workflowDefinition = new WorkflowDefinition()
      .name("testWorkflow")
      .description("This is a test workflow")
      .inParallel()
        .inList()
          .addHumanStep("first task", "kermit")
View Full Code Here

Examples of org.activiti.workflow.simple.definition.WorkflowDefinition

 
  @Test
  public void testUserTasksInChoice() throws Exception {
    TaskService taskService = activitiRule.getTaskService();
   
    WorkflowDefinition workflowDefinition = new WorkflowDefinition()
      .name("testWorkflow")
      .description("This is a test workflow")
      .inChoice()
        .inList()
          .addCondition("test", "==", "'hello'")
View Full Code Here

Examples of org.activiti.workflow.simple.definition.WorkflowDefinition

 
  @Test
  public void testMultipleConditionsInChoice() throws Exception {
    TaskService taskService = activitiRule.getTaskService();
   
    WorkflowDefinition workflowDefinition = new WorkflowDefinition()
      .name("testWorkflow")
      .description("This is a test workflow")
      .inChoice()
        .inList()
          .addCondition("test", "==", "'hello'")
View Full Code Here

Examples of org.activiti.workflow.simple.definition.WorkflowDefinition

    assertEquals(0, activitiRule.getRuntimeService().createProcessInstanceQuery().processInstanceId(instance.getId()).count());
  }
 
  @Test
  public void testInitiatorOnHumanStep() {
    WorkflowDefinition workflowDefinition = new WorkflowDefinition()
      .name("testWorkflow")
      .description("This is a test workflow")
      .addHumanStep("step1", "kermit")
      .addHumanStepForWorkflowInitiator("step2");
   
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.