use of org.eclipse.bpmn2.Event in project kie-wb-common by kiegroup.
the class IntermediateThrowEventConverter method signalEvent.
protected PropertyWriter signalEvent(Node<View<IntermediateSignalEventThrowing>, ?> n) {
IntermediateThrowEvent event = bpmn2.createIntermediateThrowEvent();
event.setId(n.getUUID());
ThrowEventPropertyWriter p = propertyWriterFactory.of(event);
IntermediateSignalEventThrowing definition = n.getContent().getDefinition();
p.setAbsoluteBounds(n);
BPMNGeneralSet general = definition.getGeneral();
p.setName(general.getName().getValue());
p.setDocumentation(general.getDocumentation().getValue());
p.setMetaData(definition.getAdvancedData().getMetaDataAttributes());
p.setAssignmentsInfo(definition.getDataIOSet().getAssignmentsinfo());
ScopedSignalEventExecutionSet executionSet = definition.getExecutionSet();
p.addSignal(executionSet.getSignalRef());
p.addSignalScope(executionSet.getSignalScope());
return p;
}
use of org.eclipse.bpmn2.Event in project kie-wb-common by kiegroup.
the class IntermediateThrowEventConverterTest method setUp.
@Before
public void setUp() {
Event throwEvent = bpmn2.createIntermediateThrowEvent();
throwEvent.setId("throwEventID");
throwEventPropertyWriter = spy(new ThrowEventPropertyWriter((ThrowEvent) throwEvent, new FlatVariableScope(), new HashSet<>()));
propertyWriterFactory = spy(PropertyWriterFactory.class);
when(propertyWriterFactory.of(any(ThrowEvent.class))).thenReturn(throwEventPropertyWriter);
generalSet = new BPMNGeneralSet(NAME, DOCUMENTATION);
assignmentsInfo = new AssignmentsInfo(ASSIGNMENTS_INFO);
dataIOSet = new DataIOSet(assignmentsInfo);
advancedData = new AdvancedData();
signalRef = mock(SignalRef.class);
signalScope = mock(SignalScope.class);
linkRef = mock(LinkRef.class);
messageRef = mock(MessageRef.class);
escalationRef = mock(EscalationRef.class);
tested = spy(new IntermediateThrowEventConverter(propertyWriterFactory));
}
use of org.eclipse.bpmn2.Event in project kie-wb-common by kiegroup.
the class BaseEventPropertyReaderTest method testGetLinkRef.
@Test
public void testGetLinkRef() {
// Link Event can't be Boundary
if (this instanceof BoundaryEventPropertyReaderTest) {
return;
}
assertEquals("", propertyReader.getLinkRef());
LinkEventDefinition eventDefinition = mock(LinkEventDefinition.class);
setLinkEventDefinitionOnCurrentMock(eventDefinition);
when(eventDefinition.getName()).thenReturn(null);
assertEquals("", propertyReader.getLinkRef());
when(eventDefinition.getName()).thenReturn(LINK_REF_ID);
assertEquals(LINK_REF_ID, propertyReader.getLinkRef());
EventDefinition differentType = mock(EventDefinition.class);
setLinkEventDefinitionOnCurrentMock(differentType);
assertEquals("", propertyReader.getLinkRef());
}
use of org.eclipse.bpmn2.Event in project requery by requery.
the class TimeConversionsTest method testInsertReadDate.
@Test
public void testInsertReadDate() {
Event event = new Event();
UUID id = UUID.randomUUID();
LocalDate localDateNow = LocalDate.now();
event.setId(id);
event.setLocalDate(localDateNow);
data.insert(event);
event = data.findByKey(Event.class, id);
Assert.assertEquals(localDateNow, event.getLocalDate());
}
use of org.eclipse.bpmn2.Event in project requery by requery.
the class UpsertTest method testInsertOneToManyInsert.
@Test
public void testInsertOneToManyInsert() {
Event event = new Event();
UUID id = UUID.randomUUID();
event.setId(id);
event.setName("test");
Tag t1 = new Tag();
t1.setId(UUID.randomUUID());
Tag t2 = new Tag();
t2.setId(UUID.randomUUID());
event.getTags().add(t1);
event.getTags().add(t2);
data.insert(event);
HashSet<Tag> set = new HashSet<>(event.getTags());
assertEquals(2, set.size());
assertTrue(set.containsAll(Arrays.asList(t1, t2)));
assertSame(2, data.select(Tag.class).get().toList().size());
}
Aggregations