use of org.eclipse.bpmn2.ExtensionAttributeValue in project kie-wb-common by kiegroup.
the class Utils method getMetaDataValue.
public static String getMetaDataValue(List<ExtensionAttributeValue> extensionValues, String metaDataName) {
if (extensionValues != null && extensionValues.size() > 0) {
for (ExtensionAttributeValue extattrval : extensionValues) {
FeatureMap extensionElements = extattrval.getValue();
List<MetaDataType> metadataExtensions = (List<MetaDataType>) extensionElements.get(DroolsPackage.Literals.DOCUMENT_ROOT__META_DATA, true);
for (MetaDataType metaType : metadataExtensions) {
if (metaType.getName() != null && metaType.getName().equals(metaDataName) && metaType.getMetaValue() != null && metaType.getMetaValue().length() > 0) {
return metaType.getMetaValue();
}
}
}
}
return null;
}
use of org.eclipse.bpmn2.ExtensionAttributeValue in project kie-wb-common by kiegroup.
the class Scripts method addExtensionValue.
private static void addExtensionValue(FlowElement flowElement, FeatureMap.Entry value) {
ExtensionAttributeValue eav = bpmn2.createExtensionAttributeValue();
flowElement.getExtensionValues().add(eav);
eav.getValue().add(value);
}
use of org.eclipse.bpmn2.ExtensionAttributeValue in project kie-wb-common by kiegroup.
the class Bpmn2JsonMarshaller method getOnExitActions.
public ScriptTypeListValue getOnExitActions(final List<ExtensionAttributeValue> extensionValues) {
final ScriptTypeListValue onExitActions = new ScriptTypeListValue();
ScriptTypeValue onExitAction;
if (extensionValues != null && !extensionValues.isEmpty()) {
for (ExtensionAttributeValue extattrval : extensionValues) {
FeatureMap extensionElements = extattrval.getValue();
@SuppressWarnings("unchecked") List<OnExitScriptType> onExitExtensions = (List<OnExitScriptType>) extensionElements.get(DroolsPackage.Literals.DOCUMENT_ROOT__ON_EXIT_SCRIPT, true);
for (OnExitScriptType onExitScript : onExitExtensions) {
onExitAction = getOnExitAction(onExitScript);
if (onExitAction.getScript() != null && !onExitAction.getScript().isEmpty()) {
onExitActions.addValue(onExitAction);
}
}
}
}
return onExitActions;
}
use of org.eclipse.bpmn2.ExtensionAttributeValue in project kie-wb-common by kiegroup.
the class Bpmn2JsonMarshaller method getOnEntryActions.
public ScriptTypeListValue getOnEntryActions(final List<ExtensionAttributeValue> extensionValues) {
final ScriptTypeListValue onEntryActions = new ScriptTypeListValue();
ScriptTypeValue onEntryAction;
if (extensionValues != null && !extensionValues.isEmpty()) {
for (ExtensionAttributeValue extattrval : extensionValues) {
FeatureMap extensionElements = extattrval.getValue();
@SuppressWarnings("unchecked") List<OnEntryScriptType> onEntryExtensions = (List<OnEntryScriptType>) extensionElements.get(DroolsPackage.Literals.DOCUMENT_ROOT__ON_ENTRY_SCRIPT, true);
for (OnEntryScriptType onEntryScript : onEntryExtensions) {
onEntryAction = getOnEntryAction(onEntryScript);
if (onEntryAction.getScript() != null && !onEntryAction.getScript().isEmpty()) {
onEntryActions.addValue(onEntryAction);
}
}
}
}
return onEntryActions;
}
use of org.eclipse.bpmn2.ExtensionAttributeValue in project kie-wb-common by kiegroup.
the class StringElement method setStringValue.
void setStringValue(BaseElement element, String value) {
if (element != null) {
MetaDataType eleMetadata = DroolsFactory.eINSTANCE.createMetaDataType();
eleMetadata.setName(name);
eleMetadata.setMetaValue(asCData(value));
if (element.getExtensionValues() == null || element.getExtensionValues().isEmpty()) {
ExtensionAttributeValue extensionElement = Bpmn2Factory.eINSTANCE.createExtensionAttributeValue();
element.getExtensionValues().add(extensionElement);
}
FeatureMap.Entry eleExtensionElementEntry = new EStructuralFeatureImpl.SimpleFeatureMapEntry((EStructuralFeature.Internal) DroolsPackage.Literals.DOCUMENT_ROOT__META_DATA, eleMetadata);
element.getExtensionValues().get(0).getValue().add(eleExtensionElementEntry);
}
}
Aggregations