use of org.kie.workbench.common.stunner.bpmn.definition.property.task.MultipleInstanceCompletionCondition in project kie-wb-common by kiegroup.
the class BaseSubProcessConverter method convertMultiInstanceSubprocessNode.
private BpmnNode convertMultiInstanceSubprocessNode(SubProcess subProcess) {
Node<View<MultipleInstanceSubprocess>, Edge> node = delegate.factoryManager.newNode(subProcess.getId(), MultipleInstanceSubprocess.class);
MultipleInstanceSubprocess definition = node.getContent().getDefinition();
MultipleInstanceSubProcessPropertyReader p = delegate.propertyReaderFactory.ofMultipleInstance(subProcess);
definition.setGeneral(new BPMNGeneralSet(new Name(p.getName()), new Documentation(p.getDocumentation())));
definition.setExecutionSet(new MultipleInstanceSubprocessTaskExecutionSet(new MultipleInstanceExecutionMode(p.isSequential()), new MultipleInstanceCollectionInput(p.getCollectionInput()), new MultipleInstanceCollectionOutput(p.getCollectionOutput()), new MultipleInstanceDataInput(p.getDataInput()), new MultipleInstanceDataOutput(p.getDataOutput()), new MultipleInstanceCompletionCondition(p.getCompletionCondition()), new OnEntryAction(p.getOnEntryAction()), new OnExitAction(p.getOnExitAction()), new IsMultipleInstance(true), new IsAsync(p.isAsync()), new SLADueDate(p.getSlaDueDate())));
definition.setProcessData(new ProcessData(new ProcessVariables(p.getProcessVariables())));
definition.setSimulationSet(p.getSimulationSet());
definition.setAdvancedData(new AdvancedData(p.getMetaDataAttributes()));
definition.setDimensionsSet(p.getRectangleDimensionsSet());
definition.setFontSet(p.getFontSet());
definition.setBackgroundSet(p.getBackgroundSet());
node.getContent().setBounds(p.getBounds());
return BpmnNode.of(node, p);
}
use of org.kie.workbench.common.stunner.bpmn.definition.property.task.MultipleInstanceCompletionCondition in project kie-wb-common by kiegroup.
the class HashCodeAndEqualityTest method testMultipleInstanceSubprocessEquals.
@Test
public void testMultipleInstanceSubprocessEquals() {
final String MULTIPLE_INSTANCE_COLLECTION_INPUT = "multiple Instance collection input";
final String MULTIPLE_INSTANCE_COLLECTION_OUTPUT = "multiple Instance collection output";
final String MULTIPLE_INSTANCE_DATA_INPUT = "multiple Instance collection input";
final String MULTIPLE_INSTANCE_DATA_OUTPUT = "multiple Instance collection output";
final String MULTIPLE_INSTANCE_COMPLETION_CONDITION = "multiple Instance completion condition";
final String OTHER_VALUE = "other value";
final ScriptTypeListValue ON_ENTRY_ACTION = new ScriptTypeListValue().addValue(new ScriptTypeValue("java", ""));
final ScriptTypeListValue ON_EXIT_ACTION = new ScriptTypeListValue().addValue(new ScriptTypeValue("java", ""));
final Boolean IS_ASYNC = true;
final MultipleInstanceSubprocessTaskExecutionSet A_EXECUTION_SET = new MultipleInstanceSubprocessTaskExecutionSet(new MultipleInstanceExecutionMode(), new MultipleInstanceCollectionInput(MULTIPLE_INSTANCE_COLLECTION_INPUT), new MultipleInstanceCollectionOutput(MULTIPLE_INSTANCE_COLLECTION_OUTPUT), new MultipleInstanceDataInput(MULTIPLE_INSTANCE_DATA_INPUT), new MultipleInstanceDataOutput(MULTIPLE_INSTANCE_DATA_OUTPUT), new MultipleInstanceCompletionCondition(MULTIPLE_INSTANCE_COMPLETION_CONDITION), new OnEntryAction(ON_ENTRY_ACTION), new OnExitAction(ON_EXIT_ACTION), new IsMultipleInstance(true), new IsAsync(IS_ASYNC), new SLADueDate());
final MultipleInstanceSubprocessTaskExecutionSet B_EXECUTION_SET = new MultipleInstanceSubprocessTaskExecutionSet(new MultipleInstanceExecutionMode(), new MultipleInstanceCollectionInput(MULTIPLE_INSTANCE_COLLECTION_INPUT), new MultipleInstanceCollectionOutput(MULTIPLE_INSTANCE_COLLECTION_OUTPUT), new MultipleInstanceDataInput(MULTIPLE_INSTANCE_DATA_INPUT), new MultipleInstanceDataOutput(MULTIPLE_INSTANCE_DATA_OUTPUT), new MultipleInstanceCompletionCondition(MULTIPLE_INSTANCE_COMPLETION_CONDITION), new OnEntryAction(ON_ENTRY_ACTION), new OnExitAction(ON_EXIT_ACTION), new IsMultipleInstance(true), new IsAsync(IS_ASYNC), new SLADueDate());
final MultipleInstanceSubprocessTaskExecutionSet C_EXECUTION_SET = new MultipleInstanceSubprocessTaskExecutionSet(new MultipleInstanceExecutionMode(), new MultipleInstanceCollectionInput(OTHER_VALUE), new MultipleInstanceCollectionOutput(MULTIPLE_INSTANCE_COLLECTION_OUTPUT), new MultipleInstanceDataInput(MULTIPLE_INSTANCE_DATA_INPUT), new MultipleInstanceDataOutput(MULTIPLE_INSTANCE_DATA_OUTPUT), new MultipleInstanceCompletionCondition(MULTIPLE_INSTANCE_COMPLETION_CONDITION), new OnEntryAction(ON_ENTRY_ACTION), new OnExitAction(ON_EXIT_ACTION), new IsMultipleInstance(true), new IsAsync(IS_ASYNC), new SLADueDate());
final MultipleInstanceSubprocessTaskExecutionSet D_EXECUTION_SET = new MultipleInstanceSubprocessTaskExecutionSet(new MultipleInstanceExecutionMode(), new MultipleInstanceCollectionInput(MULTIPLE_INSTANCE_COLLECTION_INPUT), new MultipleInstanceCollectionOutput(OTHER_VALUE), new MultipleInstanceDataInput(MULTIPLE_INSTANCE_DATA_INPUT), new MultipleInstanceDataOutput(MULTIPLE_INSTANCE_DATA_OUTPUT), new MultipleInstanceCompletionCondition(MULTIPLE_INSTANCE_COMPLETION_CONDITION), new OnEntryAction(ON_ENTRY_ACTION), new OnExitAction(ON_EXIT_ACTION), new IsMultipleInstance(true), new IsAsync(IS_ASYNC), new SLADueDate());
final MultipleInstanceSubprocessTaskExecutionSet E_EXECUTION_SET = new MultipleInstanceSubprocessTaskExecutionSet(new MultipleInstanceExecutionMode(), new MultipleInstanceCollectionInput(MULTIPLE_INSTANCE_COLLECTION_INPUT), new MultipleInstanceCollectionOutput(MULTIPLE_INSTANCE_COLLECTION_OUTPUT), new MultipleInstanceDataInput(OTHER_VALUE), new MultipleInstanceDataOutput(MULTIPLE_INSTANCE_DATA_OUTPUT), new MultipleInstanceCompletionCondition(MULTIPLE_INSTANCE_COMPLETION_CONDITION), new OnEntryAction(ON_ENTRY_ACTION), new OnExitAction(ON_EXIT_ACTION), new IsMultipleInstance(true), new IsAsync(IS_ASYNC), new SLADueDate());
final MultipleInstanceSubprocessTaskExecutionSet F_EXECUTION_SET = new MultipleInstanceSubprocessTaskExecutionSet(new MultipleInstanceExecutionMode(), new MultipleInstanceCollectionInput(MULTIPLE_INSTANCE_COLLECTION_INPUT), new MultipleInstanceCollectionOutput(MULTIPLE_INSTANCE_COLLECTION_OUTPUT), new MultipleInstanceDataInput(MULTIPLE_INSTANCE_DATA_INPUT), new MultipleInstanceDataOutput(OTHER_VALUE), new MultipleInstanceCompletionCondition(MULTIPLE_INSTANCE_COMPLETION_CONDITION), new OnEntryAction(ON_ENTRY_ACTION), new OnExitAction(ON_EXIT_ACTION), new IsMultipleInstance(true), new IsAsync(IS_ASYNC), new SLADueDate());
final MultipleInstanceSubprocessTaskExecutionSet G_EXECUTION_SET = new MultipleInstanceSubprocessTaskExecutionSet(new MultipleInstanceExecutionMode(), new MultipleInstanceCollectionInput(MULTIPLE_INSTANCE_COLLECTION_INPUT), new MultipleInstanceCollectionOutput(MULTIPLE_INSTANCE_COLLECTION_OUTPUT), new MultipleInstanceDataInput(MULTIPLE_INSTANCE_DATA_INPUT), new MultipleInstanceDataOutput(MULTIPLE_INSTANCE_DATA_OUTPUT), new MultipleInstanceCompletionCondition(OTHER_VALUE), new OnEntryAction(ON_ENTRY_ACTION), new OnExitAction(ON_EXIT_ACTION), new IsMultipleInstance(true), new IsAsync(IS_ASYNC), new SLADueDate());
final MultipleInstanceSubprocessTaskExecutionSet H_EXECUTION_SET = new MultipleInstanceSubprocessTaskExecutionSet(new MultipleInstanceExecutionMode(), new MultipleInstanceCollectionInput(MULTIPLE_INSTANCE_COLLECTION_INPUT), new MultipleInstanceCollectionOutput(MULTIPLE_INSTANCE_COLLECTION_OUTPUT), new MultipleInstanceDataInput(MULTIPLE_INSTANCE_DATA_INPUT), new MultipleInstanceDataOutput(MULTIPLE_INSTANCE_DATA_OUTPUT), new MultipleInstanceCompletionCondition(MULTIPLE_INSTANCE_COMPLETION_CONDITION), new OnEntryAction(new ScriptTypeListValue().addValue(new ScriptTypeValue("other language", ""))), new OnExitAction(ON_EXIT_ACTION), new IsMultipleInstance(true), new IsAsync(IS_ASYNC), new SLADueDate());
final MultipleInstanceSubprocessTaskExecutionSet I_EXECUTION_SET = new MultipleInstanceSubprocessTaskExecutionSet(new MultipleInstanceExecutionMode(), new MultipleInstanceCollectionInput(MULTIPLE_INSTANCE_COLLECTION_INPUT), new MultipleInstanceCollectionOutput(MULTIPLE_INSTANCE_COLLECTION_OUTPUT), new MultipleInstanceDataInput(MULTIPLE_INSTANCE_DATA_INPUT), new MultipleInstanceDataOutput(MULTIPLE_INSTANCE_DATA_OUTPUT), new MultipleInstanceCompletionCondition(MULTIPLE_INSTANCE_COMPLETION_CONDITION), new OnEntryAction(ON_ENTRY_ACTION), new OnExitAction(new ScriptTypeListValue().addValue(new ScriptTypeValue("other language", ""))), new IsMultipleInstance(true), new IsAsync(IS_ASYNC), new SLADueDate());
final MultipleInstanceSubprocessTaskExecutionSet J_EXECUTION_SET = new MultipleInstanceSubprocessTaskExecutionSet(new MultipleInstanceExecutionMode(), new MultipleInstanceCollectionInput(MULTIPLE_INSTANCE_COLLECTION_INPUT), new MultipleInstanceCollectionOutput(MULTIPLE_INSTANCE_COLLECTION_OUTPUT), new MultipleInstanceDataInput(MULTIPLE_INSTANCE_DATA_INPUT), new MultipleInstanceDataOutput(MULTIPLE_INSTANCE_DATA_OUTPUT), new MultipleInstanceCompletionCondition(MULTIPLE_INSTANCE_COMPLETION_CONDITION), new OnEntryAction(ON_ENTRY_ACTION), new OnExitAction(ON_EXIT_ACTION), new IsMultipleInstance(true), new IsAsync(false), new SLADueDate());
final String PROCESS_DATA = "some value";
final ProcessData A_PROCESS_DATA = new ProcessData(new ProcessVariables(PROCESS_DATA));
final ProcessData B_PROCESS_DATA = new ProcessData(new ProcessVariables("Other value"));
MultipleInstanceSubprocess a = new MultipleInstanceSubprocess();
a.setExecutionSet(A_EXECUTION_SET);
a.setProcessData(A_PROCESS_DATA);
MultipleInstanceSubprocess b = new MultipleInstanceSubprocess();
b.setExecutionSet(B_EXECUTION_SET);
b.setProcessData(A_PROCESS_DATA);
MultipleInstanceSubprocess c = new MultipleInstanceSubprocess();
c.setExecutionSet(C_EXECUTION_SET);
MultipleInstanceSubprocess d = new MultipleInstanceSubprocess();
d.setExecutionSet(D_EXECUTION_SET);
MultipleInstanceSubprocess e = new MultipleInstanceSubprocess();
e.setExecutionSet(E_EXECUTION_SET);
MultipleInstanceSubprocess f = new MultipleInstanceSubprocess();
f.setExecutionSet(F_EXECUTION_SET);
MultipleInstanceSubprocess g = new MultipleInstanceSubprocess();
g.setExecutionSet(G_EXECUTION_SET);
MultipleInstanceSubprocess h = new MultipleInstanceSubprocess();
h.setExecutionSet(H_EXECUTION_SET);
MultipleInstanceSubprocess i = new MultipleInstanceSubprocess();
i.setExecutionSet(I_EXECUTION_SET);
MultipleInstanceSubprocess j = new MultipleInstanceSubprocess();
j.setExecutionSet(J_EXECUTION_SET);
assertEquals(a, a);
assertEquals(a, b);
assertNotEquals(a, c);
assertNotEquals(a, d);
assertNotEquals(a, e);
assertNotEquals(a, f);
assertNotEquals(a, g);
assertNotEquals(a, h);
assertNotEquals(a, i);
assertNotEquals(a, j);
assertNotEquals(a, 19);
assertNotEquals(a, null);
a.setExecutionSet(null);
assertNotEquals(a, b);
assertNotEquals(b, a);
a.setExecutionSet(A_EXECUTION_SET);
assertEquals(a, b);
a.setProcessData(null);
assertNotEquals(a, b);
assertNotEquals(b, a);
a.setExecutionSet(A_EXECUTION_SET);
a.setProcessData(A_PROCESS_DATA);
assertEquals(a, b);
a.setProcessData(B_PROCESS_DATA);
assertNotEquals(a, b);
assertNotEquals(b, a);
MultipleInstanceSubprocess k = new MultipleInstanceSubprocess();
assertNotEquals(a, k);
}
use of org.kie.workbench.common.stunner.bpmn.definition.property.task.MultipleInstanceCompletionCondition in project kie-wb-common by kiegroup.
the class ReusableSubprocessConverterTest method setUp.
@Before
public void setUp() {
when(propertyWriterFactory.of(any(CallActivity.class))).thenReturn(propertyWriter);
DataIOSet ioSet = mock(DataIOSet.class);
when(ioSet.getAssignmentsinfo()).thenReturn(ASSIGNMENTS_INFO);
final ReusableSubprocess definition = new ReusableSubprocess(new BPMNGeneralSet(NAME, DOCUMENTATION), new ReusableSubprocessTaskExecutionSet(new CalledElement(CALLED_ELEMENT), new IsCase(IS_CASE), new Independent(INDEPENDENT), new AbortParent(ABORT_PARENT), new WaitForCompletion(WAIT_FOR_COMPLETION), new IsAsync(IS_ASYNC), new AdHocAutostart(IS_ADHOC_AUTOSTART), new IsMultipleInstance(IS_MULTIPLE_INSTANCE), new MultipleInstanceExecutionMode(SEQUENTIAL), new MultipleInstanceCollectionInput(COLLECTION_INPUT), new MultipleInstanceDataInput(DATA_INPUT), new MultipleInstanceCollectionOutput(COLLECTION_OUTPUT), new MultipleInstanceDataOutput(DATA_OUTPUT), new MultipleInstanceCompletionCondition(COMPLETION_CONDITION), ON_ENTRY_ACTION, ON_EXIT_ACTION, new SLADueDate(SLA_DUE_DATE)), ioSet, new BackgroundSet(), new FontSet(), new RectangleDimensionsSet(), SIMULATION_SET, new AdvancedData());
final View<BaseReusableSubprocess> view = new ViewImpl<>(definition, BOUNDS);
node = new NodeImpl<>(UUID);
node.setContent(view);
converter = new ReusableSubprocessConverter(propertyWriterFactory);
}
use of org.kie.workbench.common.stunner.bpmn.definition.property.task.MultipleInstanceCompletionCondition in project kie-wb-common by kiegroup.
the class ClientBPMNDocumentationServiceTest method setUp.
@Before
@SuppressWarnings("all")
public void setUp() throws Exception {
// DiagramSet
processName = new Name(PROCESS_NAME);
processDocumentation = new Documentation(PROCESS_DOCUMENTATION);
packageProperty = new Package(PROCESS_PACKAGE);
type = new ProcessType();
version = new Version(PROCESS_VERSION);
adHoc = new AdHoc(PROCESS_IS_ADHOC);
processInstanceDescription = new ProcessInstanceDescription(PROCESS_DECRIPTION);
executable = new Executable(PROCESS_IS_EXECUTABLE);
processId = new Id(PROCESS_UUID);
globalVariables = new GlobalVariables(GLOBAL_VARIABLES);
metaDataAttributes = new MetaDataAttributes(METADATA);
slaDueDate = new SLADueDate(SLA_DUE_DATE);
ImportsValue importsValue = new ImportsValue();
importsValue.addImport(new DefaultImport(CLASS_NAME + "1"));
importsValue.addImport(new DefaultImport(CLASS_NAME + "2"));
importsValue.addImport(new DefaultImport(CLASS_NAME + "3"));
importsValue.addImport(new WSDLImport(LOCATION + "1", NAMESPACE + "1"));
importsValue.addImport(new WSDLImport(LOCATION + "2", NAMESPACE + "2"));
importsValue.addImport(new WSDLImport(LOCATION + "3", NAMESPACE + "3"));
importsValue.addImport(new WSDLImport(LOCATION + "4", NAMESPACE + "4"));
imports = new Imports(importsValue);
diagramSet = new DiagramSet(processName, processDocumentation, processId, packageProperty, type, version, adHoc, processInstanceDescription, imports, executable, slaDueDate);
// ProcessData
processVariables = new ProcessVariables(VARIABLES);
processData = new ProcessData(processVariables);
// AdvancedData
globalVariables = new GlobalVariables(GLOBAL_VARIABLES);
metaDataAttributes = new MetaDataAttributes(METADATA);
advancedData = new RootProcessAdvancedData(globalVariables, metaDataAttributes);
bpmnDiagram = new BPMNDiagramImpl(diagramSet, processData, new CaseManagementSet(), new BackgroundSet(), new FontSet(), new RectangleDimensionsSet(), advancedData);
userTask = new UserTask(new TaskGeneralSet(new Name(TASK_NAME), new Documentation(TASK_DOC)), new UserTaskExecutionSet(new TaskName(TASK_NAME), new Actors(), new Groupid(TASK_GROUPID), new AssignmentsInfo(), new NotificationsInfo(), new ReassignmentsInfo(), new IsAsync(true), new Skippable(), new TaskPriority(TASK_PRIORITY), new Subject(TASK_SUBJECT), new Description(TASK_DESCRIPTION), new CreatedBy(), new AdHocAutostart(true), new IsMultipleInstance(false), new MultipleInstanceExecutionMode(), new MultipleInstanceCollectionInput(), new MultipleInstanceDataInput(), new MultipleInstanceCollectionOutput(), new MultipleInstanceDataOutput(), new MultipleInstanceCompletionCondition(), new OnEntryAction(new ScriptTypeListValue().addValue(new ScriptTypeValue())), new OnExitAction(new ScriptTypeListValue().addValue(new ScriptTypeValue())), new Content(), new SLADueDate()), new BackgroundSet(), new FontSet(), new RectangleDimensionsSet(), new SimulationSet(), new TaskType(TaskTypes.USER), new AdvancedData());
embeddedSubprocess = new EmbeddedSubprocess(new BPMNGeneralSet(new Name(SUB_PROCESS_NAME), new Documentation(SUB_PROCESS_DOCUMENTATION)), new BackgroundSet(), new FontSet(), new RectangleDimensionsSet(), new SimulationSet(), new AdvancedData(), new EmbeddedSubprocessExecutionSet(new OnEntryAction(new ScriptTypeListValue().addValue(new ScriptTypeValue(LANGUAGE, SCRIPT))), new OnExitAction(new ScriptTypeListValue().addValue(new ScriptTypeValue(LANGUAGE, SCRIPT))), new IsAsync(false), new SLADueDate()), new ProcessData(SUB_PROCESS_VARIABLES));
nodes = Arrays.asList(createNode(bpmnDiagram), createNode(userTask), createNode(embeddedSubprocess));
when(diagram.getGraph()).thenReturn(graph);
when(graph.nodes()).thenReturn(nodes);
when(mustacheTemplateRenderer.render(eq(TEMPLATE), any(BPMNDocumentation.class))).thenReturn(RENDERED_DOC);
when(decorators.getDecorator(anyString())).thenReturn(Optional.empty());
// adapters mock
when(definitionManager.adapters()).thenReturn(adapters);
AdapterRegistry adapterRegistry = mock(AdapterRegistry.class);
when(adapterRegistry.getDefinitionAdapter(any())).thenReturn(definitionAdapter);
when(adapters.registry()).thenReturn(adapterRegistry);
when(adapters.forDefinition()).thenReturn(definitionAdapter);
when(adapters.forDefinitionSet()).thenReturn(definitionSetAdapter);
when(adapters.forProperty()).thenReturn(propertyAdapter);
when(definitionAdapter.getId(userTask)).thenReturn(userTaskId);
when(definitionAdapter.getId(embeddedSubprocess)).thenReturn(subprocessId);
when(definitionUtils.getName(bpmnDiagram)).thenReturn(PROCESS_NAME);
when(definitionUtils.getName(userTask)).thenReturn(TASK_NAME);
when(definitionUtils.getTitle(userTask.getClass().getName())).thenReturn(TASK_NAME);
when(definitionUtils.getName(embeddedSubprocess)).thenReturn(SUB_PROCESS_NAME);
when(definitionUtils.getTitle(embeddedSubprocess.getClass().getName())).thenReturn(SUB_PROCESS_NAME);
// mock icons
glyphProvider = (defId) -> glyphIcon;
when(categoryDefinitionProvider.glyphProvider()).thenReturn(glyphProvider);
when(glyphRenderer.render(eq(glyphIcon), anyDouble(), anyDouble())).thenReturn(iconElement);
when(iconElement.getElement()).thenReturn(iconHTMLElement);
when(iconHTMLElement.getInnerHTML()).thenReturn(ICON_HTML);
when(shapeFactory.getGlyph(anyString())).thenReturn(imageStripGlyph);
when(glyphRenderer.render(eq(imageStripGlyph), anyDouble(), anyDouble())).thenReturn(iconElement);
when(userTaskId.value()).thenReturn(UserTask.class.getName());
when(subprocessId.value()).thenReturn(EmbeddedSubprocess.class.getName());
// adapters mock for task
final TaskGeneralSet taskGeneral = userTask.getGeneral();
final UserTaskExecutionSet taskExecutionSet = userTask.getExecutionSet();
when(definitionAdapter.getCategory(eq(userTask))).thenReturn(BPMNCategories.ACTIVITIES);
when(definitionAdapter.getPropertyFields(eq(userTask))).thenReturn(new String[] { "taskGeneral.documentation", "taskGeneral.name", "taskExecutionSet.subject", "taskExecutionSet.groupId", "taskExecutionSet.priority", "taskExecutionSet.assignmentsInfo", "taskExecutionSet.description" });
when(definitionAdapter.getProperty(eq(userTask), eq("taskGeneral.documentation"))).thenReturn((Optional) Optional.of(taskGeneral.getDocumentation()));
when(definitionAdapter.getProperty(eq(userTask), eq("taskGeneral.name"))).thenReturn((Optional) Optional.of(taskGeneral.getName()));
when(definitionAdapter.getProperty(eq(userTask), eq("taskExecutionSet.subject"))).thenReturn((Optional) Optional.of(taskExecutionSet.getSubject()));
when(definitionAdapter.getProperty(eq(userTask), eq("taskExecutionSet.groupId"))).thenReturn((Optional) Optional.of(taskExecutionSet.getGroupid()));
when(definitionAdapter.getProperty(eq(userTask), eq("taskExecutionSet.priority"))).thenReturn((Optional) Optional.of(taskExecutionSet.getPriority()));
when(definitionAdapter.getProperty(eq(userTask), eq("taskExecutionSet.assignmentsInfo"))).thenReturn((Optional) Optional.of(taskExecutionSet.getAssignmentsinfo()));
when(definitionAdapter.getProperty(eq(userTask), eq("taskExecutionSet.description"))).thenReturn((Optional) Optional.of(taskExecutionSet.getDescription()));
mockProperty(taskGeneral.getDocumentation(), TASK_DOCUMENTATION, DOCUMENTATION_CAPTION);
mockProperty(taskGeneral, TASK_NAME, NAME_CAPTION);
mockProperty(taskExecutionSet.getSubject(), TASK_SUBJECT, SUBJECT_CAPTION);
mockProperty(taskExecutionSet.getGroupid(), TASK_GROUPID, GROUP_CAPTION);
mockProperty(taskExecutionSet.getPriority(), TASK_PRIORITY, PRIORITY_CAPTION);
mockProperty(taskExecutionSet.getDescription(), TASK_DESCRIPTION, DESCRIPTION_CAPTION);
mockProperty(taskExecutionSet.getAssignmentsinfo(), "", ASSIGNEMNTS_CAPTION);
when(decorators.getDecorator(taskExecutionSet.getAssignmentsinfo())).thenReturn(Optional.of(() -> ASSIGNEMNTS));
// adapters mock for subprocess
final BPMNGeneralSet subprocessGeneral = embeddedSubprocess.getGeneral();
final EmbeddedSubprocessExecutionSet subprocessExecutionSet = embeddedSubprocess.getExecutionSet();
when(definitionAdapter.getCategory(eq(embeddedSubprocess))).thenReturn(BPMNCategories.SUB_PROCESSES);
when(definitionAdapter.getPropertyFields(eq(embeddedSubprocess))).thenReturn(new String[] { "subprocessGeneral.documentation", "subprocessGeneral.name", "subprocessExecutionSet.onEntryAction", "subprocessExecutionSet.onExitAction", "subprocessExecutionSet.isAsync" });
when(definitionAdapter.getProperty(eq(embeddedSubprocess), eq("subprocessGeneral.documentation"))).thenReturn((Optional) Optional.of(subprocessGeneral.getDocumentation()));
when(definitionAdapter.getProperty(eq(embeddedSubprocess), eq("subprocessGeneral.name"))).thenReturn((Optional) Optional.of(subprocessGeneral.getName()));
when(definitionAdapter.getProperty(eq(embeddedSubprocess), eq("subprocessExecutionSet.onEntryAction"))).thenReturn((Optional) Optional.of(subprocessExecutionSet.getOnEntryAction()));
when(definitionAdapter.getProperty(eq(embeddedSubprocess), eq("subprocessExecutionSet.onExitAction"))).thenReturn((Optional) Optional.of(subprocessExecutionSet.getOnExitAction()));
when(definitionAdapter.getProperty(eq(embeddedSubprocess), eq("subprocessExecutionSet.isAsync"))).thenReturn((Optional) Optional.of(subprocessExecutionSet.getIsAsync()));
mockProperty(subprocessGeneral.getDocumentation(), SUB_PROCESS_DOCUMENTATION, DOCUMENTATION_CAPTION);
mockProperty(subprocessGeneral, SUB_PROCESS_NAME, NAME_CAPTION);
mockProperty(subprocessExecutionSet.getOnEntryAction(), ON_ENTRY_ACTION, ON_ENTRY_CAPTION);
mockProperty(subprocessExecutionSet.getOnExitAction(), ON_EXIT_ACTION, ON_EXIT_CAPTION);
mockProperty(subprocessExecutionSet.getIsAsync(), "false", ISASYNC_CAPTION);
tested = new ClientBPMNDocumentationService(mustacheTemplateRenderer, definitionManager, definitionUtils, shapeFactory, canvasFileExport, sessionManager, categoryDefinitionProvider, glyphRenderer, translationService, null, decorators);
}
use of org.kie.workbench.common.stunner.bpmn.definition.property.task.MultipleInstanceCompletionCondition in project kie-wb-common by kiegroup.
the class BaseTaskConverter method bpmnServiceTask.
BpmnNode bpmnServiceTask(org.eclipse.bpmn2.ServiceTask task) {
Node<View<GenericServiceTask>, Edge> node = factoryManager.newNode(task.getId(), GenericServiceTask.class);
GenericServiceTask definition = node.getContent().getDefinition();
GenericServiceTaskPropertyReader p = propertyReaderFactory.of(task);
if (p == null) {
throw new NullPointerException(task.getClass().getCanonicalName());
}
definition.setGeneral(new TaskGeneralSet(new Name(p.getName()), new Documentation(p.getDocumentation())));
definition.setExecutionSet(new GenericServiceTaskExecutionSet(new GenericServiceTaskInfo(p.getGenericServiceTask()), p.getAssignmentsInfo(), new AdHocAutostart(p.isAdHocAutostart()), new IsAsync(p.isAsync()), new IsMultipleInstance(p.isMultipleInstance()), new MultipleInstanceExecutionMode(p.isSequential()), new MultipleInstanceCollectionInput(p.getCollectionInput()), new MultipleInstanceDataInput(p.getDataInput()), new MultipleInstanceCollectionOutput(p.getCollectionOutput()), new MultipleInstanceDataOutput(p.getDataOutput()), new MultipleInstanceCompletionCondition(p.getCompletionCondition()), new OnEntryAction(p.getOnEntryAction()), new OnExitAction(p.getOnExitAction()), new SLADueDate(p.getSLADueDate())));
node.getContent().setBounds(p.getBounds());
definition.setDimensionsSet(p.getRectangleDimensionsSet());
definition.setBackgroundSet(p.getBackgroundSet());
definition.setFontSet(p.getFontSet());
definition.setSimulationSet(p.getSimulationSet());
definition.setAdvancedData(new AdvancedData(p.getMetaDataAttributes()));
return BpmnNode.of(node, p);
}
Aggregations