Package org.activiti.bpmn.model

Examples of org.activiti.bpmn.model.FieldExtension


    result.setSimpleValue(original.getSimpleValue());
    return result;
  }
 
  private static final FieldExtension clone(final FieldExtension original) {
    FieldExtension result = new FieldExtension();
    result.setFieldName(original.getFieldName());
    result.setExpression(original.getExpression());
    result.setStringValue(original.getStringValue());
    return result;
  }
View Full Code Here


    String[] fieldStringList = fieldString.split("� ");
    List<FieldExtension> fieldList = new ArrayList<FieldExtension>();
    for (String field : fieldStringList) {
      String[] fieldExtensionStringList = field.split(":");
      if(fieldExtensionStringList != null && fieldExtensionStringList.length >= 2) {
        FieldExtension fieldExtension = new FieldExtension();
        fieldExtension.setFieldName(fieldExtensionStringList[0]);
        String expression = null;
        for(int i = 1; i < fieldExtensionStringList.length; i++) {
          if(i == 1) {
            expression = fieldExtensionStringList[i];
          } else {
            expression += ":" + fieldExtensionStringList[i];
          }
        }
        if (expression.contains("${") || expression.contains("#{")) {
          fieldExtension.setExpression(expression);
        } else {
          fieldExtension.setStringValue(expression);
        }
        fieldList.add(fieldExtension);
      }
    }
    return fieldList;
View Full Code Here

    ServiceTask newMailTask = new ServiceTask();
    newMailTask.setImplementation(AlfrescoScriptTask.ALFRESCO_SCRIPT_DELEGATE);
    newMailTask.setImplementationType(ImplementationType.IMPLEMENTATION_TYPE_CLASS);
    newMailTask.setId(getNextId(newMailTask));
    newMailTask.setName("Alfresco Mail Task");
    FieldExtension fieldExtension = new FieldExtension();
    fieldExtension.setFieldName("script");
    fieldExtension.setStringValue("var mail = actions.create(\"mail\");\nmail.execute(bpm_package);");
    newMailTask.getFieldExtensions().add(fieldExtension);
   
    Object parentObject = getBusinessObjectForPictogramElement(context.getTargetContainer());
    if (parentObject instanceof SubProcess) {
      ((SubProcess) parentObject).addFlowElement(newMailTask);
View Full Code Here

      task.setImplementationType(ImplementationType.IMPLEMENTATION_TYPE_CLASS);
      task.setImplementation(XML_JENKINSTASK_DELEGATE_CLASS);
     
      String jobName = getPropertyValueAsString(JSON_JENKINSTASK_JOB_NAME, elementNode);
    if (StringUtils.isNotEmpty(jobName)) {
      FieldExtension f1 = new FieldExtension();
            f1.setFieldName(XML_JENKINSTASK_JOB_NAME);
            f1.setStringValue(jobName);
            task.getFieldExtensions().add(f1);
      }     
   
    FieldExtension f2 = new FieldExtension();
        f2.setFieldName(XML_JENKINSTASK_MANUAL_LAUNCH_MODE);
        f2.setStringValue(Boolean.toString(getPropertyValueAsBoolean(JSON_JENKINSTASK_MANUAL_LAUNCH_MODE, elementNode)));
        task.getFieldExtensions().add(f2);

        convertJsonToFormProperties(elementNode, task);
    return task;
  }
View Full Code Here

    assertEquals("servicetask", serviceTask.getId());
    assertEquals("Service task", serviceTask.getName());
   
    List<FieldExtension> fields = serviceTask.getFieldExtensions();
    assertEquals(2, fields.size());
    FieldExtension field = (FieldExtension) fields.get(0);
    assertEquals("testField", field.getFieldName());
    assertEquals("test", field.getStringValue());
    field = (FieldExtension) fields.get(1);
    assertEquals("testField2", field.getFieldName());
    assertEquals("${test}", field.getExpression());
   
    List<ActivitiListener> listeners = serviceTask.getExecutionListeners();
    assertEquals(3, listeners.size());
    ActivitiListener listener = (ActivitiListener) listeners.get(0);
    assertTrue(ImplementationType.IMPLEMENTATION_TYPE_CLASS.equals(listener.getImplementationType()));
View Full Code Here

      if (itemsArrayNode != null) {
        for (JsonNode itemNode : itemsArrayNode) {
          JsonNode nameNode = itemNode.get(PROPERTY_SERVICETASK_FIELD_NAME);
          if (nameNode != null && StringUtils.isNotEmpty(nameNode.asText())) {
           
            FieldExtension field = new FieldExtension();
            field.setFieldName(nameNode.asText());
            if (StringUtils.isNotEmpty(getValueAsString(PROPERTY_SERVICETASK_FIELD_VALUE, itemNode))) {
              field.setStringValue(getValueAsString(PROPERTY_SERVICETASK_FIELD_VALUE, itemNode));
            } else if (StringUtils.isNotEmpty(getValueAsString(PROPERTY_SERVICETASK_FIELD_EXPRESSION, itemNode))) {
              field.setExpression(getValueAsString(PROPERTY_SERVICETASK_FIELD_EXPRESSION, itemNode));
            }
            task.getFieldExtensions().add(field);
          }
        }
      }
View Full Code Here

   
    return task;
  }
 
  protected void addField(String name, JsonNode elementNode, ServiceTask task) {
    FieldExtension field = new FieldExtension();
    field.setFieldName(name.substring(8));
    String value = getPropertyValueAsString(name, elementNode);
    if (StringUtils.isNotEmpty(value)) {
      if ((value.contains("${") || value.contains("#{")) && value.contains("}")) {
        field.setExpression(value);
      } else {
        field.setStringValue(value);
      }
    }
    task.getFieldExtensions().add(field);
  }
View Full Code Here

  }
 
  public void parseChildElement(XMLStreamReader xtr, BaseElement parentElement) throws Exception {
    if (parentElement instanceof ActivitiListener == false && parentElement instanceof ServiceTask == false) return;
   
    FieldExtension extension = new FieldExtension();
    extension.setFieldName(xtr.getAttributeValue(null, ATTRIBUTE_FIELD_NAME));
   
    if (StringUtils.isNotEmpty(xtr.getAttributeValue(null, ATTRIBUTE_FIELD_STRING))) {
      extension.setStringValue(xtr.getAttributeValue(null, ATTRIBUTE_FIELD_STRING));

    } else if (StringUtils.isNotEmpty(xtr.getAttributeValue(null, ATTRIBUTE_FIELD_EXPRESSION))) {
      extension.setExpression(xtr.getAttributeValue(null, ATTRIBUTE_FIELD_EXPRESSION));

    } else {
      boolean readyWithFieldExtension = false;
      try {
        while (readyWithFieldExtension == false && xtr.hasNext()) {
          xtr.next();
          if (xtr.isStartElement() && ELEMENT_FIELD_STRING.equalsIgnoreCase(xtr.getLocalName())) {
            extension.setStringValue(xtr.getElementText().trim());

          } else if (xtr.isStartElement() && ATTRIBUTE_FIELD_EXPRESSION.equalsIgnoreCase(xtr.getLocalName())) {
            extension.setExpression(xtr.getElementText().trim());

          } else if (xtr.isEndElement() && getElementName().equalsIgnoreCase(xtr.getLocalName())) {
            readyWithFieldExtension = true;
          }
        }
View Full Code Here

TOP

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

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.