Package org.jbpm.graph.def

Examples of org.jbpm.graph.def.Action


    Iterator nodeElementIter = eventElement.elementIterator();
    while (nodeElementIter.hasNext()) {
      Element actionElement = (Element) nodeElementIter.next();
      String actionName = actionElement.getName();
      if (ActionTypes.hasActionName(actionName)) {
        Action action = createAction(actionElement);
        if ( (graphElement!=null)
             && (eventType!=null)
           ) {
          // add the action to the event
          addAction(graphElement, eventType, action);
View Full Code Here


    }
    event.addAction(action);
  }
 
  public Action readSingleAction(Element nodeElement) {
    Action action = null;
    // search for the first action element in the node
    Iterator iter = nodeElement.elementIterator();
    while (iter.hasNext() && (action==null)) {
      Element candidate = (Element) iter.next();
      if (ActionTypes.hasActionName(candidate.getName())) {
View Full Code Here

    return action;
  }

  public Action createAction(Element actionElement) {
    // create a new instance of the action
    Action action = null;
    String actionName = actionElement.getName();
    Class actionType = ActionTypes.getActionType(actionName);
    try {
      action = (Action) actionType.newInstance();
    } catch (Exception e) {
View Full Code Here

    // read the actions in the body of the exception-handler element
    Iterator iter = exceptionHandlerElement.elementIterator();
    while (iter.hasNext()) {
      Element childElement = (Element) iter.next();
      if (ActionTypes.hasActionName(childElement.getName())) {
        Action action = createAction(childElement);
        exceptionHandler.addAction(action);
      }
    }
  }
View Full Code Here

  public void resolveActionReferences() {
    Iterator iter = unresolvedActionReferences.iterator();
    while (iter.hasNext()) {
      Object[] unresolvedActionReference = (Object[]) iter.next();
      Element actionElement = (Element) unresolvedActionReference[0];
      Action action = (Action) unresolvedActionReference[1];
      String referencedActionName = actionElement.attributeValue("ref-name");
      Action referencedAction = processDefinition.getAction(referencedActionName);
      if (referencedAction==null) {
        addWarning("couldn't resolve action reference in "+actionElement.asXML());
      }
      action.setReferencedAction(referencedAction);
    }
View Full Code Here

      "  <action name='gotocheetahs' class='com.secret.LetsDoItSneeky'/>" +
      "</process-definition>" );
    graphSession.saveProcessDefinition(processDefinition);
    ProcessInstance processInstance = new ProcessInstance(processDefinition);
    Event event = processInstance.getProcessDefinition().getEvent("process-start");
    Action action = processInstance.getProcessDefinition().getAction("gotocheetahs");
    processInstance.addRuntimeAction(new RuntimeAction(event, action));

    processInstance = saveAndReload(processInstance);

    RuntimeAction runtimeAction = (RuntimeAction) processInstance.getRuntimeActions().get(0);
View Full Code Here

      "  <action name='gotocheetahs' class='com.secret.LetsDoItSneeky'/>" +
      "</process-definition>" );
    graphSession.saveProcessDefinition(processDefinition);
    ProcessInstance processInstance = new ProcessInstance(processDefinition);
    Event event = processInstance.getProcessDefinition().getEvent("process-start");
    Action action = processInstance.getProcessDefinition().getAction("gotocheetahs");
    processInstance.addRuntimeAction(new RuntimeAction(event, action));

    processInstance = saveAndReload(processInstance);

    RuntimeAction runtimeAction = (RuntimeAction) processInstance.getRuntimeActions().get(0);
View Full Code Here

      "  <action name='gotocheetahs' class='com.secret.LetsDoItSneeky'/>" +
      "</process-definition>" );
    graphSession.saveProcessDefinition(processDefinition);
   
    ProcessInstance processInstance = new ProcessInstance(processDefinition);
    Action action = processInstance.getProcessDefinition().getAction("gotocheetahs");
    processInstance.addRuntimeAction(new RuntimeAction(processDefinition, "process-start", action));

    processInstance = saveAndReload(processInstance);

    RuntimeAction runtimeAction = (RuntimeAction) processInstance.getRuntimeActions().get(0);
View Full Code Here

    // no action was added on enter of node a yet...
    assertEquals(0,count);

    // add the runtime action on entrance of node a
    Action plusplusAction = processDefinition.getAction("plusplus");
    Event enterB = new Event(Event.EVENTTYPE_NODE_ENTER);
    processDefinition.getNode("a").addEvent(enterB);
    RuntimeAction runtimeAction = new RuntimeAction(enterB,plusplusAction);
    processInstance.addRuntimeAction(runtimeAction);
View Full Code Here

     *                      that mapping which was extracted from the ESB Message object.
     * @throws CallbackException
     */
    HashMap<Mapping, Object> getVariablesMapFromMessage(final Node node, final Message esbMessage) throws CallbackException
    {
        final Action jbpmAction = node.getAction();
        if (jbpmAction != null && esbMessage != null)
        {
            final Delegation actionDelegation = jbpmAction.getActionDelegation();
            if (actionDelegation != null)
            {
                final Object delegate = actionDelegation.getInstance();
                if (delegate instanceof EsbActionHandler)
                {
View Full Code Here

TOP

Related Classes of org.jbpm.graph.def.Action

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.