Examples of TaskRef


Examples of org.jbpm.formbuilder.shared.task.TaskRef

        procName = null;
        pkgName = null;
    }
   
    public void addTask(TaskRef task) {
        TaskRef oldTask = tasksMap.get(task.getTaskName());
        if (oldTask != null) {
            tasks.remove(oldTask);
            for (TaskPropertyRef input : task.getInputs()) {
                oldTask.addInput(input.getName(), input.getSourceExpresion());
            }
            for (TaskPropertyRef output : task.getOutputs()) {
                oldTask.addOutput(output.getName(), output.getSourceExpresion());
            }
            Map<String, String> metaData = oldTask.getMetaData();
            metaData.putAll(task.getMetaData());
            oldTask.setMetaData(metaData);
            task = oldTask;
        }
        task.setProcessId(this.procId);
        task.setPackageName(this.pkgName);
        tasks.add(task);
View Full Code Here

Examples of org.jbpm.formbuilder.shared.task.TaskRef

                    task.addOutput(id, "${" + id + "}");
                }
                return;
            }
        }
        TaskRef ref = new TaskRef();
        ref.setTaskId(processInputName);
        ref.setPackageName(this.pkgName);
        ref.setProcessId(this.procId);
        ref.addOutput(id, "${" + id + "}");
        tasks.add(ref);
        tasksMap.put(ref.getTaskName(), ref);
    }
View Full Code Here

Examples of org.jbpm.formbuilder.shared.task.TaskRef

            subNode = subNode.getNextSibling();
        }
        NamedNodeMap map = xmlNode.getParentNode().getAttributes();
        Node nodeName = map.getNamedItem("name");
        String name = nodeName.getNodeValue();
        TaskRef task = new TaskRef();
        task.setTaskId(name);
        List<TaskPropertyRef> inputs = new ArrayList<TaskPropertyRef>(dataInputs.size());
        for (Map.Entry<String, String> in : dataInputs.entrySet()) {
            TaskPropertyRef prop = new TaskPropertyRef();
            prop.setName(in.getValue());
            prop.setSourceExpresion(in.getValue());
            inputs.add(prop);
        }
        task.setInputs(inputs);
        List<TaskPropertyRef> outputs = new ArrayList<TaskPropertyRef>(dataOutputs.size());
        for (Map.Entry<String, String> out : dataOutputs.entrySet()) {
            TaskPropertyRef prop = new TaskPropertyRef();
            prop.setName(out.getValue());
            prop.setSourceExpresion(out.getValue());
            outputs.add(prop);
        }
        task.setOutputs(outputs);
        this.taskRepository.addTask(task);
    }
View Full Code Here

