Search in sources :

Example 16 with AssignmentsInfo

use of org.kie.workbench.common.stunner.bpmn.definition.property.dataio.AssignmentsInfo in project kie-wb-common by kiegroup.

the class ThrowEventPropertyWriter method setAssignmentsInfo.

@Override
public void setAssignmentsInfo(AssignmentsInfo info) {
    ParsedAssignmentsInfo assignmentsInfo = ParsedAssignmentsInfo.of(info);
    assignmentsInfo.getAssociations().getInputs().stream().map(declaration -> new InputAssignmentWriter(flowElement.getId(), variableScope.lookup(declaration.getLeft()), assignmentsInfo.getInputs().lookup(declaration.getRight()))).forEach(dia -> {
        this.addItemDefinition(dia.getItemDefinition());
        this.addDataInput(dia.getDataInput());
        throwEvent.setInputSet(dia.getInputSet());
        throwEvent.getDataInputAssociation().add(dia.getAssociation());
    });
}
Also used : EventDefinition(org.eclipse.bpmn2.EventDefinition) AssignmentsInfo(org.kie.workbench.common.stunner.bpmn.definition.property.dataio.AssignmentsInfo) ParsedAssignmentsInfo(org.kie.workbench.common.stunner.bpmn.backend.converters.customproperties.ParsedAssignmentsInfo) ThrowEvent(org.eclipse.bpmn2.ThrowEvent) ParsedAssignmentsInfo(org.kie.workbench.common.stunner.bpmn.backend.converters.customproperties.ParsedAssignmentsInfo)

Example 17 with AssignmentsInfo

use of org.kie.workbench.common.stunner.bpmn.definition.property.dataio.AssignmentsInfo in project kie-wb-common by kiegroup.

the class BusinessRuleTaskPropertyReader method getAssignmentsInfo.

public AssignmentsInfo getAssignmentsInfo() {
    Optional<InputOutputSpecification> ioSpecification = Optional.ofNullable(task.getIoSpecification());
    AssignmentsInfo info = AssignmentsInfos.of(ioSpecification.map(InputOutputSpecification::getDataInputs).orElse(Collections.emptyList()), task.getDataInputAssociations(), ioSpecification.map(InputOutputSpecification::getDataOutputs).orElse(Collections.emptyList()), task.getDataOutputAssociations(), ioSpecification.isPresent());
    // empty delimited fields instead of empty string
    if (info.getValue().isEmpty()) {
        info.setValue("||||");
    }
    return info;
}
Also used : InputOutputSpecification(org.eclipse.bpmn2.InputOutputSpecification) AssignmentsInfo(org.kie.workbench.common.stunner.bpmn.definition.property.dataio.AssignmentsInfo)

Example 18 with AssignmentsInfo

use of org.kie.workbench.common.stunner.bpmn.definition.property.dataio.AssignmentsInfo in project kie-wb-common by kiegroup.

the class BPMNDirectDiagramMarshallerTest method testUnmarshallEndSignalEvent.

@Test
@SuppressWarnings("unchecked")
public void testUnmarshallEndSignalEvent() throws Exception {
    Diagram<Graph, Metadata> diagram = unmarshall(BPMN_ENDSIGNALEVENT);
    assertDiagram(diagram, 2);
    assertEquals("EndEventAssignments", diagram.getMetadata().getTitle());
    Node<? extends Definition, ?> endSignalEventNode = diagram.getGraph().getNode("_C9151E0C-2E3E-4558-AFC2-34038E3A8552");
    EndSignalEvent endSignalEvent = (EndSignalEvent) endSignalEventNode.getContent().getDefinition();
    DataIOSet dataIOSet = endSignalEvent.getDataIOSet();
    AssignmentsInfo assignmentsinfo = dataIOSet.getAssignmentsinfo();
    assertEquals("EndSignalEventInput1:String||||[din]employee->EndSignalEventInput1", assignmentsinfo.getValue());
    assertEquals("project", endSignalEvent.getExecutionSet().getSignalScope().getValue());
    assertEquals("employee", endSignalEvent.getExecutionSet().getSignalRef().getValue());
}
Also used : DataIOSet(org.kie.workbench.common.stunner.bpmn.definition.property.dataio.DataIOSet) Graph(org.kie.workbench.common.stunner.core.graph.Graph) EndSignalEvent(org.kie.workbench.common.stunner.bpmn.definition.EndSignalEvent) AssignmentsInfo(org.kie.workbench.common.stunner.bpmn.definition.property.dataio.AssignmentsInfo) Metadata(org.kie.workbench.common.stunner.core.diagram.Metadata) Test(org.junit.Test)

Example 19 with AssignmentsInfo

use of org.kie.workbench.common.stunner.bpmn.definition.property.dataio.AssignmentsInfo in project kie-wb-common by kiegroup.

the class BPMNDirectDiagramMarshallerTest method testUnmarshallIntermediateSignalEventThrowing.

