}
}
if(properties.get("fontsize") != null && properties.get("fontsize").length() > 0) {
ExtendedMetaData metadata = ExtendedMetaData.INSTANCE;
EAttributeImpl extensionAttribute = (EAttributeImpl) metadata.demandFeature(
"http://www.jboss.org/drools", "fontsize", false, false);
SimpleFeatureMapEntry extensionEntry = new SimpleFeatureMapEntry(extensionAttribute,
properties.get("fontsize"));
sequenceFlow.getAnyAttribute().add(extensionEntry);
}
if(properties.get("fontcolor") != null && properties.get("fontcolor").length() > 0) {
if(!(_elementColors.containsKey(sequenceFlow.getId()))) {
List<String> colorsList = new ArrayList<String>();
colorsList.add("fontcolor:" + properties.get("fontcolor"));
_elementColors.put(sequenceFlow.getId(), colorsList);
} else {
_elementColors.get(sequenceFlow.getId()).add("fontcolor:" + properties.get("fontcolor"));
}
}
if(properties.get("isselectable") != null && properties.get("isselectable").length() > 0) {
ExtendedMetaData metadata = ExtendedMetaData.INSTANCE;
EAttributeImpl extensionAttribute = (EAttributeImpl) metadata.demandFeature(
"http://www.jboss.org/drools", "selectable", false, false);
SimpleFeatureMapEntry extensionEntry = new SimpleFeatureMapEntry(extensionAttribute,
properties.get("isselectable"));
sequenceFlow.getAnyAttribute().add(extensionEntry);
}
if (properties.get("auditing") != null && !"".equals(properties.get("auditing"))) {
Auditing audit = Bpmn2Factory.eINSTANCE.createAuditing();
audit.getDocumentation().add(createDocumentation(properties.get("auditing")));
sequenceFlow.setAuditing(audit);
}
if (properties.get("conditionexpression") != null && !"".equals(properties.get("conditionexpression"))) {
FormalExpression expr = Bpmn2Factory.eINSTANCE.createFormalExpression();
String scriptStr = properties.get("conditionexpression").replaceAll("\\\\n", "\n");
expr.setBody(wrapInCDATABlock(scriptStr));
// check if language was specified
if (properties.get("conditionexpressionlanguage") != null && !"".equals(properties.get("conditionexpressionlanguage"))) {
String languageStr;
if(properties.get("conditionexpressionlanguage").equals("drools")) {
languageStr = "http://www.jboss.org/drools/rule";
} else if(properties.get("conditionexpressionlanguage").equals("mvel")) {
languageStr = "http://www.mvel.org/2.0";
} else if(properties.get("conditionexpressionlanguage").equals("java")) {
languageStr = "http://www.java.com/java";
} else {
// default to mvel
languageStr = "http://www.mvel.org/2.0";
}
expr.setLanguage(languageStr);
}
sequenceFlow.setConditionExpression(expr);
}
if (properties.get("priority") != null && !"".equals(properties.get("priority"))) {
ExtendedMetaData metadata = ExtendedMetaData.INSTANCE;
EAttributeImpl priorityElement = (EAttributeImpl) metadata.demandFeature(
"http://www.jboss.org/drools", "priority", false , false);
SimpleFeatureMapEntry extensionEntry = new SimpleFeatureMapEntry(priorityElement,
properties.get("priority"));
sequenceFlow.getAnyAttribute().add(extensionEntry);
}