Search in sources :

Example 1 with PriorityParameters

use of bpsim.PriorityParameters in project jbpm by kiegroup.

the class ElementParametersImpl method basicSetPriorityParameters.

/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
public NotificationChain basicSetPriorityParameters(PriorityParameters newPriorityParameters, NotificationChain msgs) {
    PriorityParameters oldPriorityParameters = priorityParameters;
    priorityParameters = newPriorityParameters;
    if (eNotificationRequired()) {
        ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, BpsimPackage.ELEMENT_PARAMETERS__PRIORITY_PARAMETERS, oldPriorityParameters, newPriorityParameters);
        if (msgs == null)
            msgs = notification;
        else
            msgs.add(notification);
    }
    return msgs;
}
Also used : ENotificationImpl(org.eclipse.emf.ecore.impl.ENotificationImpl) PriorityParameters(bpsim.PriorityParameters)

Example 2 with PriorityParameters

use of bpsim.PriorityParameters in project kie-wb-common by kiegroup.

the class Bpmn2JsonUnmarshaller method addSimulation.

public void addSimulation(Definitions def) {
    Relationship relationship = Bpmn2Factory.eINSTANCE.createRelationship();
    relationship.getSources().add(def);
    relationship.getTargets().add(def);
    relationship.setType(defaultRelationshipType);
    BPSimDataType simDataType = BpsimFactory.eINSTANCE.createBPSimDataType();
    // currently support single scenario
    Scenario defaultScenario = BpsimFactory.eINSTANCE.createScenario();
    // single scenario suppoert
    defaultScenario.setId("default");
    // single scenario support
    defaultScenario.setName("Simulationscenario");
    defaultScenario.setScenarioParameters(_simulationScenarioParameters);
    if (_simulationElementParameters.size() > 0) {
        Iterator<String> iter = _simulationElementParameters.keySet().iterator();
        while (iter.hasNext()) {
            String key = iter.next();
            ElementParameters etype = BpsimFactory.eINSTANCE.createElementParameters();
            etype.setElementRef(key);
            List<EObject> params = _simulationElementParameters.get(key);
            for (EObject np : params) {
                if (np instanceof ControlParameters) {
                    etype.setControlParameters((ControlParameters) np);
                } else if (np instanceof CostParameters) {
                    etype.setCostParameters((CostParameters) np);
                } else if (np instanceof PriorityParameters) {
                    etype.setPriorityParameters((PriorityParameters) np);
                } else if (np instanceof ResourceParameters) {
                    etype.setResourceParameters((ResourceParameters) np);
                } else if (np instanceof TimeParameters) {
                    etype.setTimeParameters((TimeParameters) np);
                }
            }
            defaultScenario.getElementParameters().add(etype);
        }
    }
    simDataType.getScenario().add(defaultScenario);
    ExtensionAttributeValue extensionElement = Bpmn2Factory.eINSTANCE.createExtensionAttributeValue();
    relationship.getExtensionValues().add(extensionElement);
    FeatureMap.Entry extensionElementEntry = new SimpleFeatureMapEntry((Internal) BpsimPackage.Literals.DOCUMENT_ROOT__BP_SIM_DATA, simDataType);
    relationship.getExtensionValues().get(0).getValue().add(extensionElementEntry);
    def.getRelationships().add(relationship);
}
Also used : CostParameters(bpsim.CostParameters) ElementParameters(bpsim.ElementParameters) ExtensionAttributeValue(org.eclipse.bpmn2.ExtensionAttributeValue) ResourceParameters(bpsim.ResourceParameters) Scenario(bpsim.Scenario) FeatureMap(org.eclipse.emf.ecore.util.FeatureMap) Relationship(org.eclipse.bpmn2.Relationship) EObject(org.eclipse.emf.ecore.EObject) ControlParameters(bpsim.ControlParameters) SimpleFeatureMapEntry(org.eclipse.emf.ecore.impl.EStructuralFeatureImpl.SimpleFeatureMapEntry) PriorityParameters(bpsim.PriorityParameters) BPSimDataType(bpsim.BPSimDataType) TimeParameters(bpsim.TimeParameters)

Aggregations

PriorityParameters (bpsim.PriorityParameters)2 BPSimDataType (bpsim.BPSimDataType)1 ControlParameters (bpsim.ControlParameters)1 CostParameters (bpsim.CostParameters)1 ElementParameters (bpsim.ElementParameters)1 ResourceParameters (bpsim.ResourceParameters)1 Scenario (bpsim.Scenario)1 TimeParameters (bpsim.TimeParameters)1 ExtensionAttributeValue (org.eclipse.bpmn2.ExtensionAttributeValue)1 Relationship (org.eclipse.bpmn2.Relationship)1 EObject (org.eclipse.emf.ecore.EObject)1 ENotificationImpl (org.eclipse.emf.ecore.impl.ENotificationImpl)1 SimpleFeatureMapEntry (org.eclipse.emf.ecore.impl.EStructuralFeatureImpl.SimpleFeatureMapEntry)1 FeatureMap (org.eclipse.emf.ecore.util.FeatureMap)1