use of org.kie.workbench.common.stunner.bpmn.definition.property.service.GenericServiceTaskExecutionSet in project kie-wb-common by kiegroup.
the class TaskConverter method genericServiceTask.
private PropertyWriter genericServiceTask(Node<View<GenericServiceTask>, ?> n) {
org.eclipse.bpmn2.ServiceTask task = bpmn2.createServiceTask();
task.setId(n.getUUID());
GenericServiceTask definition = n.getContent().getDefinition();
GenericServiceTaskPropertyWriter p = propertyWriterFactory.of(task);
TaskGeneralSet general = definition.getGeneral();
GenericServiceTaskExecutionSet executionSet = definition.getExecutionSet();
p.setName(general.getName().getValue());
p.setDocumentation(general.getDocumentation().getValue());
p.setAbsoluteBounds(n);
p.setSimulationSet(definition.getSimulationSet());
p.setValue(executionSet.getGenericServiceTaskInfo().getValue());
p.setAsync(executionSet.getIsAsync().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.setSLADueDate(executionSet.getSlaDueDate().getValue());
p.setAssignmentsInfo(executionSet.getAssignmentsinfo());
p.setMetaData(definition.getAdvancedData().getMetaDataAttributes());
return p;
}
use of org.kie.workbench.common.stunner.bpmn.definition.property.service.GenericServiceTaskExecutionSet in project kie-wb-common by kiegroup.
the class GenericServiceTaskTest method setAndGetExecutionSet.
@Test
public void setAndGetExecutionSet() {
GenericServiceTask genericServiceTask = new GenericServiceTask(new TaskGeneralSet(new Name("Service Task"), new Documentation("")), new GenericServiceTaskExecutionSet(), new BackgroundSet(), new FontSet(), new RectangleDimensionsSet(), new SimulationSet(), new TaskType(TaskTypes.SERVICE_TASK), new AdvancedData());
assertEquals(new GenericServiceTaskExecutionSet(), genericServiceTask.getExecutionSet());
GenericServiceTaskExecutionSet set = new GenericServiceTaskExecutionSet();
genericServiceTask.setExecutionSet(set);
assertEquals(set, genericServiceTask.getExecutionSet());
}
use of org.kie.workbench.common.stunner.bpmn.definition.property.service.GenericServiceTaskExecutionSet 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