Examples of HumanTaskNode


Examples of org.jbpm.workflow.core.node.HumanTaskNode

        } else {
          ongoingCases.put(name, testCode);
          return false;
        }
      } else if (currentNode instanceof HumanTaskNode) {
        HumanTaskNode taskNode = (HumanTaskNode) currentNode;
        String actorId = (String) taskNode.getWork().getParameter("ActorId");
        if (actorId == null) {
          actorId = "";
        }
        String groupId = (String) taskNode.getWork().getParameter("GroupId");
        if (groupId == null) {
          groupId = "";
        }
        String[] actorIds = new String[0];
        if (actorId.trim().length() > 0) {
          actorIds = actorId.split(",");
        }
        String[] groupIds = new String[0];
        if (groupId.trim().length() > 0) {
          groupIds = groupId.split(",");
        }
        actorId = actorIds.length > 0 ? actorIds[0] : "";
        if (firstHumanTask) {
          testCode +=
            "        // execute task\n" +
            "        String actorId = \"" + actorId + "\";\n" +
            "        List<TaskSummary> list = taskService.getTasksAssignedAsPotentialOwner(actorId, \"en-UK\");\n" +
            "        TaskSummary task = list.get(0);\n";
        } else {
          testCode +=
            "        // execute task\n" +
            "        actorId = \"" + actorId + "\";\n" +
            "        list = taskService.getTasksAssignedAsPotentialOwner(actorId, \"en-UK\");\n" +
            "        task = list.get(0);\n";
        }
        if (actorIds.length > 1 || groupIds.length > 0) {
          testCode +=
              "        taskService.claim(task.getId(), actorId);\n";
        }
        if (firstHumanTask) {
          testCode +=
            "        taskService.start(task.getId(), actorId);\n" +
          "        Map<String, Object> results = new HashMap<String, Object>();\n" +
          "        // add results here\n";
          firstHumanTask = false;
        } else {
          testCode +=
            "        taskService.start(task.getId(), actorId);\n" +
          "        results = new HashMap<String, Object>();\n" +
          "        // add results here\n";
        }
        for (Map.Entry<String, String> entry: taskNode.getOutMappings().entrySet()) {
          String type = null;
          VariableScope variableScope = (VariableScope) taskNode.resolveContext(VariableScope.VARIABLE_SCOPE, entry.getValue());
          if (variableScope != null) {
            type = variableScope.findVariable(entry.getValue()).getType().getStringType();
          }
          testCode +=
            "        // results.put(\"" + entry.getKey() + "\", value);" + (type == null ? "" : " // type " + type) + "\n";
        }
        testCode +=
          "        taskService.complete(task.getId(), actorId, results);\n" +
          "\n";
        return processNodes(name, ((NodeImpl) currentNode).getTo().getTo(), testCode, cases, ongoingCases);
      } else if (currentNode instanceof WorkItemNode) {
        WorkItemNode taskNode = (WorkItemNode) currentNode;
        testCode +=
          "        // if necessary, complete request for service task \"" + taskNode.getWork().getName() + "\"\n";
        return processNodes(name, ((NodeImpl) currentNode).getTo().getTo(), testCode, cases, ongoingCases);
      } else if (currentNode instanceof EventNode) {
        EventNode eventNode = (EventNode) currentNode;
        testCode +=
          "        ksession.signalEvent(\"" + eventNode.getType() + "\", null, processInstance.getId());\n";
View Full Code Here

Examples of org.jbpm.workflow.core.node.HumanTaskNode

        ((WorkDefinitionExtensionImpl) WORK_DEFINITION).setIcon("icons/human_task.gif");
        ((WorkDefinitionExtensionImpl) WORK_DEFINITION).setCustomEditor(HumanTaskCustomEditor.class.getName());
    }

    public HumanTaskNodeWrapper() {
        setNode(new HumanTaskNode());
        getNode().setName("Human Task");
        setWorkDefinition(WORK_DEFINITION);
    }
View Full Code Here

Examples of org.jbpm.workflow.core.node.HumanTaskNode

        StartNode startNode = new StartNode();
        startNode.setName( "Start" );
        startNode.setId( 1 );

        HumanTaskNode workItemNode = new HumanTaskNode();
        workItemNode.setName( "workItemNode" );
        workItemNode.setId( 2 );
        workItemNode.addInMapping( "Attachment", "MyObject" );
        workItemNode.addOutMapping( "Result", "MyObject" );
        workItemNode.addOutMapping( "Result.length()", "Number" );
       
        Work work = new WorkImpl();
        work.setName( workName );
       
        Set<ParameterDefinition> parameterDefinitions = new HashSet<ParameterDefinition>();
        ParameterDefinition parameterDefinition = new ParameterDefinitionImpl( "ActorId", new StringDataType() );
        parameterDefinitions.add( parameterDefinition );
        parameterDefinition = new ParameterDefinitionImpl( "Content", new StringDataType() );
        parameterDefinitions.add( parameterDefinition );
        parameterDefinition = new ParameterDefinitionImpl( "Comment", new StringDataType() );
        parameterDefinitions.add( parameterDefinition );
        work.setParameterDefinitions( parameterDefinitions );
       
        work.setParameter( "ActorId", "#{UserName}" );
        work.setParameter( "Content", "#{Person.name}" );
        workItemNode.setWork( work );

        EndNode endNode = new EndNode();
        endNode.setName( "End" );
        endNode.setId( 3 );
View Full Code Here

Examples of org.jbpm.workflow.core.node.HumanTaskNode

        ((WorkDefinitionExtensionImpl) WORK_DEFINITION).setIcon("icons/human_task.gif");
        ((WorkDefinitionExtensionImpl) WORK_DEFINITION).setCustomEditor(HumanTaskCustomEditor.class.getName());
    }

    public HumanTaskNodeWrapper() {
        setNode(new HumanTaskNode());
        getNode().setName("Human Task");
        setWorkDefinition(WORK_DEFINITION);
    }
View Full Code Here

Examples of org.jbpm.workflow.core.node.HumanTaskNode

public class StaffPoolImplTest {

    @Test
    public void testSingleWorkingHours() {
        HumanTaskNode node = new HumanTaskNode();

        Map<String, Object> properties = new HashMap<String, Object>();
        properties.put(SimulationConstants.STAFF_AVAILABILITY, 1);
        properties.put(SimulationConstants.TIMEUNIT, "min");
        properties.put(SimulationConstants.DISTRIBUTION_TYPE, "exact");
View Full Code Here

Examples of org.jbpm.workflow.core.node.HumanTaskNode

        assertEquals(105*60*1000, waitTime);
    }
   
    @Test
    public void testRangeWorkingHours() {
        HumanTaskNode node = new HumanTaskNode();

        Map<String, Object> properties = new HashMap<String, Object>();
        properties.put(SimulationConstants.STAFF_AVAILABILITY, 1);
        properties.put(SimulationConstants.TIMEUNIT, "min");
        properties.put(SimulationConstants.DISTRIBUTION_TYPE, "exact");
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.