Search in sources :

Example 1 with ActivityPropertyWriter

use of org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.properties.ActivityPropertyWriter in project kie-wb-common by kiegroup.

the class TaskConverter method noneTask.

private PropertyWriter noneTask(Node<View<NoneTask>, ?> n) {
    Task task = bpmn2.createTask();
    task.setId(n.getUUID());
    NoneTask definition = n.getContent().getDefinition();
    ActivityPropertyWriter p = propertyWriterFactory.of(task);
    p.setName(definition.getGeneral().getName().getValue());
    p.setBounds(n.getContent().getBounds());
    p.setSimulationSet(definition.getSimulationSet());
    return p;
}
Also used : BusinessRuleTask(org.kie.workbench.common.stunner.bpmn.definition.BusinessRuleTask) Task(org.eclipse.bpmn2.Task) ScriptTask(org.kie.workbench.common.stunner.bpmn.definition.ScriptTask) UserTask(org.kie.workbench.common.stunner.bpmn.definition.UserTask) BaseTask(org.kie.workbench.common.stunner.bpmn.definition.BaseTask) NoneTask(org.kie.workbench.common.stunner.bpmn.definition.NoneTask) ActivityPropertyWriter(org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.properties.ActivityPropertyWriter) NoneTask(org.kie.workbench.common.stunner.bpmn.definition.NoneTask)

Example 2 with ActivityPropertyWriter

use of org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.properties.ActivityPropertyWriter in project kie-wb-common by kiegroup.

the class AbstractProcessConverter method convertEdges.

public void convertEdges(ElementContainer p, DefinitionsBuildingContext context) {
    context.childEdges().forEach(e -> {
        BasePropertyWriter pSrc = p.getChildElement(e.getSourceNode().getUUID());
        // if it's null, then it's a root: skip it
        if (pSrc != null) {
            BasePropertyWriter pTgt = p.getChildElement(e.getTargetNode().getUUID());
            pTgt.setParent(pSrc);
        }
    });
    context.dockEdges().forEach(e -> {
        ActivityPropertyWriter pSrc = (ActivityPropertyWriter) p.getChildElement(e.getSourceNode().getUUID());
        BoundaryEventPropertyWriter pTgt = (BoundaryEventPropertyWriter) p.getChildElement(e.getTargetNode().getUUID());
        pTgt.setParentActivity(pSrc);
    });
    context.edges().map(e -> converterFactory.sequenceFlowConverter().toFlowElement(e, p)).forEach(p::addChildElement);
}
Also used : Result(org.kie.workbench.common.stunner.bpmn.backend.converters.Result) ConverterFactory(org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.ConverterFactory) BoundaryEventPropertyWriter(org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.properties.BoundaryEventPropertyWriter) ActivityPropertyWriter(org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.properties.ActivityPropertyWriter) LanePropertyWriter(org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.properties.LanePropertyWriter) Collectors(java.util.stream.Collectors) View(org.kie.workbench.common.stunner.core.graph.content.view.View) BPMNViewDefinition(org.kie.workbench.common.stunner.bpmn.definition.BPMNViewDefinition) List(java.util.List) Stream(java.util.stream.Stream) DefinitionsBuildingContext(org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.DefinitionsBuildingContext) BasePropertyWriter(org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.properties.BasePropertyWriter) ElementContainer(org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.ElementContainer) Node(org.kie.workbench.common.stunner.core.graph.Node) BasePropertyWriter(org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.properties.BasePropertyWriter) ActivityPropertyWriter(org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.properties.ActivityPropertyWriter) BoundaryEventPropertyWriter(org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.properties.BoundaryEventPropertyWriter)

Aggregations

ActivityPropertyWriter (org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.properties.ActivityPropertyWriter)2 List (java.util.List)1 Collectors (java.util.stream.Collectors)1 Stream (java.util.stream.Stream)1 Task (org.eclipse.bpmn2.Task)1 Result (org.kie.workbench.common.stunner.bpmn.backend.converters.Result)1 ConverterFactory (org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.ConverterFactory)1 DefinitionsBuildingContext (org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.DefinitionsBuildingContext)1 ElementContainer (org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.ElementContainer)1 BasePropertyWriter (org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.properties.BasePropertyWriter)1 BoundaryEventPropertyWriter (org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.properties.BoundaryEventPropertyWriter)1 LanePropertyWriter (org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.properties.LanePropertyWriter)1 BPMNViewDefinition (org.kie.workbench.common.stunner.bpmn.definition.BPMNViewDefinition)1 BaseTask (org.kie.workbench.common.stunner.bpmn.definition.BaseTask)1 BusinessRuleTask (org.kie.workbench.common.stunner.bpmn.definition.BusinessRuleTask)1 NoneTask (org.kie.workbench.common.stunner.bpmn.definition.NoneTask)1 ScriptTask (org.kie.workbench.common.stunner.bpmn.definition.ScriptTask)1 UserTask (org.kie.workbench.common.stunner.bpmn.definition.UserTask)1 Node (org.kie.workbench.common.stunner.core.graph.Node)1 View (org.kie.workbench.common.stunner.core.graph.content.view.View)1