use of org.kie.workbench.common.stunner.bpmn.definition.BaseUserTask in project kie-wb-common by kiegroup.
the class VariableUtilsTest method mockUserTask.
private BaseUserTask mockUserTask(String name, String assignmentsInfoValue, String inputCollection, String outputCollection) {
UserTask result = mock(UserTask.class);
TaskGeneralSet generalSet = mockTaskGeneralSet(name);
when(result.getGeneral()).thenReturn(generalSet);
UserTaskExecutionSet executionSet = mock(UserTaskExecutionSet.class);
when(result.getExecutionSet()).thenReturn(executionSet);
AssignmentsInfo assignmentsInfo = mockAssignmentsInfo(assignmentsInfoValue);
when(executionSet.getAssignmentsinfo()).thenReturn(assignmentsInfo);
IsMultipleInstance isMultipleInstance = mock(IsMultipleInstance.class);
when(isMultipleInstance.getValue()).thenReturn(true);
MultipleInstanceCollectionInput miInputCollection = mock(MultipleInstanceCollectionInput.class);
when(miInputCollection.getValue()).thenReturn(inputCollection);
MultipleInstanceDataInput miDataInput = mock(MultipleInstanceDataInput.class);
MultipleInstanceCollectionOutput miOutputCollection = mock(MultipleInstanceCollectionOutput.class);
MultipleInstanceDataOutput miDataOutput = mock(MultipleInstanceDataOutput.class);
when(miOutputCollection.getValue()).thenReturn(outputCollection);
when(executionSet.getIsMultipleInstance()).thenReturn(isMultipleInstance);
when(executionSet.getMultipleInstanceCollectionInput()).thenReturn(miInputCollection);
when(executionSet.getMultipleInstanceDataInput()).thenReturn(miDataInput);
when(executionSet.getMultipleInstanceCollectionOutput()).thenReturn(miOutputCollection);
when(executionSet.getMultipleInstanceDataOutput()).thenReturn(miDataOutput);
return result;
}
use of org.kie.workbench.common.stunner.bpmn.definition.BaseUserTask in project kie-wb-common by kiegroup.
the class TaskConverter method userTask.
public PropertyWriter userTask(Node<View<BaseUserTask>, ?> n) {
org.eclipse.bpmn2.UserTask task = bpmn2.createUserTask();
task.setId(n.getUUID());
BaseUserTask definition = n.getContent().getDefinition();
UserTaskPropertyWriter p = propertyWriterFactory.of(task);
TaskGeneralSet general = definition.getGeneral();
p.setName(general.getName().getValue());
p.setDocumentation(general.getDocumentation().getValue());
p.setSimulationSet(definition.getSimulationSet());
BaseUserTaskExecutionSet executionSet = definition.getExecutionSet();
p.setTaskName(executionSet.getTaskName().getValue());
p.setActors(executionSet.getActors());
p.setAssignmentsInfo(executionSet.getAssignmentsinfo());
p.setReassignments(executionSet.getReassignmentsInfo());
p.setNotifications(executionSet.getNotificationsInfo());
p.setSkippable(executionSet.getSkippable().getValue());
p.setGroupId(executionSet.getGroupid().getValue());
p.setSubject(executionSet.getSubject().getValue());
p.setDescription(executionSet.getDescription().getValue());
p.setPriority(StringUtils.replaceIllegalCharsAttribute(executionSet.getPriority().getValue()));
p.setAsync(executionSet.getIsAsync().getValue());
p.setCreatedBy(executionSet.getCreatedBy().getValue());
p.setAdHocAutostart(executionSet.getAdHocAutostart().getValue());
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.setOnEntryAction(executionSet.getOnEntryAction());
p.setOnExitAction(executionSet.getOnExitAction());
p.setContent(executionSet.getContent().getValue());
p.setSLADueDate(executionSet.getSlaDueDate().getValue());
p.setMetaData(definition.getAdvancedData().getMetaDataAttributes());
p.setAbsoluteBounds(n);
return p;
}
Aggregations