use of org.kie.workbench.common.stunner.bpmn.definition.property.event.timer.InterruptingTimerEventExecutionSet in project kie-wb-common by kiegroup.
the class StartEventConverter method timerEvent.
private BpmnNode timerEvent(StartEvent event, TimerEventDefinition e) {
Node<View<StartTimerEvent>, Edge> node = factoryManager.newNode(event.getId(), StartTimerEvent.class);
StartTimerEvent definition = node.getContent().getDefinition();
EventPropertyReader p = propertyReaderFactory.of(event);
definition.setGeneral(new BPMNGeneralSet(new Name(p.getName()), new Documentation(p.getDocumentation())));
definition.setBackgroundSet(p.getBackgroundSet());
definition.setFontSet(p.getFontSet());
definition.setDimensionsSet(p.getCircleDimensionSet());
definition.setSimulationSet(p.getSimulationSet());
definition.setAdvancedData(new AdvancedData(p.getMetaDataAttributes()));
IsInterrupting isInterrupting = new IsInterrupting(event.isIsInterrupting());
SLADueDate slaDueDate = new SLADueDate(p.getSlaDueDate());
TimerSettings timerSettings = new TimerSettings(p.getTimerSettings(e));
InterruptingTimerEventExecutionSet executionSet = new InterruptingTimerEventExecutionSet(isInterrupting, slaDueDate, timerSettings);
definition.setExecutionSet(executionSet);
node.getContent().setBounds(p.getBounds());
return BpmnNode.of(node, p);
}
use of org.kie.workbench.common.stunner.bpmn.definition.property.event.timer.InterruptingTimerEventExecutionSet in project kie-wb-common by kiegroup.
the class BPMNDiagramMarshallerTest method testUnmarshallIsInterruptingStartTimerEvent.
@Test
public void testUnmarshallIsInterruptingStartTimerEvent() throws Exception {
Diagram<Graph, Metadata> diagram = unmarshall(BPMN_EVENT_SUBPROCESS_STARTTIMEREVENT);
assertDiagram(diagram, 7);
assertEquals("EventSubprocessStartTimerEvent", diagram.getMetadata().getTitle());
// Check first start event with all FILLED properties
Node<? extends Definition, ?> startEventNode = diagram.getGraph().getNode("_4A4F40C5-C9F1-4761-BD95-C61DDBDC9C19");
StartTimerEvent startTimerEvent = (StartTimerEvent) startEventNode.getContent().getDefinition();
BPMNGeneralSet eventGeneralSet = startTimerEvent.getGeneral();
assertNotNull(eventGeneralSet);
assertEquals("StartTimerEvent", eventGeneralSet.getName().getValue());
assertEquals("Some not empty\nDocumentation\n~`!@#$%^&*()_+=-{}|[]\\:\";'<>/?.,", eventGeneralSet.getDocumentation().getValue());
InterruptingTimerEventExecutionSet eventExecutionSet = startTimerEvent.getExecutionSet();
assertNotNull(eventExecutionSet);
assertNotNull(eventExecutionSet.getTimerSettings());
assertEquals("*/2 * * * *", eventExecutionSet.getTimerSettings().getValue().getTimeCycle());
assertEquals("cron", eventExecutionSet.getTimerSettings().getValue().getTimeCycleLanguage());
assertEquals("201702081535", eventExecutionSet.getTimerSettings().getValue().getTimeDate());
assertEquals("P4H", eventExecutionSet.getTimerSettings().getValue().getTimeDuration());
assertEquals(true, eventExecutionSet.getIsInterrupting().getValue());
// Check second start event with all EMPTY properties
Node<? extends Definition, ?> emptyEventNode = diagram.getGraph().getNode("_BF94EA1F-519D-4E52-AB2A-C7687E11ABDC");
StartTimerEvent emptyTimerEvent = (StartTimerEvent) emptyEventNode.getContent().getDefinition();
BPMNGeneralSet emptyEventGeneralSet = emptyTimerEvent.getGeneral();
assertNotNull(emptyEventGeneralSet);
assertEquals("", emptyEventGeneralSet.getName().getValue());
assertEquals("", emptyEventGeneralSet.getDocumentation().getValue());
InterruptingTimerEventExecutionSet emptyExecutionSet = emptyTimerEvent.getExecutionSet();
assertNotNull(emptyExecutionSet);
assertNotNull(emptyExecutionSet.getTimerSettings());
assertNull(emptyExecutionSet.getTimerSettings().getValue().getTimeCycle());
assertNull(emptyExecutionSet.getTimerSettings().getValue().getTimeCycleLanguage());
assertNull(emptyExecutionSet.getTimerSettings().getValue().getTimeDate());
assertNull(emptyExecutionSet.getTimerSettings().getValue().getTimeDuration());
assertEquals(false, emptyExecutionSet.getIsInterrupting().getValue());
}
use of org.kie.workbench.common.stunner.bpmn.definition.property.event.timer.InterruptingTimerEventExecutionSet in project kie-wb-common by kiegroup.
the class StartEventConverter method timerEvent.
private PropertyWriter timerEvent(Node<View<StartTimerEvent>, ?> n) {
StartEvent event = bpmn2.createStartEvent();
event.setId(n.getUUID());
StartTimerEvent 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());
InterruptingTimerEventExecutionSet executionSet = definition.getExecutionSet();
event.setIsInterrupting(executionSet.getIsInterrupting().getValue());
p.addSlaDueDate(executionSet.getSlaDueDate());
p.setAbsoluteBounds(n);
p.addTimer(executionSet.getTimerSettings());
return p;
}
Aggregations