use of org.eclipse.emf.ecore.util.FeatureMap in project kie-wb-common by kiegroup.
the class DefinitionResolver method initSimulationParameters.
private Map<String, ElementParameters> initSimulationParameters(Definitions definitions) {
Map<String, ElementParameters> simulationParameters = new HashMap<>();
List<Relationship> relationships = definitions.getRelationships();
if (relationships.isEmpty()) {
return Collections.emptyMap();
}
FeatureMap value = relationships.get(0).getExtensionValues().get(0).getValue();
Object simData = value.get(BpsimPackage.Literals.DOCUMENT_ROOT__BP_SIM_DATA, true);
List<BPSimDataType> bpsimExtensions = (List<BPSimDataType>) simData;
Scenario scenario = bpsimExtensions.get(0).getScenario().get(0);
for (ElementParameters parameters : scenario.getElementParameters()) {
simulationParameters.put(parameters.getElementRef(), parameters);
}
return simulationParameters;
}
use of org.eclipse.emf.ecore.util.FeatureMap 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.emf.ecore.util.FeatureMap 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.emf.ecore.util.FeatureMap in project statecharts by Yakindu.
the class StatechartEqualityHelper method haveEqualAttribute.
@Override
protected boolean haveEqualAttribute(EObject eObject1, EObject eObject2, EAttribute attribute) {
Object value1 = eObject1.eGet(attribute);
Object value2 = eObject2.eGet(attribute);
//
if (value1 == null) {
return value2 == null;
}
//
if (value2 == null) {
return false;
}
//
if (FeatureMapUtil.isFeatureMap(attribute)) {
// The feature maps must be equal.
//
FeatureMap featureMap1 = (FeatureMap) value1;
FeatureMap featureMap2 = (FeatureMap) value2;
return equalFeatureMaps(featureMap1, featureMap2);
} else {
if (value1 instanceof String && value2 instanceof String) {
String wsFreeValue1 = removeWhitespaces((String) value1);
String wsFreeValue2 = removeWhitespaces((String) value2);
return wsFreeValue1.equals(wsFreeValue2);
}
return value1.equals(value2);
}
}
use of org.eclipse.emf.ecore.util.FeatureMap in project mylyn.docs by eclipse.
the class PublicationProxy method getIdentifier.
@SuppressWarnings("rawtypes")
public String getIdentifier() {
EList<Identifier> identifiers = publication.getPackage().getMetadata().getIdentifiers();
if (identifiers.size() > 0) {
FeatureMap fm = identifiers.get(0).getMixed();
Object o = fm.get(TEXT, false);
if (o instanceof FeatureEList) {
if (((FeatureEList) o).size() > 0) {
return ((FeatureEList) o).get(0).toString();
}
}
}
return EMPTY_STRING;
}
Aggregations