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());
});
}
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;
}
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());
}
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());
}
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());
}
Aggregations