use of org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.properties.CatchEventPropertyWriter in project kie-wb-common by kiegroup.
the class IntermediateCatchEventConverter method messageEvent.
protected PropertyWriter messageEvent(Node<View<IntermediateMessageEventCatching>, ?> n) {
CatchEventPropertyWriter p = createCatchEventPropertyWriter(n);
p.getFlowElement().setId(n.getUUID());
p.setAbsoluteBounds(n);
IntermediateMessageEventCatching definition = n.getContent().getDefinition();
BPMNGeneralSet general = definition.getGeneral();
p.setName(general.getName().getValue());
p.setDocumentation(general.getDocumentation().getValue());
p.setMetaData(definition.getAdvancedData().getMetaDataAttributes());
p.setAssignmentsInfo(definition.getDataIOSet().getAssignmentsinfo());
CancellingMessageEventExecutionSet executionSet = definition.getExecutionSet();
p.setCancelActivity(executionSet.getCancelActivity().getValue());
p.addSlaDueDate(executionSet.getSlaDueDate());
p.addMessage(executionSet.getMessageRef());
return p;
}
use of org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.properties.CatchEventPropertyWriter in project kie-wb-common by kiegroup.
the class IntermediateCatchEventConverterTest method setUp.
@Before
public void setUp() {
Event boundaryEvent = bpmn2.createBoundaryEvent();
boundaryEventPropertyWriter = spy(new BoundaryEventPropertyWriter((BoundaryEvent) spy(boundaryEvent), new FlatVariableScope(), new HashSet<>()));
// when(boundaryEventPropertyWriter.getFlowElement()).thenReturn(spy(FlowElement.class));
Event catchEvent = bpmn2.createIntermediateCatchEvent();
catchEventPropertyWriter = spy(new CatchEventPropertyWriter((CatchEvent) spy(catchEvent), new FlatVariableScope(), new HashSet<>()));
propertyWriterFactory = spy(PropertyWriterFactory.class);
when(propertyWriterFactory.of(any(BoundaryEvent.class))).thenReturn(boundaryEventPropertyWriter);
when(propertyWriterFactory.of(any(CatchEvent.class))).thenReturn(catchEventPropertyWriter);
generalSet = new BPMNGeneralSet(NAME, DOCUMENTATION);
assignmentsInfo = new AssignmentsInfo(ASSIGNMENTS_INFO);
dataIOSet = new DataIOSet(assignmentsInfo);
advancedData = new AdvancedData();
slaDueDate = mock(SLADueDate.class);
errorRef = mock(ErrorRef.class);
signalRef = mock(SignalRef.class);
linkRef = mock(LinkRef.class);
timerSettingsValue = mock(TimerSettingsValue.class);
timerSettings = new TimerSettings(timerSettingsValue);
messageRef = mock(MessageRef.class);
scriptTypeValue = mock(ScriptTypeValue.class);
conditionExpression = new ConditionExpression(scriptTypeValue);
escalationRef = mock(EscalationRef.class);
tested = spy(new IntermediateCatchEventConverter(propertyWriterFactory));
}
use of org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.properties.CatchEventPropertyWriter in project kie-wb-common by kiegroup.
the class AssociationsTest method marshallUnassignedDeclaration.
@Test
public void marshallUnassignedDeclaration() {
String id = "PARENT";
String decl = "||Foo:String||";
StartEvent startEvent = bpmn2.createStartEvent();
startEvent.setId(id);
CatchEventPropertyWriter p = new CatchEventPropertyWriter(startEvent, new FlatVariableScope(), new HashSet<>());
p.setAssignmentsInfo(new AssignmentsInfo(decl));
assertEquals(1, p.getItemDefinitions().size());
assertEquals(Ids.dataOutputItem(id, "Foo"), p.getItemDefinitions().get(0).getId());
assertEquals("String", p.getItemDefinitions().get(0).getStructureRef());
assertEquals(1, startEvent.getDataOutputs().size());
assertEquals("Foo", startEvent.getDataOutputs().get(0).getName());
assertEquals(0, startEvent.getDataOutputAssociation().size());
}
use of org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.properties.CatchEventPropertyWriter in project kie-wb-common by kiegroup.
the class StartEventConverter method signalEvent.
private PropertyWriter signalEvent(Node<View<StartSignalEvent>, ?> n) {
StartEvent event = bpmn2.createStartEvent();
event.setId(n.getUUID());
StartSignalEvent definition = n.getContent().getDefinition();
CatchEventPropertyWriter p = propertyWriterFactory.of(event);
BPMNGeneralSet general = definition.getGeneral();
p.setName(general.getName().getValue());
p.setDocumentation(general.getDocumentation().getValue());
p.setMetaData(definition.getAdvancedData().getMetaDataAttributes());
p.setAssignmentsInfo(definition.getDataIOSet().getAssignmentsinfo());
InterruptingSignalEventExecutionSet executionSet = definition.getExecutionSet();
event.setIsInterrupting(executionSet.getIsInterrupting().getValue());
p.addSlaDueDate(executionSet.getSlaDueDate());
p.setAbsoluteBounds(n);
p.addSignal(executionSet.getSignalRef());
return p;
}
use of org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.properties.CatchEventPropertyWriter in project kie-wb-common by kiegroup.
the class StartEventConverter method escalationEvent.
private PropertyWriter escalationEvent(Node<View<StartEscalationEvent>, ?> n) {
StartEvent event = bpmn2.createStartEvent();
event.setId(n.getUUID());
StartEscalationEvent definition = n.getContent().getDefinition();
CatchEventPropertyWriter p = propertyWriterFactory.of(event);
BPMNGeneralSet general = definition.getGeneral();
p.setName(general.getName().getValue());
p.setDocumentation(general.getDocumentation().getValue());
p.setMetaData(definition.getAdvancedData().getMetaDataAttributes());
p.setSimulationSet(definition.getSimulationSet());
p.setAssignmentsInfo(definition.getDataIOSet().getAssignmentsinfo());
InterruptingEscalationEventExecutionSet executionSet = definition.getExecutionSet();
event.setIsInterrupting(executionSet.getIsInterrupting().getValue());
p.addSlaDueDate(executionSet.getSlaDueDate());
p.setAbsoluteBounds(n);
p.addEscalation(executionSet.getEscalationRef());
return p;
}
Aggregations