Package org.activiti.bpmn.model

Examples of org.activiti.bpmn.model.ServiceTask


    }
  }
 
  @Override
  protected boolean writeExtensionChildElements(BaseElement element, boolean didWriteExtensionStartElement, XMLStreamWriter xtw) throws Exception {
    ServiceTask serviceTask = (ServiceTask) element;
   
    if (!serviceTask.getCustomProperties().isEmpty()) {
      for (CustomProperty customProperty : serviceTask.getCustomProperties()) {
       
        if (StringUtils.isEmpty(customProperty.getSimpleValue())) {
          continue;
        }
       
        if (didWriteExtensionStartElement == false) {
          xtw.writeStartElement(ELEMENT_EXTENSIONS);
          didWriteExtensionStartElement = true;
        }
        xtw.writeStartElement(ACTIVITI_EXTENSIONS_PREFIX, ELEMENT_FIELD, ACTIVITI_EXTENSIONS_NAMESPACE);
        xtw.writeAttribute(ATTRIBUTE_FIELD_NAME, customProperty.getName());
        if ((customProperty.getSimpleValue().contains("${") || customProperty.getSimpleValue().contains("#{")) &&
            customProperty.getSimpleValue().contains("}")) {
         
          xtw.writeStartElement(ACTIVITI_EXTENSIONS_PREFIX, ATTRIBUTE_FIELD_EXPRESSION, ACTIVITI_EXTENSIONS_NAMESPACE);
        } else {
          xtw.writeStartElement(ACTIVITI_EXTENSIONS_PREFIX, ELEMENT_FIELD_STRING, ACTIVITI_EXTENSIONS_NAMESPACE);
        }
        xtw.writeCharacters(customProperty.getSimpleValue());
        xtw.writeEndElement();
        xtw.writeEndElement();
      }
    } else {
      didWriteExtensionStartElement = FieldExtensionExport.writeFieldExtensions(serviceTask.getFieldExtensions(), didWriteExtensionStartElement, xtw);
    }
   
    return didWriteExtensionStartElement;
  }
View Full Code Here


    protected void executeParse(BpmnModel bpmnModel, Process element) {
      for (FlowElement flowElement : element.getFlowElements()) {
        if (!ServiceTask.class.isAssignableFrom(flowElement.getClass())) {
          continue;
        }
        ServiceTask serviceTask = (ServiceTask) flowElement;
        validateAsyncAttribute(serviceTask, bpmnModel, flowElement);
      }
    }
View Full Code Here

    addMailActionParameter("subject", getSafeJsString(stepDefinition.getSubject()), builder);
    addMailActionParameter("text", getSafeJsString(stepDefinition.getBody()), builder);
    builder.addLine("mail.execute(bpm_package);");
   
    // Build the actual task and add it to the process
    ServiceTask serviceTask = builder.build();
    serviceTask.setName(stepDefinition.getName());
    serviceTask.setId(conversion.getUniqueNumberedId(ConversionConstants.SERVICE_TASK_ID_PREFIX));
    addFlowElement(conversion, serviceTask, true);
    return serviceTask;
  }
View Full Code Here

   
    if(stepDefinition.getParameters() != null && stepDefinition.getParameters().containsKey(AlfrescoConversionConstants.PARAMETER_SCRIPT_TASK_RUNAS)) {
      builder.setRunAs((String) stepDefinition.getParameters().get(AlfrescoConversionConstants.PARAMETER_SCRIPT_TASK_RUNAS));
    }
   
    ServiceTask serviceTask = builder.build();
    serviceTask.setName(stepDefinition.getName());
    serviceTask.setDefaultFlow(stepDefinition.getDescription());
    serviceTask.setId(conversion.getUniqueNumberedId(ConversionConstants.SERVICE_TASK_ID_PREFIX));
   
    addFlowElement(conversion, serviceTask, true);
   
    return serviceTask;
  }
View Full Code Here

    } else {
      requiredCount = "1";
    }
    builder.setExecutionVariable(getRequiredCountVariableName(id, namespacePrefix), requiredCount);
   
    ServiceTask serviceTask = builder.build();
    serviceTask.setName("Review initialization");
    serviceTask.setId(conversion.getUniqueNumberedId(ConversionConstants.SERVICE_TASK_ID_PREFIX));
   
    addFlowElement(conversion, serviceTask, true);

    // Create the actual element
    UserTask userTask = (UserTask) conversion.getConversionFactory().getStepConverterFor(reviewTask)
View Full Code Here

    if(serviceTask == null) {
      FieldExtension scriptFieldElement = new FieldExtension();
      scriptFieldElement.setFieldName(AlfrescoConversionConstants.SCRIPT_DELEGATE_SCRIPT_FIELD_NAME);
      scriptFieldElement.setExpression(finalScript.toString());
     
      serviceTask = new ServiceTask();
      serviceTask.setImplementationType(ImplementationType.IMPLEMENTATION_TYPE_CLASS);
      serviceTask.setImplementation(AlfrescoConversionConstants.CLASSNAME_SCRIPT_DELEGATE);
      serviceTask.getFieldExtensions().add(scriptFieldElement);
     
      if(runAs != null) {
View Full Code Here

   
    WorkflowDefinitionConversion conversion = conversionFactory.createWorkflowDefinitionConversion(definition);
    conversion.convert();
   
    // Process should contain a single service-task
    ServiceTask task = null;
   
    for(FlowElement element : conversion.getProcess().getFlowElements()) {
      if(element instanceof ServiceTask) {
        if(task != null) {
          Assert.fail("More than one service-task found");
        }
        task = (ServiceTask) element;
      }
    }
   
    assertNotNull(task);
    assertEquals(AlfrescoConversionConstants.CLASSNAME_SCRIPT_DELEGATE, task.getImplementation());
  }
View Full Code Here

      Object bo = getBusinessObject(pe);
      // the filter assured, that it is a EClass
      if (bo == null)
        return;

      ServiceTask mailTask = (ServiceTaskbo;
     
      toText.setText(getFieldString("to", mailTask));
      fromText.setText(getFieldString("from", mailTask));
      subjectText.setText(getFieldString("subject", mailTask));
      ccText.setText(getFieldString("cc", mailTask));
View Full Code Here

  }

  protected String getIcon(Object bo) {

    if (ExtensionUtil.isCustomServiceTask(bo)) {
      ServiceTask serviceTask = (ServiceTask) bo;
      final List<CustomServiceTaskContext> customServiceTaskContexts = ExtensionUtil.getCustomServiceTaskContexts(
              ActivitiUiUtil.getProjectFromDiagram(getDiagram()));
      for (CustomServiceTaskContext customServiceTaskContext : customServiceTaskContexts) {
        if (customServiceTaskContext.getServiceTask().getId().equals(serviceTask.getExtensionId())) {
          return customServiceTaskContext.getShapeImageKey();
        }
      }
    }
    return PluginImage.IMG_SERVICETASK.getImageKey();
View Full Code Here

                  return;
                }
                String implementationName = classNameText.getText();
                if (implementationName != null) {
                  if (bo instanceof ServiceTask) {
                    ServiceTask serviceTask = (ServiceTask) bo;
                    serviceTask.setImplementationType(ImplementationType.IMPLEMENTATION_TYPE_CLASS);
                    serviceTask.setImplementation(implementationName);
                  }
                }
              }
            }, editingDomain, "Model Update");
View Full Code Here

TOP

Related Classes of org.activiti.bpmn.model.ServiceTask

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.