Package org.activiti.bpmn.model

Examples of org.activiti.bpmn.model.FormProperty


    }
    return result;
  }

  private static FormProperty clone(final FormProperty formProperty) {
    FormProperty result = new FormProperty();
    result.setId(formProperty.getId());
    result.setName(formProperty.getName());
    result.setType(formProperty.getType());
    result.setExpression(formProperty.getExpression());
    result.setVariable(formProperty.getVariable());
    result.setDefaultExpression(formProperty.getDefaultExpression());
    result.setDatePattern(formProperty.getDatePattern());
    result.setReadable(formProperty.isReadable());
    result.setRequired(formProperty.isRequired());
    result.setWriteable(formProperty.isWriteable());

    List<FormValue> resultValueList = new ArrayList<FormValue>();
    for (FormValue formValue : formProperty.getFormValues()) {
      FormValue resultValue = new FormValue();
      resultValue.setId(formValue.getId());
      resultValue.setName(formValue.getName());
      resultValueList.add(resultValue);
    }
    result.setFormValues(resultValueList);

    return result;
  }
View Full Code Here


      if (itemsArrayNode != null) {
        for (JsonNode formNode : itemsArrayNode) {
          JsonNode formIdNode = formNode.get(PROPERTY_FORM_ID);
          if (formIdNode != null && StringUtils.isNotEmpty(formIdNode.asText())) {
           
            FormProperty formProperty = new FormProperty();
            formProperty.setId(formIdNode.asText());
            formProperty.setName(getValueAsString(PROPERTY_FORM_NAME, formNode));
            formProperty.setType(getValueAsString(PROPERTY_FORM_TYPE, formNode));
            formProperty.setExpression(getValueAsString(PROPERTY_FORM_EXPRESSION, formNode));
            formProperty.setVariable(getValueAsString(PROPERTY_FORM_VARIABLE, formNode));
           
            if (element instanceof StartEvent) {
              ((StartEvent) element).getFormProperties().add(formProperty);
            } else if (element instanceof UserTask) {
              ((UserTask) element).getFormProperties().add(formProperty);
View Full Code Here

    assertTrue(userTask.getCandidateGroups().contains("management"));
    assertTrue(userTask.getCandidateGroups().contains("sales"));
   
    List<FormProperty> formProperties = userTask.getFormProperties();
    assertEquals(2, formProperties.size());
    FormProperty formProperty = formProperties.get(0);
    assertEquals("formId", formProperty.getId());
    assertEquals("formName", formProperty.getName());
    assertEquals("string", formProperty.getType());
    assertEquals("variable", formProperty.getVariable());
    assertEquals("${expression}", formProperty.getExpression());
    formProperty = formProperties.get(1);
    assertEquals("formId2", formProperty.getId());
    assertEquals("anotherName", formProperty.getName());
    assertEquals("long", formProperty.getType());
    assertTrue(StringUtils.isEmpty(formProperty.getVariable()));
    assertTrue(StringUtils.isEmpty(formProperty.getExpression()));
   
    List<ActivitiListener> listeners = userTask.getTaskListeners();
    assertEquals(3, listeners.size());
    ActivitiListener listener = (ActivitiListener) listeners.get(0);
    assertTrue(ImplementationType.IMPLEMENTATION_TYPE_CLASS.equals(listener.getImplementationType()));
View Full Code Here

  }
 
  public void parseChildElement(XMLStreamReader xtr, BaseElement parentElement) throws Exception {
    if (parentElement instanceof UserTask == false && parentElement instanceof StartEvent == false) return;
   
    FormProperty property = new FormProperty();
    property.setId(xtr.getAttributeValue(null, "id"));
    property.setName(xtr.getAttributeValue(null, "name"));
    property.setType(xtr.getAttributeValue(null, "type"));
    property.setValue(xtr.getAttributeValue(null, "value"));
    property.setVariable(xtr.getAttributeValue(null, "variable"));
    property.setExpression(xtr.getAttributeValue(null, "expression"));
    property.setDefaultExpression(xtr.getAttributeValue(null, "default"));
    property.setDatePattern(xtr.getAttributeValue(null, "datePattern"));
    property.setRequired(Boolean.valueOf(xtr.getAttributeValue(null, "required")));
    property.setReadable(Boolean.valueOf(xtr.getAttributeValue(null, "readable")));
    property.setWriteable(Boolean.valueOf(xtr.getAttributeValue(null, "writable")));
   
    boolean readyWithFormProperty = false;
    try {
      while (readyWithFormProperty == false && xtr.hasNext()) {
        xtr.next();
        if (xtr.isStartElement() && "value".equalsIgnoreCase(xtr.getLocalName())) {
          FormValue value = new FormValue();
          value.setId(xtr.getAttributeValue(null, "id"));
          value.setName(xtr.getAttributeValue(null, "name"));
          property.getFormValues().add(value);

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

TOP

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

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.