Search in sources :

Example 16 with ExtensionAttributeValue

use of org.eclipse.bpmn2.ExtensionAttributeValue in project kie-wb-common by kiegroup.

the class ProcessPropertyWriter method getRelationship.

public Relationship getRelationship() {
    Relationship relationship = bpmn2.createRelationship();
    relationship.setType(defaultRelationshipType);
    BPSimDataType simDataType = bpsim.createBPSimDataType();
    // currently support single scenario
    Scenario defaultScenario = bpsim.createScenario();
    ScenarioParameters scenarioParameters = bpsim.createScenarioParameters();
    // single scenario suppoert
    defaultScenario.setId("default");
    // single scenario support
    defaultScenario.setName("Simulationscenario");
    defaultScenario.setScenarioParameters(scenarioParameters);
    simDataType.getScenario().add(defaultScenario);
    ExtensionAttributeValue extensionElement = bpmn2.createExtensionAttributeValue();
    relationship.getExtensionValues().add(extensionElement);
    FeatureMap.Entry extensionElementEntry = new EStructuralFeatureImpl.SimpleFeatureMapEntry((EStructuralFeature.Internal) BpsimPackage.Literals.DOCUMENT_ROOT__BP_SIM_DATA, simDataType);
    relationship.getExtensionValues().get(0).getValue().add(extensionElementEntry);
    defaultScenario.getElementParameters().addAll(simulationParameters);
    return relationship;
}
Also used : FeatureMap(org.eclipse.emf.ecore.util.FeatureMap) Relationship(org.eclipse.bpmn2.Relationship) EStructuralFeature(org.eclipse.emf.ecore.EStructuralFeature) ScenarioParameters(bpsim.ScenarioParameters) ExtensionAttributeValue(org.eclipse.bpmn2.ExtensionAttributeValue) BPSimDataType(bpsim.BPSimDataType) Scenario(bpsim.Scenario)

Aggregations

ExtensionAttributeValue (org.eclipse.bpmn2.ExtensionAttributeValue)16 FeatureMap (org.eclipse.emf.ecore.util.FeatureMap)15 MetaDataType (org.jboss.drools.MetaDataType)7 List (java.util.List)6 ArrayList (java.util.ArrayList)5 EList (org.eclipse.emf.common.util.EList)4 SimpleFeatureMapEntry (org.eclipse.emf.ecore.impl.EStructuralFeatureImpl.SimpleFeatureMapEntry)4 ScriptTypeListValue (org.kie.workbench.common.stunner.bpmn.definition.property.task.ScriptTypeListValue)4 ScriptTypeValue (org.kie.workbench.common.stunner.bpmn.definition.property.task.ScriptTypeValue)4 BPSimDataType (bpsim.BPSimDataType)3 Relationship (org.eclipse.bpmn2.Relationship)3 EStructuralFeature (org.eclipse.emf.ecore.EStructuralFeature)3 Scenario (bpsim.Scenario)2 Entry (java.util.Map.Entry)2 EStructuralFeatureImpl (org.eclipse.emf.ecore.impl.EStructuralFeatureImpl)2 GlobalType (org.jboss.drools.GlobalType)2 ImportType (org.jboss.drools.ImportType)2 OnEntryScriptType (org.jboss.drools.OnEntryScriptType)2 OnExitScriptType (org.jboss.drools.OnExitScriptType)2 ScriptTypeListTypeSerializer (org.kie.workbench.common.stunner.bpmn.backend.marshall.json.oryx.property.ScriptTypeListTypeSerializer)2