Search in sources :

Example 26 with BPMNPlane

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

the class Bpmn2JsonMarshaller method marshallLanes.

private List<String> marshallLanes(Lane lane, BPMNPlane plane, JsonGenerator generator, float xOffset, float yOffset, String preProcessingData, Definitions def) throws JsonGenerationException, IOException {
    Bounds bounds = ((BPMNShape) findDiagramElement(plane, lane)).getBounds();
    List<String> nodeRefIds = new ArrayList<String>();
    if (bounds != null) {
        generator.writeStartObject();
        generator.writeObjectField("resourceId", lane.getId());
        Map<String, Object> laneProperties = new LinkedHashMap<String, Object>();
        if (lane.getName() != null) {
            laneProperties.put(NAME, StringEscapeUtils.unescapeXml(lane.getName()));
        } else {
            laneProperties.put(NAME, "");
        }
        // overwrite name if elementname extension element is present
        String elementName = Utils.getMetaDataValue(lane.getExtensionValues(), "elementname");
        if (elementName != null) {
            laneProperties.put(NAME, elementName);
        }
        putDocumentationProperty(lane, laneProperties);
        Iterator<FeatureMap.Entry> iter = lane.getAnyAttribute().iterator();
        boolean foundBgColor = false;
        boolean foundBrColor = false;
        boolean foundFontColor = false;
        boolean foundSelectable = false;
        while (iter.hasNext()) {
            FeatureMap.Entry entry = iter.next();
            if (entry.getEStructuralFeature().getName().equals("background-color") || entry.getEStructuralFeature().getName().equals("bgcolor")) {
                laneProperties.put(BGCOLOR, entry.getValue());
                foundBgColor = true;
            }
            if (entry.getEStructuralFeature().getName().equals("border-color") || entry.getEStructuralFeature().getName().equals("bordercolor")) {
                laneProperties.put(BORDERCOLOR, entry.getValue());
                foundBrColor = true;
            }
            if (entry.getEStructuralFeature().getName().equals("fontsize")) {
                laneProperties.put(FONTSIZE, entry.getValue());
                foundBrColor = true;
            }
            if (entry.getEStructuralFeature().getName().equals("color") || entry.getEStructuralFeature().getName().equals("fontcolor")) {
                laneProperties.put(FONTCOLOR, entry.getValue());
                foundFontColor = true;
            }
            if (entry.getEStructuralFeature().getName().equals("selectable")) {
                laneProperties.put(ISSELECTABLE, entry.getValue());
                foundSelectable = true;
            }
        }
        if (!foundBgColor) {
            laneProperties.put(BGCOLOR, defaultBgColor_Swimlanes);
        }
        if (!foundBrColor) {
            laneProperties.put(BORDERCOLOR, defaultBrColor);
        }
        if (!foundFontColor) {
            laneProperties.put(FONTCOLOR, defaultFontColor);
        }
        if (!foundSelectable) {
            laneProperties.put(ISSELECTABLE, "true");
        }
        marshallProperties(laneProperties, generator);
        generator.writeObjectFieldStart("stencil");
        generator.writeObjectField("id", "Lane");
        generator.writeEndObject();
        generator.writeArrayFieldStart("childShapes");
        for (FlowElement flowElement : lane.getFlowNodeRefs()) {
            nodeRefIds.add(flowElement.getId());
            if (coordianteManipulation) {
                marshallFlowElement(flowElement, plane, generator, bounds.getX(), bounds.getY(), preProcessingData, def);
            } else {
                marshallFlowElement(flowElement, plane, generator, 0, 0, preProcessingData, def);
            }
        }
        generator.writeEndArray();
        generator.writeArrayFieldStart("outgoing");
        Process process = (Process) plane.getBpmnElement();
        writeAssociations(process, lane.getId(), generator);
        generator.writeEndArray();
        generator.writeObjectFieldStart("bounds");
        generator.writeObjectFieldStart("lowerRight");
        generator.writeObjectField("x", bounds.getX() + bounds.getWidth() - xOffset);
        generator.writeObjectField("y", bounds.getY() + bounds.getHeight() - yOffset);
        generator.writeEndObject();
        generator.writeObjectFieldStart("upperLeft");
        generator.writeObjectField("x", bounds.getX() - xOffset);
        generator.writeObjectField("y", bounds.getY() - yOffset);
        generator.writeEndObject();
        generator.writeEndObject();
        generator.writeEndObject();
    } else {
        // dont marshall the lane unless it has BPMNDI info (eclipse editor does not generate it for lanes currently.
        for (FlowElement flowElement : lane.getFlowNodeRefs()) {
            nodeRefIds.add(flowElement.getId());
            // we dont want an offset here!
            marshallFlowElement(flowElement, plane, generator, 0, 0, preProcessingData, def);
        }
    }
    return nodeRefIds;
}
Also used : Bounds(org.eclipse.dd.dc.Bounds) ArrayList(java.util.ArrayList) AdHocSubProcess(org.eclipse.bpmn2.AdHocSubProcess) Process(org.eclipse.bpmn2.Process) SubProcess(org.eclipse.bpmn2.SubProcess) BPMNShape(org.eclipse.bpmn2.di.BPMNShape) LinkedHashMap(java.util.LinkedHashMap) FeatureMap(org.eclipse.emf.ecore.util.FeatureMap) Entry(java.util.Map.Entry) FlowElement(org.eclipse.bpmn2.FlowElement) DataObject(org.eclipse.bpmn2.DataObject)