@Test
@SuppressWarnings("unchecked")
public void testUnmarshallIntermediateSignalEventThrowing() throws Exception {
    Diagram<Graph, Metadata> diagram = unmarshall(BPMN_INTERMEDIATE_SIGNAL_EVENTTHROWING);
    assertDiagram(diagram, 2);
    assertEquals("intermediateSignalThrowing", diagram.getMetadata().getTitle());
    Node<? extends Definition, ?> intermediateEventNode = diagram.getGraph().getNode("_A45EC77D-5414-4348-BA8F-05C4FFD660EE");
    IntermediateSignalEventThrowing intermediateSignalEventThrowing = (IntermediateSignalEventThrowing) intermediateEventNode.getContent().getDefinition();
    assertNotNull(intermediateSignalEventThrowing.getGeneral());
    assertEquals("MySignalThrowingEvent", intermediateSignalEventThrowing.getGeneral().getName().getValue());
    assertEquals("MySignalThrowingEventDocumentation", intermediateSignalEventThrowing.getGeneral().getDocumentation().getValue());
    assertNotNull(intermediateSignalEventThrowing.getExecutionSet());
    assertEquals("processInstance", intermediateSignalEventThrowing.getExecutionSet().getSignalScope().getValue());
    assertEquals("MySignal", intermediateSignalEventThrowing.getExecutionSet().getSignalRef().getValue());
    DataIOSet dataIOSet = intermediateSignalEventThrowing.getDataIOSet();
    AssignmentsInfo assignmentsInfo = dataIOSet.getAssignmentsinfo();
    assertEquals("_input1:String||||[din]var1->_input1", assignmentsInfo.getValue());
}
Also used : DataIOSet(org.kie.workbench.common.stunner.bpmn.definition.property.dataio.DataIOSet) Graph(org.kie.workbench.common.stunner.core.graph.Graph) AssignmentsInfo(org.kie.workbench.common.stunner.bpmn.definition.property.dataio.AssignmentsInfo) Metadata(org.kie.workbench.common.stunner.core.diagram.Metadata) IntermediateSignalEventThrowing(org.kie.workbench.common.stunner.bpmn.definition.IntermediateSignalEventThrowing) Test(org.junit.Test)

Example 20 with AssignmentsInfo

use of org.kie.workbench.common.stunner.bpmn.definition.property.dataio.AssignmentsInfo in project kie-wb-common by kiegroup.

the class BPMNDirectDiagramMarshallerTest method testUnmarshallEndMessageEvent.

@Test
@SuppressWarnings("unchecked")
public void testUnmarshallEndMessageEvent() throws Exception {
    Diagram<Graph, Metadata> diagram = unmarshall(BPMN_ENDMESSAGEEVENT);
    assertDiagram(diagram, 2);
    assertEquals("EndMessageEvent", diagram.getMetadata().getTitle());
    Node<? extends Definition, ?> endMessageEventNode = diagram.getGraph().getNode("_4A8A0A9E-D4A5-4B6E-94A6-20817A57B3C6");
    EndMessageEvent endMessageEvent = (EndMessageEvent) endMessageEventNode.getContent().getDefinition();
    assertNotNull(endMessageEvent.getExecutionSet());
    MessageRef messageRef = endMessageEvent.getExecutionSet().getMessageRef();
    assertEquals("msgref", messageRef.getValue());
    DataIOSet dataIOSet = endMessageEvent.getDataIOSet();
    AssignmentsInfo assignmentsInfo = dataIOSet.getAssignmentsinfo();
    assertEquals("EndMessageEventInputVar1:String||||[din]var1->EndMessageEventInputVar1", assignmentsInfo.getValue());
}
Also used : DataIOSet(org.kie.workbench.common.stunner.bpmn.definition.property.dataio.DataIOSet) Graph(org.kie.workbench.common.stunner.core.graph.Graph) MessageRef(org.kie.workbench.common.stunner.bpmn.definition.property.event.message.MessageRef) AssignmentsInfo(org.kie.workbench.common.stunner.bpmn.definition.property.dataio.AssignmentsInfo) Metadata(org.kie.workbench.common.stunner.core.diagram.Metadata) EndMessageEvent(org.kie.workbench.common.stunner.bpmn.definition.EndMessageEvent) Test(org.junit.Test)

Aggregations

AssignmentsInfo (org.kie.workbench.common.stunner.bpmn.definition.property.dataio.AssignmentsInfo)39 Test (org.junit.Test)32 DataIOSet (org.kie.workbench.common.stunner.bpmn.definition.property.dataio.DataIOSet)31 Metadata (org.kie.workbench.common.stunner.core.diagram.Metadata)28 Graph (org.kie.workbench.common.stunner.core.graph.Graph)28 MessageRef (org.kie.workbench.common.stunner.bpmn.definition.property.event.message.MessageRef)12 ParsedAssignmentsInfo (org.kie.workbench.common.stunner.bpmn.backend.converters.customproperties.ParsedAssignmentsInfo)4 StartErrorEvent (org.kie.workbench.common.stunner.bpmn.definition.StartErrorEvent)4 InterruptingMessageEventExecutionSet (org.kie.workbench.common.stunner.bpmn.definition.property.event.message.InterruptingMessageEventExecutionSet)4 BPMNGeneralSet (org.kie.workbench.common.stunner.bpmn.definition.property.general.BPMNGeneralSet)4 StartMessageEvent (org.kie.workbench.common.stunner.bpmn.definition.StartMessageEvent)3 IsInterrupting (org.kie.workbench.common.stunner.bpmn.definition.property.event.IsInterrupting)3 CancellingMessageEventExecutionSet (org.kie.workbench.common.stunner.bpmn.definition.property.event.message.CancellingMessageEventExecutionSet)3 ElementParameters (bpsim.ElementParameters)2 EventDefinition (org.eclipse.bpmn2.EventDefinition)2 InputOutputSpecification (org.eclipse.bpmn2.InputOutputSpecification)2 BusinessRuleTask (org.kie.workbench.common.stunner.bpmn.definition.BusinessRuleTask)2 EndErrorEvent (org.kie.workbench.common.stunner.bpmn.definition.EndErrorEvent)2 EndMessageEvent (org.kie.workbench.common.stunner.bpmn.definition.EndMessageEvent)2 EndSignalEvent (org.kie.workbench.common.stunner.bpmn.definition.EndSignalEvent)2