public BaseElement createBaseElement() { return bpmn2.createTask(); } }
public FlowNode mockNode(String id, Bounds bounds) { Task node = bpmn2.createTask(); node.setId(id); BPMNShape shape = di.createBPMNShape(); shape.setBounds(bounds); shape.setBpmnElement(node); definitionResolver.getPlane().getPlaneElement().add(shape); return node; }
@Test public void shouldCreateOneInputSet() { Task task = bpmn2.createTask(); ActivityPropertyWriter activityPropertyWriter = new ActivityPropertyWriter(task, new FlatVariableScope()); activityPropertyWriter.setAssignmentsInfo(new AssignmentsInfo( "|A:String|||" )); List<InputSet> inputSets = task.getIoSpecification().getInputSets(); assertEquals(1, inputSets.size()); } }
@Test public void shouldReuseInputSet() { Task task = bpmn2.createTask(); StringInput stringInput = new StringInput("BLAH", "ATYPE", "DEFAULTVAL"); stringInput.of(task).set("VALUE"); StringInput stringInput2 = new StringInput("BLAH2", "ATYPE", "DEFAULTVAL"); stringInput.of(task).set("VALUE"); InputOutputSpecification ioSpecification = task.getIoSpecification(); List<InputSet> inputSets = ioSpecification.getInputSets(); assertEquals(1, inputSets.size()); } }
private PropertyWriter noneTask(Node<View<NoneTask>, ?> n) { Task task = bpmn2.createTask(); task.setId(n.getUUID()); NoneTask definition = n.getContent().getDefinition(); ActivityPropertyWriter p = propertyWriterFactory.of(task); TaskGeneralSet general = definition.getGeneral(); p.setName(general.getName().getValue()); p.setDocumentation(general.getDocumentation().getValue()); p.setBounds(n.getContent().getBounds()); p.setSimulationSet(definition.getSimulationSet()); return p; } }
private PropertyWriter serviceTask(Node<View<ServiceTask>, ?> n) { org.eclipse.bpmn2.Task task = bpmn2.createTask(); task.setId(n.getUUID()); ServiceTask definition = n.getContent().getDefinition(); ServiceTaskPropertyWriter p = propertyWriterFactory.of(task); p.setServiceTaskName(definition.getName()); TaskGeneralSet general = definition.getGeneral(); p.setName(general.getName().getValue()); p.setDocumentation(general.getDocumentation().getValue()); p.setAssignmentsInfo( definition.getDataIOSet().getAssignmentsinfo()); ServiceTaskExecutionSet executionSet = definition.getExecutionSet(); p.setTaskName(executionSet.getTaskName().getValue()); p.setAsync(executionSet.getIsAsync().getValue()); p.setOnEntryAction(executionSet.getOnEntryAction()); p.setOnExitAction(executionSet.getOnExitAction()); p.setAdHocAutostart(executionSet.getAdHocAutostart().getValue()); p.setSimulationSet(definition.getSimulationSet()); p.setBounds(n.getContent().getBounds()); return p; }