Example 27 with BPMNPlane

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

the class Bpmn2JsonMarshaller method marshallNode.

protected void marshallNode(FlowNode node, Map<String, Object> properties, String stencil, BPMNPlane plane, JsonGenerator generator, float xOffset, float yOffset) throws JsonGenerationException, IOException {
    if (properties == null) {
        properties = new LinkedHashMap<String, Object>();
    }
    putDocumentationProperty(node, properties);
    if (node.getName() != null) {
        properties.put(NAME, StringEscapeUtils.unescapeXml(node.getName()));
    } else {
        if (node instanceof TextAnnotation) {
            if (((TextAnnotation) node).getText() != null) {
                properties.put(NAME, ((TextAnnotation) node).getText());
            } else {
                properties.put(NAME, "");
            }
        } else {
            properties.put(NAME, "");
        }
    }
    // overwrite name if elementname extension element is present
    String elementName = Utils.getMetaDataValue(node.getExtensionValues(), "elementname");
    if (elementName != null) {
        properties.put("name", elementName);
    }
    marshallProperties(properties, generator);
    generator.writeObjectFieldStart("stencil");
    generator.writeObjectField("id", stencil);
    generator.writeEndObject();
    generator.writeArrayFieldStart("childShapes");
    generator.writeEndArray();
    generator.writeArrayFieldStart("outgoing");
    for (SequenceFlow outgoing : node.getOutgoing()) {
        generator.writeStartObject();
        generator.writeObjectField("resourceId", outgoing.getId());
        generator.writeEndObject();
    }
    // we need to also add associations as outgoing elements
    Process process = (Process) plane.getBpmnElement();
    writeAssociations(process, node.getId(), generator);
    // and boundary events for activities
    List<BoundaryEvent> boundaryEvents = new ArrayList<BoundaryEvent>();
    findBoundaryEvents(process, boundaryEvents);
    for (BoundaryEvent be : boundaryEvents) {
        if (be.getAttachedToRef().getId().equals(node.getId())) {
            generator.writeStartObject();
            generator.writeObjectField("resourceId", be.getId());
            generator.writeEndObject();
        }
    }
    generator.writeEndArray();
    // boundary events have a docker
    if (node instanceof BoundaryEvent) {
        Iterator<FeatureMap.Entry> iter = node.getAnyAttribute().iterator();
        boolean foundDockerInfo = false;
        while (iter.hasNext()) {
            FeatureMap.Entry entry = iter.next();
            if (entry.getEStructuralFeature().getName().equals("dockerinfo")) {
                foundDockerInfo = true;
                String dockerInfoStr = String.valueOf(entry.getValue());
                if (dockerInfoStr != null && dockerInfoStr.length() > 0) {
                    if (dockerInfoStr.endsWith("|")) {
                        dockerInfoStr = dockerInfoStr.substring(0, dockerInfoStr.length() - 1);
                        String[] dockerInfoParts = dockerInfoStr.split("\\|");
                        String infoPartsToUse = dockerInfoParts[0];
                        String[] infoPartsToUseParts = infoPartsToUse.split("\\^");
                        if (infoPartsToUseParts != null && infoPartsToUseParts.length > 0) {
                            generator.writeArrayFieldStart("dockers");
                            generator.writeStartObject();
                            generator.writeObjectField("x", Double.valueOf(infoPartsToUseParts[0]));
                            generator.writeObjectField("y", Double.valueOf(infoPartsToUseParts[1]));
                            generator.writeEndObject();
                            generator.writeEndArray();
                        }
                    }
                }
            }
        }
        // backwards compatibility to older versions -- BZ 1196259
        if (!foundDockerInfo) {
            // find the edge associated with this boundary event
            for (DiagramElement element : plane.getPlaneElement()) {
                if (element instanceof BPMNEdge && ((BPMNEdge) element).getBpmnElement() == node) {
                    List<Point> waypoints = ((BPMNEdge) element).getWaypoint();
                    if (waypoints != null && waypoints.size() > 0) {
                        // one per boundary event
                        Point p = waypoints.get(0);
                        if (p != null) {
                            generator.writeArrayFieldStart("dockers");
                            generator.writeStartObject();
                            generator.writeObjectField("x", p.getX());
                            generator.writeObjectField("y", p.getY());
                            generator.writeEndObject();
                            generator.writeEndArray();
                        }
                    }
                }
            }
        }
    }
    BPMNShape shape = (BPMNShape) findDiagramElement(plane, node);
    Bounds bounds = shape.getBounds();
    correctEventNodeSize(shape);
    generator.writeObjectFieldStart("bounds");
    generator.writeObjectFieldStart("lowerRight");
    generator.writeObjectField("x", bounds.getX() + bounds.getWidth() - xOffset);
    generator.writeObjectField("y", bounds.getY() + bounds.getHeight() - yOffset);
    generator.writeEndObject();
    generator.writeObjectFieldStart("upperLeft");
    generator.writeObjectField("x", bounds.getX() - xOffset);
    generator.writeObjectField("y", bounds.getY() - yOffset);
    generator.writeEndObject();
    generator.writeEndObject();
}
Also used : BoundaryEvent(org.eclipse.bpmn2.BoundaryEvent) SequenceFlow(org.eclipse.bpmn2.SequenceFlow) Bounds(org.eclipse.dd.dc.Bounds) ArrayList(java.util.ArrayList) AdHocSubProcess(org.eclipse.bpmn2.AdHocSubProcess) Process(org.eclipse.bpmn2.Process) SubProcess(org.eclipse.bpmn2.SubProcess) Point(org.eclipse.dd.dc.Point) BPMNShape(org.eclipse.bpmn2.di.BPMNShape) FeatureMap(org.eclipse.emf.ecore.util.FeatureMap) DiagramElement(org.eclipse.dd.di.DiagramElement) Entry(java.util.Map.Entry) DataObject(org.eclipse.bpmn2.DataObject) TextAnnotation(org.eclipse.bpmn2.TextAnnotation) BPMNEdge(org.eclipse.bpmn2.di.BPMNEdge)

