Search in sources :

Example 1 with BaseUserTask

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;
}
Also used : UserTaskExecutionSet(org.kie.workbench.common.stunner.bpmn.definition.property.task.UserTaskExecutionSet) AssignmentsInfo(org.kie.workbench.common.stunner.bpmn.definition.property.dataio.AssignmentsInfo) UserTask(org.kie.workbench.common.stunner.bpmn.definition.UserTask) BaseUserTask(org.kie.workbench.common.stunner.bpmn.definition.BaseUserTask) IsMultipleInstance(org.kie.workbench.common.stunner.bpmn.definition.property.task.IsMultipleInstance) MultipleInstanceCollectionOutput(org.kie.workbench.common.stunner.bpmn.definition.property.task.MultipleInstanceCollectionOutput) TaskGeneralSet(org.kie.workbench.common.stunner.bpmn.definition.property.general.TaskGeneralSet) MultipleInstanceCollectionInput(org.kie.workbench.common.stunner.bpmn.definition.property.task.MultipleInstanceCollectionInput) MultipleInstanceDataInput(org.kie.workbench.common.stunner.bpmn.definition.property.task.MultipleInstanceDataInput) MultipleInstanceDataOutput(org.kie.workbench.common.stunner.bpmn.definition.property.task.MultipleInstanceDataOutput)

Example 2 with BaseUserTask

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;
}
Also used : BaseUserTaskExecutionSet(org.kie.workbench.common.stunner.bpmn.definition.property.task.BaseUserTaskExecutionSet) TaskGeneralSet(org.kie.workbench.common.stunner.bpmn.definition.property.general.TaskGeneralSet) Factories.bpmn2(org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.Factories.bpmn2) BaseUserTask(org.kie.workbench.common.stunner.bpmn.definition.BaseUserTask) UserTaskPropertyWriter(org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.properties.UserTaskPropertyWriter)

Aggregations

BaseUserTask (org.kie.workbench.common.stunner.bpmn.definition.BaseUserTask)2 TaskGeneralSet (org.kie.workbench.common.stunner.bpmn.definition.property.general.TaskGeneralSet)2 Factories.bpmn2 (org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.Factories.bpmn2)1 UserTaskPropertyWriter (org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.properties.UserTaskPropertyWriter)1 UserTask (org.kie.workbench.common.stunner.bpmn.definition.UserTask)1 AssignmentsInfo (org.kie.workbench.common.stunner.bpmn.definition.property.dataio.AssignmentsInfo)1 BaseUserTaskExecutionSet (org.kie.workbench.common.stunner.bpmn.definition.property.task.BaseUserTaskExecutionSet)1 IsMultipleInstance (org.kie.workbench.common.stunner.bpmn.definition.property.task.IsMultipleInstance)1 MultipleInstanceCollectionInput (org.kie.workbench.common.stunner.bpmn.definition.property.task.MultipleInstanceCollectionInput)1 MultipleInstanceCollectionOutput (org.kie.workbench.common.stunner.bpmn.definition.property.task.MultipleInstanceCollectionOutput)1 MultipleInstanceDataInput (org.kie.workbench.common.stunner.bpmn.definition.property.task.MultipleInstanceDataInput)1 MultipleInstanceDataOutput (org.kie.workbench.common.stunner.bpmn.definition.property.task.MultipleInstanceDataOutput)1 UserTaskExecutionSet (org.kie.workbench.common.stunner.bpmn.definition.property.task.UserTaskExecutionSet)1