use of org.kie.workbench.common.stunner.bpmn.definition.property.general.TaskGeneralSet in project kie-wb-common by kiegroup.
the class DefaultRouteFormProviderTest method setUp.
@Before
public void setUp() throws Exception {
super.setUp();
when(definitionManager.adapters()).thenReturn(adapterManager);
when(adapterManager.forDefinition()).thenReturn(definitionAdapter);
when(session.getSelectionControl()).thenReturn(selectionControl);
Collection<String> selectedItems = new ArrayList<>();
when(selectedNode.getUUID()).thenReturn(SELECTED_UUID);
selectedItems.add(selectedNode.getUUID());
when(selectionControl.getSelectedItems()).thenReturn(selectedItems);
when(graph.getNode(SELECTED_UUID)).thenReturn(selectedNode);
outEdges = new ArrayList<>();
UserTask userTask1 = new UserTask(new TaskGeneralSet(new Name("UserTask1"), null), null, null, null, null, null, null);
when(definitionAdapter.getTitle(eq(userTask1))).thenReturn("User Task");
outEdges.add(mockEdge("Edge1", userTask1));
UserTask userTask2 = new UserTask(new TaskGeneralSet(new Name("UserTask2"), null), null, null, null, null, null, null);
when(definitionAdapter.getTitle(eq(userTask2))).thenReturn("User Task");
outEdges.add(mockEdge("Edge2", userTask2));
ScriptTask scriptTask3 = new ScriptTask(new TaskGeneralSet(new Name("ScriptTask3"), null), null, null, null, null, null, null);
when(definitionAdapter.getTitle(eq(scriptTask3))).thenReturn("Script Task");
outEdges.add(mockEdge("Edge3", scriptTask3));
ExclusiveGateway gateway4 = new ExclusiveGateway(new BPMNGeneralSet("Gateway4"), null, null, null, null);
when(definitionAdapter.getTitle(eq(gateway4))).thenReturn("Exclusive Gateway");
outEdges.add(mockEdge("Edge4", gateway4));
InclusiveGateway gateway5 = new InclusiveGateway(new BPMNGeneralSet(""), null, null, null, null);
when(definitionAdapter.getTitle(eq(gateway5))).thenReturn("Inclusive Gateway");
outEdges.add(mockEdge("Edge5", gateway5));
}
use of org.kie.workbench.common.stunner.bpmn.definition.property.general.TaskGeneralSet in project kie-wb-common by kiegroup.
the class TaskConverter method scriptTask.
private PropertyWriter scriptTask(Node<View<ScriptTask>, ?> n) {
org.eclipse.bpmn2.ScriptTask task = bpmn2.createScriptTask();
task.setId(n.getUUID());
ScriptTask definition = n.getContent().getDefinition();
ScriptTaskPropertyWriter p = propertyWriterFactory.of(task);
TaskGeneralSet general = definition.getGeneral();
p.setName(general.getName().getValue());
p.setDocumentation(general.getDocumentation().getValue());
ScriptTaskExecutionSet executionSet = definition.getExecutionSet();
p.setScript(executionSet.getScript().getValue());
p.setAsync(executionSet.getIsAsync().getValue());
p.setSimulationSet(definition.getSimulationSet());
p.setBounds(n.getContent().getBounds());
return p;
}
use of org.kie.workbench.common.stunner.bpmn.definition.property.general.TaskGeneralSet in project kie-wb-common by kiegroup.
the class ScriptTaskConverter method convert.
public Node<? extends View<? extends BPMNViewDefinition>, ?> convert(org.eclipse.bpmn2.ScriptTask task) {
Node<View<ScriptTask>, Edge> node = factoryManager.newNode(task.getId(), ScriptTask.class);
ScriptTask definition = node.getContent().getDefinition();
ScriptTaskPropertyReader p = propertyReaderFactory.of(task);
definition.setGeneral(new TaskGeneralSet(new Name(p.getName()), new Documentation(p.getDocumentation())));
definition.setExecutionSet(new ScriptTaskExecutionSet(new Script(p.getScript()), new IsAsync(p.isAsync())));
node.getContent().setBounds(p.getBounds());
definition.setDimensionsSet(p.getRectangleDimensionsSet());
definition.setBackgroundSet(p.getBackgroundSet());
definition.setFontSet(p.getFontSet());
definition.setSimulationSet(p.getSimulationSet());
return node;
}
use of org.kie.workbench.common.stunner.bpmn.definition.property.general.TaskGeneralSet in project kie-wb-common by kiegroup.
the class TaskConverter method noneTask.
private BpmnNode noneTask(Task task) {
Node<View<NoneTask>, Edge> node = factoryManager.newNode(task.getId(), NoneTask.class);
TaskPropertyReader p = propertyReaderFactory.of(task);
NoneTask definition = node.getContent().getDefinition();
definition.setGeneral(new TaskGeneralSet(new Name(p.getName()), new Documentation(p.getDocumentation())));
definition.setExecutionSet(new EmptyTaskExecutionSet());
definition.setSimulationSet(p.getSimulationSet());
node.getContent().setBounds(p.getBounds());
definition.setDimensionsSet(p.getRectangleDimensionsSet());
definition.setBackgroundSet(p.getBackgroundSet());
definition.setFontSet(p.getFontSet());
return BpmnNode.of(node);
}
Aggregations