Example 28 with BPMNPlane

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

the class Bpmn2JsonMarshaller method marshallIntermediateCatchEvent.

protected void marshallIntermediateCatchEvent(IntermediateCatchEvent catchEvent, BPMNPlane plane, JsonGenerator generator, float xOffset, float yOffset, Map<String, Object> properties) throws JsonGenerationException, IOException {
    List<EventDefinition> eventDefinitions = catchEvent.getEventDefinitions();
    // simulation properties
    setSimulationProperties(catchEvent.getId(), properties);
    if (eventDefinitions.size() == 1) {
        EventDefinition eventDefinition = eventDefinitions.get(0);
        if (eventDefinition instanceof SignalEventDefinition) {
            marshallNode(catchEvent, properties, "IntermediateSignalEventCatching", plane, generator, xOffset, yOffset);
        } else if (eventDefinition instanceof MessageEventDefinition) {
            marshallNode(catchEvent, properties, "IntermediateMessageEventCatching", plane, generator, xOffset, yOffset);
        } else if (eventDefinition instanceof TimerEventDefinition) {
            marshallNode(catchEvent, properties, "IntermediateTimerEvent", plane, generator, xOffset, yOffset);
        } else if (eventDefinition instanceof ConditionalEventDefinition) {
            marshallNode(catchEvent, properties, "IntermediateConditionalEvent", plane, generator, xOffset, yOffset);
        } else if (eventDefinition instanceof ErrorEventDefinition) {
            marshallNode(catchEvent, properties, "IntermediateErrorEvent", plane, generator, xOffset, yOffset);
        } else if (eventDefinition instanceof EscalationEventDefinition) {
            marshallNode(catchEvent, properties, "IntermediateEscalationEvent", plane, generator, xOffset, yOffset);
        } else if (eventDefinition instanceof CompensateEventDefinition) {
            marshallNode(catchEvent, properties, "IntermediateCompensationEventCatching", plane, generator, xOffset, yOffset);
        } else {
            throw new UnsupportedOperationException("Event definition not supported: " + eventDefinition);
        }
    } else {
        throw new UnsupportedOperationException("Intermediate catch event does not have event definition.");
    }
}
Also used : EscalationEventDefinition(org.eclipse.bpmn2.EscalationEventDefinition) ErrorEventDefinition(org.eclipse.bpmn2.ErrorEventDefinition) SignalEventDefinition(org.eclipse.bpmn2.SignalEventDefinition) ConditionalEventDefinition(org.eclipse.bpmn2.ConditionalEventDefinition) MessageEventDefinition(org.eclipse.bpmn2.MessageEventDefinition) EventDefinition(org.eclipse.bpmn2.EventDefinition) ConditionalEventDefinition(org.eclipse.bpmn2.ConditionalEventDefinition) EscalationEventDefinition(org.eclipse.bpmn2.EscalationEventDefinition) TerminateEventDefinition(org.eclipse.bpmn2.TerminateEventDefinition) ErrorEventDefinition(org.eclipse.bpmn2.ErrorEventDefinition) CancelEventDefinition(org.eclipse.bpmn2.CancelEventDefinition) MessageEventDefinition(org.eclipse.bpmn2.MessageEventDefinition) SignalEventDefinition(org.eclipse.bpmn2.SignalEventDefinition) CompensateEventDefinition(org.eclipse.bpmn2.CompensateEventDefinition) TimerEventDefinition(org.eclipse.bpmn2.TimerEventDefinition) TimerEventDefinition(org.eclipse.bpmn2.TimerEventDefinition) CompensateEventDefinition(org.eclipse.bpmn2.CompensateEventDefinition)

