private static void writeDataPath(DataPath path, XMLStreamWriter xtw) throws Exception { xtw.writeStartElement(ELEMENT_DATA_PATH); BpmnXMLUtil.writeDefaultAttribute(ATTRIBUTE_ID, path.getId(), xtw); BpmnXMLUtil.writeDefaultAttribute(ATTRIBUTE_LANGUAGE, path.getLanguage(), xtw); BpmnXMLUtil.writeDefaultAttribute( ATTRIBUTE_EVALUATES_TO_TYPE_REF, path.getEvaluatesToTypeRef(), xtw); xtw.writeCData(path.getExpressionValue()); xtw.writeEndElement(); }
public static void writeMultiInstance(Activity activity, XMLStreamWriter xtw) throws Exception { if (activity.getLoopCharacteristics() != null) { MultiInstanceLoopCharacteristics multiInstanceObject = activity.getLoopCharacteristics(); if (StringUtils.isNotEmpty(multiInstanceObject.getLoopCardinality()) || StringUtils.isNotEmpty(multiInstanceObject.getInputDataItem()) || StringUtils.isNotEmpty(multiInstanceObject.getCompletionCondition())) { xtw.writeStartElement(ELEMENT_MULTIINSTANCE); BpmnXMLUtil.writeDefaultAttribute( ATTRIBUTE_MULTIINSTANCE_SEQUENTIAL, String.valueOf(multiInstanceObject.isSequential()).toLowerCase(), xtw); if (StringUtils.isNotEmpty(multiInstanceObject.getInputDataItem())) { BpmnXMLUtil.writeQualifiedAttribute( ATTRIBUTE_MULTIINSTANCE_COLLECTION, multiInstanceObject.getInputDataItem(), xtw); } if (StringUtils.isNotEmpty(multiInstanceObject.getElementVariable())) { BpmnXMLUtil.writeQualifiedAttribute( ATTRIBUTE_MULTIINSTANCE_VARIABLE, multiInstanceObject.getElementVariable(), xtw); } if (StringUtils.isNotEmpty(multiInstanceObject.getLoopCardinality())) { xtw.writeStartElement(ELEMENT_MULTIINSTANCE_CARDINALITY); xtw.writeCharacters(multiInstanceObject.getLoopCardinality()); xtw.writeEndElement(); } if (StringUtils.isNotEmpty(multiInstanceObject.getCompletionCondition())) { xtw.writeStartElement(ELEMENT_MULTIINSTANCE_CONDITION); xtw.writeCharacters(multiInstanceObject.getCompletionCondition()); xtw.writeEndElement(); } xtw.writeEndElement(); } } }
private static void writeCorrelationPropertyBinding( CorrelationPropertyBinding binding, XMLStreamWriter xtw) throws Exception { xtw.writeStartElement(ELEMENT_CORR_PROP_BINDING); BpmnXMLUtil.writeDefaultAttribute(ATTRIBUTE_ID, binding.getId(), xtw); xtw.writeAttribute(ELEMENT_CORR_PROP_REF, binding.getCorrelationPropertyRef()); writeDataPath(binding.getDataPath(), xtw); xtw.writeEndElement(); }
public static void writeCorrelationSubscription( CorrelationSubscription subscription, XMLStreamWriter xtw) throws Exception { xtw.writeStartElement(ELEMENT_CORRELATION_SUBSCRIPTION); BpmnXMLUtil.writeDefaultAttribute(ATTRIBUTE_ID, subscription.getId(), xtw); xtw.writeAttribute(ATTRIBUTE_CORRELATION_KEY_REF, subscription.getCorrelationKeyRef()); for (CorrelationPropertyBinding binding : subscription.getCorrelationPropertyBindings()) { writeCorrelationPropertyBinding(binding, xtw); } xtw.writeEndElement(); }
protected void writeDefaultAttribute(String attributeName, String value, XMLStreamWriter xtw) throws Exception { BpmnXMLUtil.writeDefaultAttribute(attributeName, value, xtw); }