use of org.eclipse.bpmn2.EventSubprocess in project kie-wb-common by kiegroup.
the class MatchTest method whenTest.
@Test
public void whenTest() {
EventSubprocess element = Bpmn2Factory.eINSTANCE.createEventSubprocess();
Result<BpmnNode> result = match().apply(element);
verify(assertSubProcess).apply(element);
assertNotEquals(result.value(), defaultValue);
assertTrue(result.isSuccess());
}
use of org.eclipse.bpmn2.EventSubprocess in project kie-wb-common by kiegroup.
the class SubProcessConverterTest method setUp.
@Before
public void setUp() {
Definitions definitions = bpmn2.createDefinitions();
definitions.getRootElements().add(bpmn2.createProcess());
BPMNDiagram bpmnDiagram = di.createBPMNDiagram();
bpmnDiagram.setPlane(di.createBPMNPlane());
definitions.getDiagrams().add(bpmnDiagram);
definitionResolver = new DefinitionResolver(definitions, Collections.emptyList());
Node adHocNode = new NodeImpl("");
View<AdHocSubprocess> adHocContent = new ViewImpl<>(new AdHocSubprocess(), Bounds.create());
adHocNode.setContent(adHocContent);
Node multipleInstanceNode = new NodeImpl("");
View<MultipleInstanceSubprocess> miContent = new ViewImpl<>(new MultipleInstanceSubprocess(), Bounds.create());
multipleInstanceNode.setContent(miContent);
Node embeddedNode = new NodeImpl("");
View<EmbeddedSubprocess> embeddedContent = new ViewImpl<>(new EmbeddedSubprocess(), Bounds.create());
embeddedNode.setContent(embeddedContent);
Node eventNode = new NodeImpl("");
View<EventSubprocess> eventSubprocess = new ViewImpl<>(new EventSubprocess(), Bounds.create());
eventNode.setContent(eventSubprocess);
FactoryManager factoryManager = mock(FactoryManager.class);
when(factoryManager.newElement(any(), eq(getDefinitionId(AdHocSubprocess.class)))).thenReturn(adHocNode);
when(factoryManager.newElement(any(), eq(getDefinitionId(MultipleInstanceSubprocess.class)))).thenReturn(multipleInstanceNode);
when(factoryManager.newElement(any(), eq(getDefinitionId(EmbeddedSubprocess.class)))).thenReturn(embeddedNode);
when(factoryManager.newElement(any(), eq(getDefinitionId(EventSubprocess.class)))).thenReturn(eventNode);
TypedFactoryManager typedFactoryManager = new TypedFactoryManager(factoryManager);
tested = new SubProcessConverter(typedFactoryManager, new PropertyReaderFactory(definitionResolver), definitionResolver, new ConverterFactory(definitionResolver, typedFactoryManager));
}
use of org.eclipse.bpmn2.EventSubprocess in project kie-wb-common by kiegroup.
the class EventSubprocessPropertyReaderTest method testGetSlaDueDate.
@Test
public void testGetSlaDueDate() {
String rawSlaDueDate = "12/25/1983";
SubProcess eventSubProcess = bpmn2.createSubProcess();
CustomElement.slaDueDate.of(eventSubProcess).set(rawSlaDueDate);
tested = new SubProcessPropertyReader(eventSubProcess, definitionResolverReal.getDiagram(), definitionResolverReal);
assertTrue(tested.getSlaDueDate().contains(rawSlaDueDate));
}
use of org.eclipse.bpmn2.EventSubprocess in project kie-wb-common by kiegroup.
the class EventSubprocessPropertyReaderTest method testIsAsync.
@Test
public void testIsAsync() {
SubProcess eventSubProcess = bpmn2.createSubProcess();
CustomElement.async.of(eventSubProcess).set(Boolean.TRUE);
tested = new SubProcessPropertyReader(eventSubProcess, definitionResolverReal.getDiagram(), definitionResolverReal);
assertTrue(tested.isAsync());
}
use of org.eclipse.bpmn2.EventSubprocess in project kie-wb-common by kiegroup.
the class SubProcessPropertyWriter method setAbsoluteBounds.
@Override
public void setAbsoluteBounds(Node<? extends View, ?> node) {
super.setAbsoluteBounds(node);
Object definition = node.getContent().getDefinition();
if (definition instanceof BaseAdHocSubprocess || definition instanceof EventSubprocess || definition instanceof EmbeddedSubprocess) {
shape.setIsExpanded(true);
}
}
Aggregations