Search in sources :

Example 6 with CatchEventPropertyWriter

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;
}
Also used : CatchEventPropertyWriter(org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.properties.CatchEventPropertyWriter) IntermediateMessageEventCatching(org.kie.workbench.common.stunner.bpmn.definition.IntermediateMessageEventCatching) BPMNGeneralSet(org.kie.workbench.common.stunner.bpmn.definition.property.general.BPMNGeneralSet) CancellingMessageEventExecutionSet(org.kie.workbench.common.stunner.bpmn.definition.property.event.message.CancellingMessageEventExecutionSet)

Example 7 with CatchEventPropertyWriter

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));
}
Also used : SignalRef(org.kie.workbench.common.stunner.bpmn.definition.property.event.signal.SignalRef) TimerSettings(org.kie.workbench.common.stunner.bpmn.definition.property.event.timer.TimerSettings) BoundaryEvent(org.eclipse.bpmn2.BoundaryEvent) TimerSettingsValue(org.kie.workbench.common.stunner.bpmn.definition.property.event.timer.TimerSettingsValue) AssignmentsInfo(org.kie.workbench.common.stunner.bpmn.definition.property.dataio.AssignmentsInfo) MessageRef(org.kie.workbench.common.stunner.bpmn.definition.property.event.message.MessageRef) BPMNGeneralSet(org.kie.workbench.common.stunner.bpmn.definition.property.general.BPMNGeneralSet) CatchEvent(org.eclipse.bpmn2.CatchEvent) IntermediateCatchEvent(org.eclipse.bpmn2.IntermediateCatchEvent) PropertyWriterFactory(org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.properties.PropertyWriterFactory) DataIOSet(org.kie.workbench.common.stunner.bpmn.definition.property.dataio.DataIOSet) SLADueDate(org.kie.workbench.common.stunner.bpmn.definition.property.general.SLADueDate) AdvancedData(org.kie.workbench.common.stunner.bpmn.definition.property.variables.AdvancedData) CatchEventPropertyWriter(org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.properties.CatchEventPropertyWriter) ConditionExpression(org.kie.workbench.common.stunner.bpmn.definition.property.common.ConditionExpression) IntermediateCompensationEvent(org.kie.workbench.common.stunner.bpmn.definition.IntermediateCompensationEvent) BaseCatchingIntermediateEvent(org.kie.workbench.common.stunner.bpmn.definition.BaseCatchingIntermediateEvent) Event(org.eclipse.bpmn2.Event) IntermediateTimerEvent(org.kie.workbench.common.stunner.bpmn.definition.IntermediateTimerEvent) CatchEvent(org.eclipse.bpmn2.CatchEvent) BoundaryEvent(org.eclipse.bpmn2.BoundaryEvent) IntermediateConditionalEvent(org.kie.workbench.common.stunner.bpmn.definition.IntermediateConditionalEvent) IntermediateCatchEvent(org.eclipse.bpmn2.IntermediateCatchEvent) IntermediateEscalationEvent(org.kie.workbench.common.stunner.bpmn.definition.IntermediateEscalationEvent) FlatVariableScope(org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.properties.FlatVariableScope) ErrorRef(org.kie.workbench.common.stunner.bpmn.definition.property.event.error.ErrorRef) EscalationRef(org.kie.workbench.common.stunner.bpmn.definition.property.event.escalation.EscalationRef) BoundaryEventPropertyWriter(org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.properties.BoundaryEventPropertyWriter) LinkRef(org.kie.workbench.common.stunner.bpmn.definition.property.event.link.LinkRef) ScriptTypeValue(org.kie.workbench.common.stunner.bpmn.definition.property.task.ScriptTypeValue) Before(org.junit.Before)

Example 8 with CatchEventPropertyWriter

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());
}
Also used : CatchEventPropertyWriter(org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.properties.CatchEventPropertyWriter) AssignmentsInfo(org.kie.workbench.common.stunner.bpmn.definition.property.dataio.AssignmentsInfo) StartEvent(org.eclipse.bpmn2.StartEvent) FlatVariableScope(org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.properties.FlatVariableScope) Test(org.junit.Test) BPMNDiagramMarshallerBaseTest(org.kie.workbench.common.stunner.bpmn.backend.service.diagram.marshalling.BPMNDiagramMarshallerBaseTest)

Example 9 with CatchEventPropertyWriter

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;
}
Also used : StartSignalEvent(org.kie.workbench.common.stunner.bpmn.definition.StartSignalEvent) CatchEventPropertyWriter(org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.properties.CatchEventPropertyWriter) StartEvent(org.eclipse.bpmn2.StartEvent) BaseStartEvent(org.kie.workbench.common.stunner.bpmn.definition.BaseStartEvent) BPMNGeneralSet(org.kie.workbench.common.stunner.bpmn.definition.property.general.BPMNGeneralSet) InterruptingSignalEventExecutionSet(org.kie.workbench.common.stunner.bpmn.definition.property.event.signal.InterruptingSignalEventExecutionSet)

Example 10 with CatchEventPropertyWriter

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;
}
Also used : InterruptingEscalationEventExecutionSet(org.kie.workbench.common.stunner.bpmn.definition.property.event.escalation.InterruptingEscalationEventExecutionSet) CatchEventPropertyWriter(org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.properties.CatchEventPropertyWriter) StartEvent(org.eclipse.bpmn2.StartEvent) BaseStartEvent(org.kie.workbench.common.stunner.bpmn.definition.BaseStartEvent) StartEscalationEvent(org.kie.workbench.common.stunner.bpmn.definition.StartEscalationEvent) BPMNGeneralSet(org.kie.workbench.common.stunner.bpmn.definition.property.general.BPMNGeneralSet)

Aggregations

CatchEventPropertyWriter (org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.properties.CatchEventPropertyWriter)19 BPMNGeneralSet (org.kie.workbench.common.stunner.bpmn.definition.property.general.BPMNGeneralSet)17 StartEvent (org.eclipse.bpmn2.StartEvent)9 BaseStartEvent (org.kie.workbench.common.stunner.bpmn.definition.BaseStartEvent)8 BoundaryEvent (org.eclipse.bpmn2.BoundaryEvent)2 IntermediateCatchEvent (org.eclipse.bpmn2.IntermediateCatchEvent)2 Test (org.junit.Test)2 BoundaryEventPropertyWriter (org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.properties.BoundaryEventPropertyWriter)2 FlatVariableScope (org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.properties.FlatVariableScope)2 IntermediateCompensationEvent (org.kie.workbench.common.stunner.bpmn.definition.IntermediateCompensationEvent)2 IntermediateConditionalEvent (org.kie.workbench.common.stunner.bpmn.definition.IntermediateConditionalEvent)2 IntermediateEscalationEvent (org.kie.workbench.common.stunner.bpmn.definition.IntermediateEscalationEvent)2 IntermediateTimerEvent (org.kie.workbench.common.stunner.bpmn.definition.IntermediateTimerEvent)2 AssignmentsInfo (org.kie.workbench.common.stunner.bpmn.definition.property.dataio.AssignmentsInfo)2 BaseStartEventExecutionSet (org.kie.workbench.common.stunner.bpmn.definition.property.event.BaseStartEventExecutionSet)2 CatchEvent (org.eclipse.bpmn2.CatchEvent)1 Event (org.eclipse.bpmn2.Event)1 Before (org.junit.Before)1 PropertyWriterFactory (org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.properties.PropertyWriterFactory)1 BPMNDiagramMarshallerBaseTest (org.kie.workbench.common.stunner.bpmn.backend.service.diagram.marshalling.BPMNDiagramMarshallerBaseTest)1