Package org.drools.workflow.core.node

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


    public HumanTaskNodeFactory(RuleFlowNodeContainerFactory nodeContainerFactory, NodeContainer nodeContainer, long id) {
        super(nodeContainerFactory, nodeContainer, id);
    }

    protected Node createNode() {
        return new HumanTaskNode();
    }
View Full Code Here


    public void handleNode(final Node node, final Element element, final String uri,
            final String localName, final ExtensibleXmlParser parser)
            throws SAXException {
        super.handleNode(node, element, uri, localName, parser);
        HumanTaskNode humanTaskNode = (HumanTaskNode) node;
        final String swimlane = element.getAttribute("swimlane");
        if (swimlane != null && !"".equals(swimlane)) {
            humanTaskNode.setSwimlane(swimlane);
        }
    }
View Full Code Here

            humanTaskNode.setSwimlane(swimlane);
        }
    }

    protected Node createNode() {
        return new HumanTaskNode();
    }
View Full Code Here

        endNode("humanTask", xmlDump);
    }
   
  protected void visitParameters(WorkItemNode workItemNode, StringBuilder xmlDump) {
      super.visitParameters(workItemNode, xmlDump);
      HumanTaskNode humanTaskNode = (HumanTaskNode) workItemNode;
      String swimlane = humanTaskNode.getSwimlane();
      if (swimlane != null) {
          xmlDump.append("swimlane=\"" + swimlane + "\" ");
      }
  }
View Full Code Here

        process.addNode(new MilestoneNode());
        process.addNode(new RuleSetNode());
        process.addNode(new SubProcessNode());
        process.addNode(new WorkItemNode());
        process.addNode(new TimerNode());
        process.addNode(new HumanTaskNode());
        process.addNode(new ForEachNode());
        process.addNode(new CompositeContextNode());
        process.addNode(new EventNode());
        process.addNode(new FaultNode());
       
View Full Code Here

        workItemNode.setActions(ExtendedNodeImpl.EVENT_NODE_EXIT, actions);
        process.addNode(workItemNode);
        connection = new ConnectionImpl(subProcess, Node.CONNECTION_DEFAULT_TYPE, workItemNode, Node.CONNECTION_DEFAULT_TYPE);
        connection.setMetaData("bendpoints", "[]");
       
        HumanTaskNode humanTaskNode = new HumanTaskNode();
        humanTaskNode.setName("Human Task");
        work = humanTaskNode.getWork();
        parameterDefinitions = new HashSet<ParameterDefinition>();
        parameterDefinition = new ParameterDefinitionImpl("TaskName", new StringDataType());
        parameterDefinitions.add(parameterDefinition);
        parameterDefinition = new ParameterDefinitionImpl("ActorId", new StringDataType());
        parameterDefinitions.add(parameterDefinition);
        parameterDefinition = new ParameterDefinitionImpl("Priority", new StringDataType());
        parameterDefinitions.add(parameterDefinition);
        parameterDefinition = new ParameterDefinitionImpl("Comment", new StringDataType());
        parameterDefinitions.add(parameterDefinition);
        work.setParameterDefinitions(parameterDefinitions);
        work.setParameter("TaskName", "Do something");
        work.setParameter("ActorId", "John Doe");
        humanTaskNode.setWaitForCompletion(false);
        humanTaskNode.setActions(ExtendedNodeImpl.EVENT_NODE_ENTER, actions);
        humanTaskNode.setActions(ExtendedNodeImpl.EVENT_NODE_EXIT, actions);
        process.addNode(humanTaskNode);
        connection = new ConnectionImpl(workItemNode, Node.CONNECTION_DEFAULT_TYPE, humanTaskNode, Node.CONNECTION_DEFAULT_TYPE);
       
        TimerNode timerNode = new TimerNode();
        timerNode.setName("timer");
View Full Code Here

import org.xml.sax.SAXException;

public class UserTaskHandler extends TaskHandler {
   
    protected Node createNode(Attributes attrs) {
        return new HumanTaskNode();
    }
View Full Code Here

    }

    protected void handleNode(final Node node, final Element element, final String uri,
            final String localName, final ExtensibleXmlParser parser) throws SAXException {
      super.handleNode(node, element, uri, localName, parser);
      HumanTaskNode humanTaskNode = (HumanTaskNode) node;
        Work work = new WorkImpl();
        work.setName("Human Task");
      humanTaskNode.setWork(work);
      Map<String, String> dataInputs = new HashMap<String, String>();
      Map<String, String> dataOutputs = new HashMap<String, String>();
      List<String> owners = new ArrayList<String>();
      org.w3c.dom.Node xmlNode = element.getFirstChild();
        while (xmlNode != null) {
          String nodeName = xmlNode.getNodeName();
          if ("ioSpecification".equals(nodeName)) {
            readIoSpecification(xmlNode, dataInputs, dataOutputs);
          } else if ("dataInputAssociation".equals(nodeName)) {
            readDataInputAssociation(xmlNode, humanTaskNode, dataInputs);
          } else if ("dataOutputAssociation".equals(nodeName)) {
            readDataOutputAssociation(xmlNode, humanTaskNode, dataOutputs);
          } else if ("potentialOwner".equals(nodeName)) {
            owners.add(readPotentialOwner(xmlNode, humanTaskNode));
          }
        xmlNode = xmlNode.getNextSibling();
        }
        if (owners.size() > 0) {
          String owner = owners.get(0);
          for (int i = 1; i < owners.size(); i++) {
            owner += "," + owners.get(i);
          }
          humanTaskNode.getWork().setParameter("ActorId", owner);         
        }
    }
View Full Code Here

    protected String readPotentialOwner(org.w3c.dom.Node xmlNode, HumanTaskNode humanTaskNode) {
    return xmlNode.getFirstChild().getFirstChild().getFirstChild().getTextContent();
    }
   
  public void writeNode(Node node, StringBuilder xmlDump, boolean includeMeta) {
    HumanTaskNode humanTaskNode = (HumanTaskNode) node;
    writeNode("userTask", humanTaskNode, xmlDump, includeMeta);
    xmlDump.append("implementation=\"humanTaskWebService\" >" + EOL);
    writeIO(humanTaskNode, xmlDump);
    String ownerString = (String) humanTaskNode.getWork().getParameter("ActorId");
    if (ownerString != null) {
      String[] owners = ownerString.split(",");
      for (String owner: owners) {
        xmlDump.append(
          "      <potentialOwner resourceRef=\"tns:Actor\" >" + EOL +
View Full Code Here

    public HumanTaskNodeFactory(RuleFlowNodeContainerFactory nodeContainerFactory, NodeContainer nodeContainer, long id) {
        super(nodeContainerFactory, nodeContainer, id);
    }

    protected Node createNode() {
        return new HumanTaskNode();
    }
View Full Code Here

TOP

Related Classes of org.drools.workflow.core.node.HumanTaskNode

Copyright © 2018 www.massapicom. 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.