Package org.activiti.workflow.simple.converter

Examples of org.activiti.workflow.simple.converter.WorkflowDefinitionConversionFactory


    addSequenceFlow(conversion, conversion.getLastActivityId(), forkGateway.getId());
    conversion.setLastActivityId(forkGateway.getId());

    // Convert all other steps, disabling activity id updates which makes all
    // generated steps have a sequence flow to the first gateway
    WorkflowDefinitionConversionFactory conversionFactory = conversion.getConversionFactory();
    List<FlowElement> endElements = new ArrayList<FlowElement>();
    List<SequenceFlow> bypassingFlows = new ArrayList<SequenceFlow>();
    for (ListConditionStepDefinition<ChoiceStepsDefinition> stepListDefinition : choiceStepsDefinition.getStepList()) {
     
      StringBuilder conditionBuilder = new StringBuilder();
      for (ConditionDefinition conditionDefintion : stepListDefinition.getConditions()) {
        if (conditionBuilder.length() > 0) {
          conditionBuilder.append(" && ");
        } else {
          conditionBuilder.append("${");
        }
       
        conditionBuilder.append(conditionDefintion.getLeftOperand());
        conditionBuilder.append(" ");
        conditionBuilder.append(conditionDefintion.getOperator());
        conditionBuilder.append(" ");
        conditionBuilder.append(conditionDefintion.getRightOperand());
      }
     
      for (int i = 0; i < stepListDefinition.getSteps().size(); i++) {
        if (i == 0) {
          conversion.setSequenceflowGenerationEnabled(false);
        } else {
          conversion.setSequenceflowGenerationEnabled(true);
        }
        StepDefinition step = stepListDefinition.getSteps().get(i);
        FlowElement flowElement = (FlowElement) conversionFactory.getStepConverterFor(step).convertStepDefinition(step, conversion);
       
        if (i == 0) {
          if (conditionBuilder.length() > 0) {
            conditionBuilder.append("}");
            SequenceFlow mainFlow = addSequenceFlow(conversion, forkGateway.getId(), flowElement.getId(), conditionBuilder.toString());
View Full Code Here


    addSequenceFlow(conversion, conversion.getLastActivityId(), forkGateway.getId());
    conversion.setLastActivityId(forkGateway.getId());

    // Convert all other steps, disabling activity id updates which makes all
    // generated steps have a sequence flow to the first gateway
    WorkflowDefinitionConversionFactory conversionFactory = conversion.getConversionFactory();
    List<FlowElement> endElements = new ArrayList<FlowElement>();
    for (ListStepDefinition<ParallelStepsDefinition> stepListDefinition : parallelStepsDefinition.getStepList()) {
     
      for (int i = 0; i < stepListDefinition.getSteps().size(); i++) {
        if (i == 0) {
          conversion.setSequenceflowGenerationEnabled(false);
        } else {
          conversion.setSequenceflowGenerationEnabled(true);
        }
        StepDefinition step = stepListDefinition.getSteps().get(i);
        FlowElement flowElement = (FlowElement) conversionFactory.getStepConverterFor(step).convertStepDefinition(step, conversion);
       
        if (i == 0) {
          addSequenceFlow(conversion, forkGateway.getId(), flowElement.getId());
        }
       
View Full Code Here

  @Before
  public void initialiseTest() {
   
    // Alternatively, the following setup could be done using a dependency injection container
   
    conversionFactory = new WorkflowDefinitionConversionFactory();
    runtimeService = activitiRule.getRuntimeService();
    taskService = activitiRule.getTaskService();
  }
View Full Code Here

  public SimpleWorkflowSuccessResponse createWorkflow(@RequestBody String json) {
    // Convert json to simple workflow definition
    SimpleWorkflowJsonConverter jsonConverter = new SimpleWorkflowJsonConverter();
    WorkflowDefinition workflowDefinition = jsonConverter.readWorkflowDefinition(json.getBytes());
   
    WorkflowDefinitionConversionFactory conversionFactory = new WorkflowDefinitionConversionFactory();
    WorkflowDefinitionConversion conversion = conversionFactory.createWorkflowDefinitionConversion(workflowDefinition);
    conversion.convert();
   
    // Deploy process

    BpmnModel bpmnModel = conversion.getBpmnModel();
View Full Code Here

TOP

Related Classes of org.activiti.workflow.simple.converter.WorkflowDefinitionConversionFactory

Copyright © 2018 www.massapicom. 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.