Example 29 with BPMNPlane

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

the class Bpmn2JsonMarshaller method marshallSequenceFlow.

protected void marshallSequenceFlow(SequenceFlow sequenceFlow, BPMNPlane plane, JsonGenerator generator, float xOffset, float yOffset) throws JsonGenerationException, IOException {
    // dont marshal "dangling" sequence flow..better to just omit than fail
    if (sequenceFlow.getSourceRef() == null || sequenceFlow.getTargetRef() == null) {
        return;
    }
    Map<String, Object> properties = new LinkedHashMap<String, Object>();
    // check null for sequence flow name
    if (sequenceFlow.getName() != null && !"".equals(sequenceFlow.getName())) {
        properties.put(NAME, StringEscapeUtils.unescapeXml(sequenceFlow.getName()));
    } else {
        properties.put(NAME, "");
    }
    // overwrite name if elementname extension element is present
    String elementName = Utils.getMetaDataValue(sequenceFlow.getExtensionValues(), "elementname");
    if (elementName != null) {
        properties.put(NAME, elementName);
    }
    putDocumentationProperty(sequenceFlow, properties);
    if (sequenceFlow.isIsImmediate()) {
        properties.put(ISIMMEDIATE, "true");
    } else {
        properties.put(ISIMMEDIATE, "false");
    }
    Expression conditionExpression = sequenceFlow.getConditionExpression();
    if (conditionExpression instanceof FormalExpression) {
        setConditionExpressionProperties((FormalExpression) conditionExpression, properties, "mvel");
    }
    boolean foundBgColor = false;
    boolean foundBrColor = false;
    boolean foundFontColor = false;
    boolean foundSelectable = false;
    Iterator<FeatureMap.Entry> iter = sequenceFlow.getAnyAttribute().iterator();
    while (iter.hasNext()) {
        FeatureMap.Entry entry = iter.next();
        if (entry.getEStructuralFeature().getName().equals("priority")) {
            String priorityStr = String.valueOf(entry.getValue());
            if (priorityStr != null) {
                try {
                    Integer priorityInt = Integer.parseInt(priorityStr);
                    if (priorityInt >= 1) {
                        properties.put(PRIORITY, entry.getValue());
                    } else {
                        _logger.error("Priority must be equal or greater than 1.");
                    }
                } catch (NumberFormatException e) {
                    _logger.error("Priority must be a number.");
                }
            }
        }
        if (entry.getEStructuralFeature().getName().equals("background-color") || entry.getEStructuralFeature().getName().equals("bgcolor")) {
            properties.put(BGCOLOR, entry.getValue());
            foundBgColor = true;
        }
        if (entry.getEStructuralFeature().getName().equals("border-color") || entry.getEStructuralFeature().getName().equals("bordercolor")) {
            properties.put(BORDERCOLOR, entry.getValue());
            foundBrColor = true;
        }
        if (entry.getEStructuralFeature().getName().equals("fontsize")) {
            properties.put(FONTSIZE, entry.getValue());
            foundBrColor = true;
        }
        if (entry.getEStructuralFeature().getName().equals("color") || entry.getEStructuralFeature().getName().equals("fontcolor")) {
            properties.put(FONTCOLOR, entry.getValue());
            foundFontColor = true;
        }
        if (entry.getEStructuralFeature().getName().equals("selectable")) {
            properties.put(ISSELECTABLE, entry.getValue());
            foundSelectable = true;
        }
    }
    if (!foundBgColor) {
        properties.put(BGCOLOR, defaultSequenceflowColor);
    }
    if (!foundBrColor) {
        properties.put(BORDERCOLOR, defaultSequenceflowColor);
    }
    if (!foundFontColor) {
        properties.put(FONTCOLOR, defaultSequenceflowColor);
    }
    if (!foundSelectable) {
        properties.put(ISSELECTABLE, "true");
    }
    // simulation properties
    setSimulationProperties(sequenceFlow.getId(), properties);
    // Custom attributes for Stunner's connectors - source/target auto connection flag.
    String sourcePropertyName = Bpmn2OryxManager.MAGNET_AUTO_CONNECTION + Bpmn2OryxManager.SOURCE;
    String sourceConnectorAuto = Utils.getMetaDataValue(sequenceFlow.getExtensionValues(), sourcePropertyName);
    if (sourceConnectorAuto != null && sourceConnectorAuto.trim().length() > 0) {
        properties.put(sourcePropertyName, sourceConnectorAuto);
    }
    String targetPropertyName = Bpmn2OryxManager.MAGNET_AUTO_CONNECTION + Bpmn2OryxManager.TARGET;
    String targetConnectorAuto = Utils.getMetaDataValue(sequenceFlow.getExtensionValues(), targetPropertyName);
    if (targetConnectorAuto != null && targetConnectorAuto.trim().length() > 0) {
        properties.put(targetPropertyName, targetConnectorAuto);
    }
    marshallProperties(properties, generator);
    generator.writeObjectFieldStart("stencil");
    generator.writeObjectField("id", "SequenceFlow");
    generator.writeEndObject();
    generator.writeArrayFieldStart("childShapes");
    generator.writeEndArray();
    generator.writeArrayFieldStart("outgoing");
    generator.writeStartObject();
    generator.writeObjectField("resourceId", sequenceFlow.getTargetRef().getId());
    generator.writeEndObject();
    generator.writeEndArray();
    Bounds sourceBounds = ((BPMNShape) findDiagramElement(plane, sequenceFlow.getSourceRef())).getBounds();
    Bounds targetBounds = ((BPMNShape) findDiagramElement(plane, sequenceFlow.getTargetRef())).getBounds();
    generator.writeArrayFieldStart("dockers");
    List<Point> waypoints = ((BPMNEdge) findDiagramElement(plane, sequenceFlow)).getWaypoint();
    if (waypoints.size() > 1) {
        Point waypoint = waypoints.get(0);
        writeWaypointObject(generator, waypoint.getX() - sourceBounds.getX(), waypoint.getY() - sourceBounds.getY());
    } else {
        writeWaypointObject(generator, sourceBounds.getWidth() / 2, sourceBounds.getHeight() / 2);
    }
    for (int i = 1; i < waypoints.size() - 1; i++) {
        Point waypoint = waypoints.get(i);
        writeWaypointObject(generator, waypoint.getX(), waypoint.getY());
    }
    if (waypoints.size() > 1) {
        Point waypoint = waypoints.get(waypoints.size() - 1);
        writeWaypointObject(generator, waypoint.getX() - targetBounds.getX(), waypoint.getY() - targetBounds.getY());
    } else {
        writeWaypointObject(generator, targetBounds.getWidth() / 2, targetBounds.getHeight() / 2);
    }
    generator.writeEndArray();
}
Also used : Bounds(org.eclipse.dd.dc.Bounds) Point(org.eclipse.dd.dc.Point) FormalExpression(org.eclipse.bpmn2.FormalExpression) BPMNShape(org.eclipse.bpmn2.di.BPMNShape) Point(org.eclipse.dd.dc.Point) LinkedHashMap(java.util.LinkedHashMap) FeatureMap(org.eclipse.emf.ecore.util.FeatureMap) Entry(java.util.Map.Entry) Expression(org.eclipse.bpmn2.Expression) FormalExpression(org.eclipse.bpmn2.FormalExpression) DataObject(org.eclipse.bpmn2.DataObject) BPMNEdge(org.eclipse.bpmn2.di.BPMNEdge)

