use of org.kie.workbench.common.stunner.bpmn.definition.IntermediateTimerEvent in project kie-wb-common by kiegroup.
the class IntermediateCatchEventConverter method timerEvent.
private BpmnNode timerEvent(CatchEvent event, TimerEventDefinition e) {
String nodeId = event.getId();
Node<View<IntermediateTimerEvent>, Edge> node = factoryManager.newNode(nodeId, IntermediateTimerEvent.class);
IntermediateTimerEvent definition = node.getContent().getDefinition();
EventPropertyReader p = propertyReaderFactory.of(event);
definition.setGeneral(new BPMNGeneralSet(new Name(p.getName()), new Documentation(p.getDocumentation())));
definition.setExecutionSet(new CancellingTimerEventExecutionSet(new CancelActivity(p.isCancelActivity()), new TimerSettings(p.getTimerSettings(e))));
node.getContent().setBounds(p.getBounds());
definition.setDimensionsSet(p.getCircleDimensionSet());
definition.setFontSet(p.getFontSet());
definition.setBackgroundSet(p.getBackgroundSet());
return BpmnNode.of(node);
}
use of org.kie.workbench.common.stunner.bpmn.definition.IntermediateTimerEvent in project kie-wb-common by kiegroup.
the class EventCancelActivityViewHandlerTest method testHandleTimerIsNotCancel.
@Test
@SuppressWarnings("unchecked")
public void testHandleTimerIsNotCancel() {
final IntermediateTimerEvent bean = new IntermediateTimerEvent.IntermediateTimerEventBuilder().build();
bean.getExecutionSet().getCancelActivity().setValue(false);
tested.handle(bean, view);
verify(prim1).setAlpha(eq(0d));
verify(prim2).setAlpha(eq(1d));
}
use of org.kie.workbench.common.stunner.bpmn.definition.IntermediateTimerEvent in project kie-wb-common by kiegroup.
the class BPMNDirectDiagramMarshallerTest method testUnmarshallEventDefinitionRef.
@Test
public void testUnmarshallEventDefinitionRef() {
try {
Diagram<Graph, Metadata> diagram = unmarshall(BPMN_EVENT_DEFINITION_REF);
Node<? extends Definition<IntermediateTimerEvent>, ?> intermediateTimerEvent = diagram.getGraph().getNode("FLOWNODE_9e71d692-986c-11e7-40d3-005056844bde");
IntermediateTimerEvent definition = intermediateTimerEvent.getContent().getDefinition();
CancellingTimerEventExecutionSet executionSet = definition.getExecutionSet();
TimerSettings timerSettings = executionSet.getTimerSettings();
} catch (Exception ex) {
fail(ex.getMessage());
}
}
use of org.kie.workbench.common.stunner.bpmn.definition.IntermediateTimerEvent in project kie-wb-common by kiegroup.
the class BPMNDiagramMarshallerTest method testMarshallIntermediateTimerEvent.
@Test
public void testMarshallIntermediateTimerEvent() throws Exception {
Diagram<Graph, Metadata> diagram = unmarshall(BPMN_TIMER_EVENT);
IntermediateTimerEvent timerEvent = null;
Iterator<Element> it = nodesIterator(diagram);
while (it.hasNext()) {
Element element = it.next();
if (element.getContent() instanceof View) {
Object oDefinition = ((View) element.getContent()).getDefinition();
if (oDefinition instanceof IntermediateTimerEvent) {
timerEvent = (IntermediateTimerEvent) oDefinition;
break;
}
}
}
assertNotNull(timerEvent);
assertNotNull(timerEvent.getGeneral());
assertNotNull(timerEvent.getExecutionSet());
assertEquals("myTimeDateValue", timerEvent.getExecutionSet().getTimerSettings().getValue().getTimeDate());
assertEquals("MyTimeDurationValue", timerEvent.getExecutionSet().getTimerSettings().getValue().getTimeDuration());
assertEquals("myTimeCycleValue", timerEvent.getExecutionSet().getTimerSettings().getValue().getTimeCycle());
assertEquals("cron", timerEvent.getExecutionSet().getTimerSettings().getValue().getTimeCycleLanguage());
}
use of org.kie.workbench.common.stunner.bpmn.definition.IntermediateTimerEvent in project kie-wb-common by kiegroup.
the class BPMNDirectDiagramMarshallerTest method testUnmarshallIntermediateTimerEvent.
@Test
@SuppressWarnings("unchecked")
public void testUnmarshallIntermediateTimerEvent() throws Exception {
Diagram<Graph, Metadata> diagram = unmarshall(BPMN_INTERMEDIATE_TIMER_EVENT);
assertDiagram(diagram, 2);
assertEquals("intermediateTimer", diagram.getMetadata().getTitle());
Node<? extends Definition, ?> intermediateEventNode = diagram.getGraph().getNode("_8D881072-284F-4F0D-8CF2-AD1F4540FC4E");
IntermediateTimerEvent intermediateTimerEvent = (IntermediateTimerEvent) intermediateEventNode.getContent().getDefinition();
assertNotNull(intermediateTimerEvent.getGeneral());
assertEquals("MyTimer", intermediateTimerEvent.getGeneral().getName().getValue());
assertNotNull(intermediateTimerEvent.getExecutionSet());
assertEquals("abc", intermediateTimerEvent.getExecutionSet().getTimerSettings().getValue().getTimeCycle());
assertEquals("none", intermediateTimerEvent.getExecutionSet().getTimerSettings().getValue().getTimeCycleLanguage());
assertEquals("abc", intermediateTimerEvent.getExecutionSet().getTimerSettings().getValue().getTimeDate());
assertEquals("abc", intermediateTimerEvent.getExecutionSet().getTimerSettings().getValue().getTimeDuration());
}
Aggregations