Examples of org.jbpm.formbuilder.shared.task.TaskRef

    }

    @Override
    public TaskRef getBPMN2Task(String bpmn2ProcessContent, String processName, String userTask)
            throws TaskServiceException {
        TaskRef retval = null;
        List<TaskRef> tasks = getProcessTasks(bpmn2ProcessContent, processName);
        if (tasks != null) {
            for (TaskRef task : tasks) {
                if (task.getTaskName().equals(userTask)) {
                    retval = task;
View Full Code Here

Examples of org.jbpm.formbuilder.shared.task.TaskRef

        List<TaskRef> tasks = service.getTasksByName("somePackage", processId, taskId);
        EasyMock.verify(client);
       
        assertNotNull("tasks shouldn't be null", tasks);
        assertEquals("tasks should have one item", tasks.size(), 1);
        TaskRef task = tasks.iterator().next();
        assertNotNull("sampleTask shouldn't be null", task);
        assertNotNull("processId shouldn't be null", task.getProcessId());
        assertFalse("processId shouldn't be empty", "".equals(task.getProcessId()));
        assertNotNull("taskId shouldn't be null", task.getTaskId());
        assertFalse("taskId shouldn't be empty", "".equals(task.getTaskId()));
        assertEquals("taskId should be the same as task.taskId", task.getTaskId(), taskId);
        assertEquals("processId should be the same as task.processId", task.getProcessId(), processId);
    }
View Full Code Here

Examples of org.jbpm.formbuilder.shared.task.TaskRef

            andAnswer(new MockAnswer(responses, new IllegalArgumentException("unexpected call"))).times(4);
        service.getHelper().setClient(client);
        String taskId = "Review";
       
        EasyMock.replay(client);
        TaskRef task = service.getTaskByUUID("somePackage", taskId, uuid1);
        EasyMock.verify(client);
       
        assertNotNull("task shouldn't be null", task);
        assertNotNull("processId shouldn't be null", task.getProcessId());
        assertFalse("processId shouldn't be empty", "".equals(task.getProcessId()));
        assertNotNull("taskId shouldn't be null", task.getTaskId());
        assertFalse("taskId shouldn't be empty", "".equals(task.getTaskId()));
        assertEquals("taskId should be the same as task.taskId", task.getTaskId(), taskId);
    }
View Full Code Here

Examples of org.jbpm.formbuilder.shared.task.TaskRef

        GuvnorTaskDefinitionService service = createService(baseUrl, "", "");
        String process1Content = IOUtils.toString(getClass().getResourceAsStream("GuvnorGetProcessTasksTest.bpmn2"));
        String processName = "testProcess.bpmn2";
        String taskName = "Review";
       
        TaskRef task = service.getBPMN2Task(process1Content, processName, taskName);
        assertNotNull("task shouldn't be null", task);
        assertNotNull("task.taskId shouldn't be null", task.getTaskId());
        assertNotNull("task.processId shouldn't be null", task.getProcessId());
        assertEquals("task.taskName should be the same as taskName", taskName, task.getTaskName());
    }
View Full Code Here

Examples of org.jbpm.formbuilder.shared.task.TaskRef

        GuvnorTaskDefinitionService service = createService(baseUrl, "", "");
        String process1Content = "";
        String processId = "AFileThatDoesntBelongHere.txt";
        String taskId = "Review";
       
        TaskRef task = service.getBPMN2Task(process1Content, processId, taskId);
        assertNull("task should be null", task);
    }
View Full Code Here

Examples of org.jbpm.formbuilder.shared.task.TaskRef

        GuvnorTaskDefinitionService service = createService(baseUrl, "", "");
        String process1Content = IOUtils.toString(getClass().getResourceAsStream("GuvnorGetProcessTasksTest2.bpmn2"));
        String processId = "testProcess.bpmn2";
        String taskId = "ATaskThatDoesntExist";
       
        TaskRef task = service.getBPMN2Task(process1Content, processId, taskId);
        assertNull("task should be null", task);
    }
View Full Code Here

Examples of org.jbpm.formbuilder.shared.task.TaskRef

        String xml = "<some><bpmn2><content/></bpmn2></some>";
        BufferedReader reader = new BufferedReader(new StringReader(xml));
        EasyMock.expect(request.getReader()).andReturn(reader);
        FormDefinitionService formService = EasyMock.createMock(FormDefinitionService.class);
        TaskDefinitionService taskService = EasyMock.createMock(TaskDefinitionService.class);
        TaskRef task = new TaskRef();
        task.setPackageName("somePackage");
        EasyMock.expect(taskService.getBPMN2Task(EasyMock.eq(xml), EasyMock.eq("PROCESS_NAME"), EasyMock.eq("USER_TASK"))).andReturn(task).once();
        FormRepresentation form = RESTAbstractTest.createMockForm("myForm", "myParam");
        EasyMock.expect(formService.getAssociatedForm(EasyMock.eq("somePackage"), EasyMock.eq(task))).andReturn(form).once();
        EmbedingServlet servlet = createServlet(formService, taskService);
        request.setAttribute(EasyMock.eq("jsonData"), EasyMock.anyObject(String.class));
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.