Example 30 with BPMNPlane

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

the class Bpmn2JsonMarshaller method marshallCallActivity.

protected void marshallCallActivity(CallActivity callActivity, BPMNPlane plane, JsonGenerator generator, float xOffset, float yOffset, Map<String, Object> flowElementProperties) throws JsonGenerationException, IOException {
    Map<String, Object> properties = new LinkedHashMap<String, Object>(flowElementProperties);
    Iterator<FeatureMap.Entry> iter = callActivity.getAnyAttribute().iterator();
    while (iter.hasNext()) {
        FeatureMap.Entry entry = iter.next();
        if (entry.getEStructuralFeature().getName().equals("independent")) {
            properties.put(INDEPENDENT, entry.getValue());
        }
        if (entry.getEStructuralFeature().getName().equals("waitForCompletion")) {
            properties.put(WAITFORCOMPLETION, entry.getValue());
        }
    }
    if (callActivity.getCalledElement() != null && callActivity.getCalledElement().length() > 0) {
        properties.put(CALLEDELEMENT, callActivity.getCalledElement());
    }
    // custom async
    String customAsyncMetaData = Utils.getMetaDataValue(callActivity.getExtensionValues(), "customAsync");
    String customAsync = (customAsyncMetaData != null && customAsyncMetaData.length() > 0) ? customAsyncMetaData : "false";
    properties.put(ISASYNC, customAsync);
    // data inputs
    String datainputset = marshallDataInputSet(callActivity, properties);
    // data outputs
    String dataoutputset = marshallDataOutputSet(callActivity, properties);
    // assignments
    StringBuilder associationBuff = new StringBuilder();
    List<DataInputAssociation> inputAssociations = callActivity.getDataInputAssociations();
    List<DataOutputAssociation> outputAssociations = callActivity.getDataOutputAssociations();
    marshallDataInputAssociations(associationBuff, inputAssociations);
    marshallDataOutputAssociations(associationBuff, outputAssociations);
    String assignmentString = associationBuff.toString();
    if (assignmentString.endsWith(",")) {
        assignmentString = assignmentString.substring(0, assignmentString.length() - 1);
    }
    properties.put("assignments", assignmentString);
    setAssignmentsInfoProperty(null, datainputset, null, dataoutputset, assignmentString, properties);
    // on-entry and on-exit actions
    ScriptTypeListValue onEntryActions = getOnEntryActions(callActivity.getExtensionValues());
    ScriptTypeListValue onExitActions = getOnExitActions(callActivity.getExtensionValues());
    if (!onEntryActions.isEmpty()) {
        properties.put(ONENTRYACTIONS, new ScriptTypeListTypeSerializer().serialize(onEntryActions));
    }
    if (!onExitActions.isEmpty()) {
        properties.put(ONEXITACTIONS, new ScriptTypeListTypeSerializer().serialize(onExitActions));
    }
    // simulation properties
    setSimulationProperties(callActivity.getId(), properties);
    marshallNode(callActivity, properties, "ReusableSubprocess", plane, generator, xOffset, yOffset);
}
Also used : LinkedHashMap(java.util.LinkedHashMap) FeatureMap(org.eclipse.emf.ecore.util.FeatureMap) Entry(java.util.Map.Entry) DataObject(org.eclipse.bpmn2.DataObject) DataOutputAssociation(org.eclipse.bpmn2.DataOutputAssociation) ScriptTypeListTypeSerializer(org.kie.workbench.common.stunner.bpmn.backend.marshall.json.oryx.property.ScriptTypeListTypeSerializer) DataInputAssociation(org.eclipse.bpmn2.DataInputAssociation) ScriptTypeListValue(org.kie.workbench.common.stunner.bpmn.definition.property.task.ScriptTypeListValue)

