use of org.eclipse.emf.ecore.impl.EStructuralFeatureImpl.SimpleFeatureMapEntry in project kie-wb-common by kiegroup.
the class Bpmn2JsonUnmarshaller method updateShapeColors.
public void updateShapeColors(BPMNShape shape) {
List<String> eleColorsForShape = _elementColors.get(shape.getBpmnElement().getId());
if (eleColorsForShape != null) {
String backgroundColor = "";
String borderColor = "";
String fontColor = "";
for (String shapeColor : eleColorsForShape) {
String[] shapeColorParts = shapeColor.split(":");
if (shapeColorParts[0].equals("bgcolor")) {
backgroundColor = shapeColorParts[1];
}
if (shapeColorParts[0].equals("bordercolor")) {
borderColor = shapeColorParts[1];
}
if (shapeColorParts[0].equals("fontcolor")) {
fontColor = shapeColorParts[1];
}
}
ExtendedMetaData metadata = ExtendedMetaData.INSTANCE;
EAttributeImpl extensionAttributeBgColor = (EAttributeImpl) metadata.demandFeature("http://www.omg.org/spec/BPMN/non-normative/color", "background-color", false, false);
SimpleFeatureMapEntry extensionEntryBgColor = new SimpleFeatureMapEntry(extensionAttributeBgColor, backgroundColor);
shape.getBpmnElement().getAnyAttribute().add(extensionEntryBgColor);
EAttributeImpl extensionAttributeBorderColor = (EAttributeImpl) metadata.demandFeature("http://www.omg.org/spec/BPMN/non-normative/color", "border-color", false, false);
SimpleFeatureMapEntry extensionEntryBorderColor = new SimpleFeatureMapEntry(extensionAttributeBorderColor, borderColor);
shape.getBpmnElement().getAnyAttribute().add(extensionEntryBorderColor);
EAttributeImpl extensionAttributeColor = (EAttributeImpl) metadata.demandFeature("http://www.omg.org/spec/BPMN/non-normative/color", "color", false, false);
SimpleFeatureMapEntry extensionEntryColor = new SimpleFeatureMapEntry(extensionAttributeColor, fontColor);
shape.getBpmnElement().getAnyAttribute().add(extensionEntryColor);
} else {
_logger.debug("Unable to find color information for shape: " + shape.getBpmnElement().getId());
}
}
use of org.eclipse.emf.ecore.impl.EStructuralFeatureImpl.SimpleFeatureMapEntry in project kie-wb-common by kiegroup.
the class Bpmn2JsonUnmarshaller method applyBusinessRuleTaskProperties.
protected void applyBusinessRuleTaskProperties(BusinessRuleTask task, Map<String, String> properties) {
if (properties.get("ruleflowgroup") != null && properties.get("ruleflowgroup").length() > 0) {
// add kiegroup-specific attribute "ruleFlowGroup"
ExtendedMetaData metadata = ExtendedMetaData.INSTANCE;
EAttributeImpl extensionAttribute = (EAttributeImpl) metadata.demandFeature("http://www.jboss.org/drools", "ruleFlowGroup", false, false);
SimpleFeatureMapEntry extensionEntry = new SimpleFeatureMapEntry(extensionAttribute, properties.get("ruleflowgroup"));
task.getAnyAttribute().add(extensionEntry);
}
if (properties.get("script_language") != null && properties.get("script_language").length() > 0) {
String scriptLanguage = getScriptLanguageFormat(properties);
ExtendedMetaData metadata = ExtendedMetaData.INSTANCE;
EAttributeImpl scriptLanguageElement = (EAttributeImpl) metadata.demandFeature("http://www.jboss.org/drools", "scriptFormat", false, false);
SimpleFeatureMapEntry extensionEntry = new SimpleFeatureMapEntry(scriptLanguageElement, scriptLanguage);
task.getAnyAttribute().add(extensionEntry);
}
}
Aggregations