public AbstractFormType parseFormPropertyType(FormProperty formProperty) { AbstractFormType formType = null; if ("date".equals(formProperty.getType()) && StringUtils.isNotEmpty(formProperty.getDatePattern())) { formType = new DateFormType(formProperty.getDatePattern()); } else if ("enum".equals(formProperty.getType())) { // ACT-1023: Using linked hashmap to preserve the order in which the entries are defined Map<String, String> values = new LinkedHashMap<>(); for (FormValue formValue : formProperty.getFormValues()) { values.put(formValue.getId(), formValue.getName()); } formType = new EnumFormType(values); } else if (StringUtils.isNotEmpty(formProperty.getType())) { formType = formTypes.get(formProperty.getType()); if (formType == null) { throw new ActivitiIllegalArgumentException("unknown type '" + formProperty.getType() + "' " + formProperty.getId()); } } return formType; } }
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);
public void setValues(FormProperty otherProperty) { super.setValues(otherProperty); setName(otherProperty.getName()); setExpression(otherProperty.getExpression()); setVariable(otherProperty.getVariable()); setType(otherProperty.getType()); setDefaultExpression(otherProperty.getDefaultExpression()); setDatePattern(otherProperty.getDatePattern()); setReadable(otherProperty.isReadable()); setWriteable(otherProperty.isWriteable()); setRequired(otherProperty.isRequired()); formValues = new ArrayList<>(); if (otherProperty.getFormValues() != null && !otherProperty.getFormValues().isEmpty()) { for (FormValue formValue : otherProperty.getFormValues()) { formValues.add(formValue.clone()); } } } }
public AbstractFormType parseFormPropertyType(FormProperty formProperty) { AbstractFormType formType = null; if ("date".equals(formProperty.getType()) && StringUtils.isNotEmpty(formProperty.getDatePattern())) { formType = new DateFormType(formProperty.getDatePattern()); } else if ("enum".equals(formProperty.getType())) { // ACT-1023: Using linked hashmap to preserve the order in which the // entries are defined Map<String, String> values = new LinkedHashMap<>(); for (FormValue formValue : formProperty.getFormValues()) { values.put(formValue.getId(), formValue.getName()); } formType = new EnumFormType(values); } else if (StringUtils.isNotEmpty(formProperty.getType())) { formType = formTypes.get(formProperty.getType()); if (formType == null) { throw new FlowableIllegalArgumentException("unknown type '" + formProperty.getType() + "' " + formProperty.getId()); } } return formType; } }
&& !enumNode.get(PROPERTY_FORM_ENUM_VALUES_NAME).isNull()) { FormValue formValue = new FormValue(); formValue.setId(enumNode.get(PROPERTY_FORM_ENUM_VALUES_ID).asText()); formValue.setName(enumNode.get(PROPERTY_FORM_ENUM_VALUES_NAME).asText()); formValueList.add(formValue); FormValue formValue = new FormValue(); formValue.setId(enumNode.get("value").asText()); formValue.setName(enumNode.get("value").asText()); formValueList.add(formValue);
public void setValues(FormProperty otherProperty) { super.setValues(otherProperty); setName(otherProperty.getName()); setExpression(otherProperty.getExpression()); setVariable(otherProperty.getVariable()); setType(otherProperty.getType()); setDefaultExpression(otherProperty.getDefaultExpression()); setDatePattern(otherProperty.getDatePattern()); setReadable(otherProperty.isReadable()); setWriteable(otherProperty.isWriteable()); setRequired(otherProperty.isRequired()); formValues = new ArrayList<>(); if (otherProperty.getFormValues() != null && !otherProperty.getFormValues().isEmpty()) { for (FormValue formValue : otherProperty.getFormValues()) { formValues.add(formValue.clone()); } } } }