Aggregations

Bounds (org.eclipse.dd.dc.Bounds)16 AdHocSubProcess (org.eclipse.bpmn2.AdHocSubProcess)15 SubProcess (org.eclipse.bpmn2.SubProcess)15 ArrayList (java.util.ArrayList)12 BPMNShape (org.eclipse.bpmn2.di.BPMNShape)12 Process (org.eclipse.bpmn2.Process)11 DataObject (org.eclipse.bpmn2.DataObject)10 FlowElement (org.eclipse.bpmn2.FlowElement)9 BPMNEdge (org.eclipse.bpmn2.di.BPMNEdge)9 LinkedHashMap (java.util.LinkedHashMap)8 DataInputAssociation (org.eclipse.bpmn2.DataInputAssociation)8 DataOutputAssociation (org.eclipse.bpmn2.DataOutputAssociation)8 SequenceFlow (org.eclipse.bpmn2.SequenceFlow)8 Point (org.eclipse.dd.dc.Point)8 DiagramElement (org.eclipse.dd.di.DiagramElement)8 Artifact (org.eclipse.bpmn2.Artifact)7 BPMNPlane (org.eclipse.bpmn2.di.BPMNPlane)7 Entry (java.util.Map.Entry)6 FeatureMap (org.eclipse.emf.ecore.util.FeatureMap)6 Association (org.eclipse.bpmn2.Association)5