use of org.kie.workbench.common.stunner.bpmn.definition.property.task.IsMultipleInstance 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);
}
use of org.kie.workbench.common.stunner.bpmn.definition.property.task.IsMultipleInstance in project kie-wb-common by kiegroup.
the class TaskConverterPriorityTest method setPriorityEscapeSpecialChars.
@Test
public void setPriorityEscapeSpecialChars() {
propertyWriterFactory = new PropertyWriterFactory();
taskConverter = spy(new TaskConverter(propertyWriterFactory));
when(n.getContent()).thenReturn(view);
when(view.getBounds()).thenReturn(Bounds.create(0, 0, 10, 10));
when(view.getDefinition()).thenReturn(definition);
when(general.getName()).thenReturn(new Name("Name"));
when(general.getDocumentation()).thenReturn(new Documentation());
when(definition.getGeneral()).thenReturn(general);
when(definition.getSimulationSet()).thenReturn(new SimulationSet());
when(definition.getExecutionSet()).thenReturn(baseUserTaskExecutionSet);
when(baseUserTaskExecutionSet.getTaskName()).thenReturn(new TaskName("taskName"));
when(baseUserTaskExecutionSet.getActors()).thenReturn(new Actors());
when(baseUserTaskExecutionSet.getAssignmentsinfo()).thenReturn(new AssignmentsInfo());
when(baseUserTaskExecutionSet.getReassignmentsInfo()).thenReturn(new ReassignmentsInfo());
when(baseUserTaskExecutionSet.getNotificationsInfo()).thenReturn(new NotificationsInfo());
when(baseUserTaskExecutionSet.getSkippable()).thenReturn(new Skippable(true));
when(baseUserTaskExecutionSet.getGroupid()).thenReturn(new Groupid("groupId"));
when(baseUserTaskExecutionSet.getSubject()).thenReturn(new Subject());
when(baseUserTaskExecutionSet.getDescription()).thenReturn(new Description());
when(baseUserTaskExecutionSet.getPriority()).thenReturn(new TaskPriority("#{varOne<>&\"}"));
when(baseUserTaskExecutionSet.getIsAsync()).thenReturn(new IsAsync(true));
when(baseUserTaskExecutionSet.getCreatedBy()).thenReturn(new CreatedBy());
when(baseUserTaskExecutionSet.getAdHocAutostart()).thenReturn(new AdHocAutostart());
when(baseUserTaskExecutionSet.getIsMultipleInstance()).thenReturn(new IsMultipleInstance(false));
when(baseUserTaskExecutionSet.getOnEntryAction()).thenReturn(new OnEntryAction(new ScriptTypeListValue().addValue(new ScriptTypeValue("java", ""))));
when(baseUserTaskExecutionSet.getOnExitAction()).thenReturn(new OnExitAction(new ScriptTypeListValue().addValue(new ScriptTypeValue("java", ""))));
when(baseUserTaskExecutionSet.getContent()).thenReturn(new Content());
when(baseUserTaskExecutionSet.getSlaDueDate()).thenReturn(new SLADueDate());
when(definition.getAdvancedData()).thenReturn(new AdvancedData(new MetaDataAttributes()));
doCallRealMethod().when(taskConverter).userTask(any());
final UserTaskPropertyWriter propertyWriter = (UserTaskPropertyWriter) taskConverter.userTask(n);
assertTrue(propertyWriter.getPriority().equals("<![CDATA[#{varOne<>&"}]]>"));
}
use of org.kie.workbench.common.stunner.bpmn.definition.property.task.IsMultipleInstance 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.IsMultipleInstance in project kie-wb-common by kiegroup.
the class GenericServiceTaskExecutionSetTest method testEqualFalse.
@Test
public void testEqualFalse() {
GenericServiceTaskExecutionSet a = new GenericServiceTaskExecutionSet();
GenericServiceTaskExecutionSet b = new GenericServiceTaskExecutionSet();
a.setGenericServiceTaskInfo(null);
assertNotEquals(a, b);
GenericServiceTaskExecutionSet c = new GenericServiceTaskExecutionSet(new GenericServiceTaskInfo(), new AssignmentsInfo(), new AdHocAutostart(), new IsAsync(), new IsMultipleInstance(false), new MultipleInstanceExecutionMode(false), new MultipleInstanceCollectionInput(), new MultipleInstanceDataInput(), new MultipleInstanceCollectionOutput(), new MultipleInstanceDataOutput(), new MultipleInstanceCompletionCondition(), new OnEntryAction(new ScriptTypeListValue().addValue(new ScriptTypeValue("java", ""))), new OnExitAction(new ScriptTypeListValue().addValue(new ScriptTypeValue("java", ""))), new SLADueDate(SLA_DUE_DATE_1));
GenericServiceTaskExecutionSet d = new GenericServiceTaskExecutionSet(new GenericServiceTaskInfo(), new AssignmentsInfo(), new AdHocAutostart(), new IsAsync(), new IsMultipleInstance(false), new MultipleInstanceExecutionMode(false), new MultipleInstanceCollectionInput(), new MultipleInstanceDataInput(), new MultipleInstanceCollectionOutput(), new MultipleInstanceDataOutput(), new MultipleInstanceCompletionCondition(), new OnEntryAction(new ScriptTypeListValue().addValue(new ScriptTypeValue("java", ""))), new OnExitAction(new ScriptTypeListValue().addValue(new ScriptTypeValue("java", ""))), new SLADueDate(SLA_DUE_DATE_2));
assertNotEquals(c, d);
}
use of org.kie.workbench.common.stunner.bpmn.definition.property.task.IsMultipleInstance in project kie-wb-common by kiegroup.
the class GenericServiceTaskExecutionSetTest method testHashCode.
@Test
public void testHashCode() {
GenericServiceTaskExecutionSet a = new GenericServiceTaskExecutionSet();
GenericServiceTaskExecutionSet b = new GenericServiceTaskExecutionSet();
assertEquals(a.hashCode(), b.hashCode());
GenericServiceTaskExecutionSet c = new GenericServiceTaskExecutionSet(new GenericServiceTaskInfo(), new AssignmentsInfo(), new AdHocAutostart(), new IsAsync(), new IsMultipleInstance(false), new MultipleInstanceExecutionMode(false), new MultipleInstanceCollectionInput(), new MultipleInstanceDataInput(), new MultipleInstanceCollectionOutput(), new MultipleInstanceDataOutput(), new MultipleInstanceCompletionCondition(), new OnEntryAction(new ScriptTypeListValue().addValue(new ScriptTypeValue("java", ""))), new OnExitAction(new ScriptTypeListValue().addValue(new ScriptTypeValue("java", ""))), new SLADueDate(SLA_DUE_DATE_1));
GenericServiceTaskExecutionSet d = new GenericServiceTaskExecutionSet(new GenericServiceTaskInfo(), new AssignmentsInfo(), new AdHocAutostart(), new IsAsync(), new IsMultipleInstance(false), new MultipleInstanceExecutionMode(false), new MultipleInstanceCollectionInput(), new MultipleInstanceDataInput(), new MultipleInstanceCollectionOutput(), new MultipleInstanceDataOutput(), new MultipleInstanceCompletionCondition(), new OnEntryAction(new ScriptTypeListValue().addValue(new ScriptTypeValue("java", ""))), new OnExitAction(new ScriptTypeListValue().addValue(new ScriptTypeValue("java", ""))), new SLADueDate(SLA_DUE_DATE_1));
assertEquals(c.hashCode(), d.hashCode());
}
Aggregations