@Test public void testOf() throws Exception { assertTrue(tested.of(bpmn2.createCallActivity()) instanceof CaseManagementActivityPropertyReader); } }
@Test public void testCreateNode_case() throws Exception { String id = UUID.randomUUID().toString(); CallActivity callActivity = bpmn2.createCallActivity(); callActivity.setId(id); CaseManagementCustomElement.isCase.of(callActivity).set(Boolean.TRUE); CaseManagementActivityPropertyReader propertyReader = new CaseManagementActivityPropertyReader(callActivity, definitionResolver.getDiagram(), definitionResolver); tested.createNode(callActivity, propertyReader); verify(factoryManager).newElement(eq(id), eq(CaseReusableSubprocess.class)); }
@Test public void testOf() throws Exception { final CallActivityPropertyWriter propertyWriter = tested.of(bpmn2.createCallActivity()); assertTrue(propertyWriter instanceof CaseManagementCallActivityPropertyWriter); } }
@Test public void testCreateNode_process() throws Exception { String id = UUID.randomUUID().toString(); CallActivity callActivity = bpmn2.createCallActivity(); callActivity.setId(id); CaseManagementCustomElement.isCase.of(callActivity).set(Boolean.FALSE); CaseManagementActivityPropertyReader propertyReader = new CaseManagementActivityPropertyReader(callActivity, definitionResolver.getDiagram(), definitionResolver); tested.createNode(callActivity, propertyReader); verify(factoryManager).newElement(eq(id), eq(ProcessReusableSubprocess.class)); }
@Test public void testIsCase_false() throws Exception { String id = UUID.randomUUID().toString(); CallActivity callActivity = bpmn2.createCallActivity(); callActivity.setId(id); CaseManagementCustomElement.isCase.of(callActivity).set(Boolean.FALSE); tested = new CaseManagementActivityPropertyReader(callActivity, definitionResolver.getDiagram(), definitionResolver); assertFalse(tested.isCase()); } }
@Test public void testIsCase_true() throws Exception { String id = UUID.randomUUID().toString(); CallActivity callActivity = bpmn2.createCallActivity(); callActivity.setId(id); CaseManagementCustomElement.isCase.of(callActivity).set(Boolean.TRUE); tested = new CaseManagementActivityPropertyReader(callActivity, definitionResolver.getDiagram(), definitionResolver); assertTrue(tested.isCase()); }
@Test public void testCreateReusableSubprocessTaskExecutionSet_case() throws Exception { String id = UUID.randomUUID().toString(); CallActivity callActivity = bpmn2.createCallActivity(); callActivity.setId(id); CaseManagementCustomElement.isCase.of(callActivity).set(Boolean.TRUE); CaseManagementActivityPropertyReader propertyReader = new CaseManagementActivityPropertyReader(callActivity, definitionResolver.getDiagram(), definitionResolver); BaseReusableSubprocessTaskExecutionSet result = tested.createReusableSubprocessTaskExecutionSet(null, null, null, null, null, null, propertyReader); assertTrue(result instanceof CaseReusableSubprocessTaskExecutionSet); assertTrue(((CaseReusableSubprocessTaskExecutionSet) result).getIsCase().getValue()); }
@Test public void testCreateReusableSubprocessTaskExecutionSet_process() throws Exception { String id = UUID.randomUUID().toString(); CallActivity callActivity = bpmn2.createCallActivity(); callActivity.setId(id); CaseManagementCustomElement.isCase.of(callActivity).set(Boolean.FALSE); CaseManagementActivityPropertyReader propertyReader = new CaseManagementActivityPropertyReader(callActivity, definitionResolver.getDiagram(), definitionResolver); BaseReusableSubprocessTaskExecutionSet result = tested.createReusableSubprocessTaskExecutionSet(null, null, null, null, null, null, propertyReader); assertTrue(result instanceof ProcessReusableSubprocessTaskExecutionSet); assertFalse(((ProcessReusableSubprocessTaskExecutionSet) result).getIsCase().getValue()); } }
public PropertyWriter toFlowElement(Node<View<T>, ?> n) { CallActivity activity = bpmn2.createCallActivity(); activity.setId(n.getUUID()); CallActivityPropertyWriter p = propertyWriterFactory.of(activity); T definition = n.getContent().getDefinition(); BPMNGeneralSet general = definition.getGeneral(); p.setName(general.getName().getValue()); p.setDocumentation(general.getDocumentation().getValue()); BaseReusableSubprocessTaskExecutionSet executionSet = definition.getExecutionSet(); p.setOnEntryAction(executionSet.getOnEntryAction()); p.setOnExitAction(executionSet.getOnExitAction()); p.setCalledElement(executionSet.getCalledElement().getValue()); p.setAsync(executionSet.getIsAsync().getValue()); p.setIndependent(executionSet.getIndependent().getValue()); p.setWaitForCompletion(executionSet.getWaitForCompletion().getValue()); p.setAssignmentsInfo(definition.getDataIOSet().getAssignmentsinfo()); p.setSimulationSet(definition.getSimulationSet()); p.setBounds(n.getContent().getBounds()); return p; } }