Package org.activiti.bpmn.model

Examples of org.activiti.bpmn.model.FormValue


        ListPropertyDefinition listDefinition = (ListPropertyDefinition) propertyDefinition;
       
        if (!listDefinition.getEntries().isEmpty()) {
          List<FormValue> formValues = new ArrayList<FormValue>(listDefinition.getEntries().size());
          for (ListPropertyEntry entry : listDefinition.getEntries()) {
            FormValue formValue = new FormValue();
            // We're using same value for id and name for the moment
            formValue.setId(entry.getValue());
            formValue.setName(entry.getName());
            formValues.add(formValue);
          }
          formProperty.setFormValues(formValues);
        }
      } else {
View Full Code Here


              formValuesArrayNode = formValuesNode.get(EDITOR_PROPERTIES_GENERAL_ITEMS);
              List<FormValue> formValues = new ArrayList<FormValue>();
              for (JsonNode valueNode : formValuesArrayNode) {
                JsonNode valueIdNode = valueNode.get(PROPERTY_FORM_FORM_VALUE_ID);
                if (valueIdNode != null && StringUtils.isNotEmpty(valueIdNode.asText())) {
                  FormValue formValue = new FormValue();
                  formValue.setId(valueIdNode.asText());
                  formValue.setName(getValueAsString(PROPERTY_FORM_FORM_VALUE_NAME, valueNode));
                  formValues.add(formValue);
                }
              }
              formProperty.setFormValues(formValues);
            }
View Full Code Here

        // Assert the values are set
        List<FormValue> values = firstProperty.getFormValues();
        assertTrue(values.size() == 2);

        FormValue firstValue = values.get(0);
        assertEquals("Approve", firstValue.getName());
        assertEquals("true", firstValue.getId());

        FormValue secondValue = values.get(1);
        assertEquals("Reject", secondValue.getName());
        assertEquals("false", secondValue.getId());

        // Now confirm the second property, a non list property, is well formed as well.
        FormProperty secondProperty = properties.get(1);
        assertNotNull(secondProperty);
        assertTrue(secondProperty.getFormValues().isEmpty());
View Full Code Here

    boolean readyWithFormProperty = false;
    try {
      while (readyWithFormProperty == false && xtr.hasNext()) {
        xtr.next();
        if (xtr.isStartElement() && ELEMENT_VALUE.equalsIgnoreCase(xtr.getLocalName())) {
          FormValue value = new FormValue();
          BpmnXMLUtil.addXMLLocation(value, xtr);
          value.setId(xtr.getAttributeValue(null, ATTRIBUTE_ID));
          value.setName(xtr.getAttributeValue(null, ATTRIBUTE_NAME));
          property.getFormValues().add(value);

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

      tableItem.setText(8, "" + formProperty.isReadable());
      tableItem.setText(9, "" + formProperty.isWriteable());
     
      StringBuilder formValuesString = new StringBuilder();
      for(int i = 0; i < formProperty.getFormValues().size(); i++) {
        FormValue formValue = formProperty.getFormValues().get(i);
        if(i > 0) {
          formValuesString.append(";");
        }
        formValuesString.append(formValue.getId()).append(":").append(formValue.getName());
      }
      tableItem.setText(10, formValuesString.toString());
    }
  }
View Full Code Here

              List<FormValue> formValueList = new ArrayList<FormValue>();
              if(formValues != null && formValues.length() > 0) {
                String[] formValueArray = formValues.split(";");
                if(formValueArray != null) {
                  for(String formValue : formValueArray) {
                    FormValue formValueObj = new FormValue();
                    formValueObj.setId(formValue.substring(0, formValue.lastIndexOf(":")));
                    formValueObj.setName(formValue.substring(formValue.lastIndexOf(":") + 1));
                    formValueList.add(formValueObj);
                  }
                }
              }
              newFormProperty.getFormValues().addAll(formValueList);
View Full Code Here

    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

    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.FormValue

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.