@Test public void testToFlowElement_process() { final BaseReusableSubprocess definition = new ReusableSubprocess(); final View<BaseReusableSubprocess> view = new ViewImpl<>(definition, Bounds.create()); final Node<View<BaseReusableSubprocess>, ?> node = new NodeImpl<>(java.util.UUID.randomUUID().toString()); node.setContent(view); final PropertyWriter propertyWriter = tested.toFlowElement(node); assertTrue(CallActivityPropertyWriter.class.isInstance(propertyWriter)); assertFalse(CustomElement.isCase.of(propertyWriter.getFlowElement()).get()); }
public PropertyWriter toFlowElement(Node<View<BaseReusableSubprocess>, ?> n) { CallActivity activity = bpmn2.createCallActivity(); activity.setId(n.getUUID()); CallActivityPropertyWriter p = propertyWriterFactory.of(activity); BaseReusableSubprocess 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(replaceIllegalCharsAttribute(executionSet.getCalledElement().getValue())); p.setAsync(executionSet.getIsAsync().getValue()); p.setIndependent(executionSet.getIndependent().getValue()); if (Boolean.FALSE.equals(executionSet.getIndependent().getValue())) { p.setAbortParent(executionSet.getAbortParent().getValue()); } p.setWaitForCompletion(executionSet.getWaitForCompletion().getValue()); p.setSlaDueDate(executionSet.getSlaDueDate()); p.setAssignmentsInfo(definition.getDataIOSet().getAssignmentsinfo()); if (Boolean.TRUE.equals(executionSet.getIsMultipleInstance().getValue())) { p.setIsSequential(executionSet.getMultipleInstanceExecutionMode().isSequential()); p.setCollectionInput(executionSet.getMultipleInstanceCollectionInput().getValue()); p.setInput(executionSet.getMultipleInstanceDataInput().getValue()); p.setCollectionOutput(executionSet.getMultipleInstanceCollectionOutput().getValue()); p.setOutput(executionSet.getMultipleInstanceDataOutput().getValue()); p.setCompletionCondition(executionSet.getMultipleInstanceCompletionCondition().getValue()); } p.setSimulationSet(definition.getSimulationSet()); p.setAbsoluteBounds(n); p.setCase(executionSet.getIsCase().getValue()); p.setAdHocAutostart(executionSet.getAdHocAutostart().getValue()); return p; }
ReusableSubprocessConverter { public PropertyWriter toFlowElement(Node<View<BaseReusableSubprocess>, ?> n) { CallActivity activity = bpmn2.createCallActivity(); activity.setId(n.getUUID()); CallActivityPropertyWriter p = propertyWriterFactory.of(activity); BaseReusableSubprocess 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(replaceIllegalCharsAttribute(executionSet.getCalledElement().getValue())); p.setAsync(executionSet.getIsAsync().getValue()); p.setIndependent(executionSet.getIndependent().getValue()); if (Boolean.FALSE.equals(executionSet.getIndependent().getValue())) { p.setAbortParent(executionSet.getAbortParent().getValue()); } p.setWaitForCompletion(executionSet.getWaitForCompletion().getValue()); p.setSlaDueDate(executionSet.getSlaDueDate()); p.setAssignmentsInfo(definition.getDataIOSet().getAssignmentsinfo()); if (Boolean.TRUE.equals(executionSet.getIsMultipleInstance().getValue())) { p.setIsSequential(executionSet.getMultipleInstanceExecutionMode().isSequential()); p.setCollectionInput(executionSet.getMultipleInstanceCollectionInput().getValue()); p.setInput(executionSet.getMultipleInstanceDataInput().getValue()); p.setCollectionOutput(executionSet.getMultipleInstanceCollectionOutput().getValue()); p.setOutput(executionSet.getMultipleInstanceDataOutput().getValue()); p.setCompletionCondition(executionSet.getMultipleInstanceCompletionCondition().getValue()); } p.setSimulationSet(definition.getSimulationSet()); p.setAbsoluteBounds(n); p.setCase(executionSet.getIsCase().getValue()); p.setAdHocAutostart(executionSet.getAdHocAutostart().getValue()); return p; } }
ReusableSubprocessConverter { public PropertyWriter toFlowElement(Node<View<BaseReusableSubprocess>, ?> n) { CallActivity activity = bpmn2.createCallActivity(); activity.setId(n.getUUID()); CallActivityPropertyWriter p = propertyWriterFactory.of(activity); BaseReusableSubprocess 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(replaceIllegalCharsAttribute(executionSet.getCalledElement().getValue())); p.setAsync(executionSet.getIsAsync().getValue()); p.setIndependent(executionSet.getIndependent().getValue()); if (Boolean.FALSE.equals(executionSet.getIndependent().getValue())) { p.setAbortParent(executionSet.getAbortParent().getValue()); } p.setWaitForCompletion(executionSet.getWaitForCompletion().getValue()); p.setSlaDueDate(executionSet.getSlaDueDate()); p.setAssignmentsInfo(definition.getDataIOSet().getAssignmentsinfo()); if (Boolean.TRUE.equals(executionSet.getIsMultipleInstance().getValue())) { p.setIsSequential(executionSet.getMultipleInstanceExecutionMode().isSequential()); p.setCollectionInput(executionSet.getMultipleInstanceCollectionInput().getValue()); p.setInput(executionSet.getMultipleInstanceDataInput().getValue()); p.setCollectionOutput(executionSet.getMultipleInstanceCollectionOutput().getValue()); p.setOutput(executionSet.getMultipleInstanceDataOutput().getValue()); p.setCompletionCondition(executionSet.getMultipleInstanceCompletionCondition().getValue()); } p.setSimulationSet(definition.getSimulationSet()); p.setAbsoluteBounds(n); p.setCase(executionSet.getIsCase().getValue()); p.setAdHocAutostart(executionSet.getAdHocAutostart().getValue()); return p; } ReusableSubprocessConverter(PropertyWriterFactory propertyWriterFactory); }
ReusableSubprocessConverter { public PropertyWriter toFlowElement(Node<View<BaseReusableSubprocess>, ?> n) { CallActivity activity = bpmn2.createCallActivity(); activity.setId(n.getUUID()); CallActivityPropertyWriter p = propertyWriterFactory.of(activity); BaseReusableSubprocess 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(replaceIllegalCharsAttribute(executionSet.getCalledElement().getValue())); p.setAsync(executionSet.getIsAsync().getValue()); p.setIndependent(executionSet.getIndependent().getValue()); if (Boolean.FALSE.equals(executionSet.getIndependent().getValue())) { p.setAbortParent(executionSet.getAbortParent().getValue()); } p.setWaitForCompletion(executionSet.getWaitForCompletion().getValue()); p.setSlaDueDate(executionSet.getSlaDueDate()); p.setAssignmentsInfo(definition.getDataIOSet().getAssignmentsinfo()); if (Boolean.TRUE.equals(executionSet.getIsMultipleInstance().getValue())) { p.setIsSequential(executionSet.getMultipleInstanceExecutionMode().isSequential()); p.setCollectionInput(executionSet.getMultipleInstanceCollectionInput().getValue()); p.setInput(executionSet.getMultipleInstanceDataInput().getValue()); p.setCollectionOutput(executionSet.getMultipleInstanceCollectionOutput().getValue()); p.setOutput(executionSet.getMultipleInstanceDataOutput().getValue()); p.setCompletionCondition(executionSet.getMultipleInstanceCompletionCondition().getValue()); } p.setSimulationSet(definition.getSimulationSet()); p.setAbsoluteBounds(n); p.setCase(executionSet.getIsCase().getValue()); p.setAdHocAutostart(executionSet.getAdHocAutostart().getValue()); return p; } ReusableSubprocessConverter(PropertyWriterFactory propertyWriterFactory); PropertyWriter toFlowElement(Node<View<BaseReusableSubprocess>, ?> n); }
ReusableSubprocessConverter { public PropertyWriter toFlowElement(Node<View<BaseReusableSubprocess>, ?> n) { CallActivity activity = bpmn2.createCallActivity(); activity.setId(n.getUUID()); CallActivityPropertyWriter p = propertyWriterFactory.of(activity); BaseReusableSubprocess 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(replaceIllegalCharsAttribute(executionSet.getCalledElement().getValue())); p.setAsync(executionSet.getIsAsync().getValue()); p.setIndependent(executionSet.getIndependent().getValue()); if (Boolean.FALSE.equals(executionSet.getIndependent().getValue())) { p.setAbortParent(executionSet.getAbortParent().getValue()); } p.setWaitForCompletion(executionSet.getWaitForCompletion().getValue()); p.setSlaDueDate(executionSet.getSlaDueDate()); p.setAssignmentsInfo(definition.getDataIOSet().getAssignmentsinfo()); if (Boolean.TRUE.equals(executionSet.getIsMultipleInstance().getValue())) { p.setIsSequential(executionSet.getMultipleInstanceExecutionMode().isSequential()); p.setCollectionInput(executionSet.getMultipleInstanceCollectionInput().getValue()); p.setInput(executionSet.getMultipleInstanceDataInput().getValue()); p.setCollectionOutput(executionSet.getMultipleInstanceCollectionOutput().getValue()); p.setOutput(executionSet.getMultipleInstanceDataOutput().getValue()); p.setCompletionCondition(executionSet.getMultipleInstanceCompletionCondition().getValue()); } p.setSimulationSet(definition.getSimulationSet()); p.setAbsoluteBounds(n); p.setCase(executionSet.getIsCase().getValue()); p.setAdHocAutostart(executionSet.getAdHocAutostart().getValue()); return p; } ReusableSubprocessConverter(PropertyWriterFactory propertyWriterFactory); PropertyWriter toFlowElement(Node<View<BaseReusableSubprocess>, ?> n);  }