Package org.jbpm.graph.def

Examples of org.jbpm.graph.def.Action


        final ProcessDefinition processDefinition = token.getProcessInstance().getProcessDefinition() ;
        if (processDefinition == null)
        {
            throw new JbpmException("Could not locate process definition for process instance: " + processInstance.getId()) ;
        }
        final Action currentAction = token.getProcessInstance().getProcessDefinition().getAction(ESB_ASYNC_SIGNAL_ACTION_NAME) ;
        if (currentAction!= null)
        {
            return currentAction ;
        }
       
        if (logger.isDebugEnabled())
        {
            logger.debug("Creating Callback action for process definition: " + processDefinition.getName() + ", id: " + processDefinition.getId()) ;
        }
        final Delegation delegation = new Delegation(AsyncSignalAction.class.getName()) ;
        delegation.setConfigType("constructor") ;
        final Action newAction = new Action(delegation) ;
        newAction.setName(ESB_ASYNC_SIGNAL_ACTION_NAME) ;
        processDefinition.addAction(newAction) ;
       
        return newAction ;
    }
View Full Code Here


        List<DeployPackageStep> steps = new ArrayList<DeployPackageStep>();
        List<Node> nodes = mainProcess.getNodes();

        for (Node node : nodes) {

            Action action = node.getAction();
            if (action != null) {

                Delegation delegation = action.getActionDelegation();
                String configProps = delegation.getConfiguration();
                String actionHandlerClassName = delegation.getClassName();
                FieldInstantiator instantiator = new FieldInstantiator();

                BaseHandler handler = (BaseHandler) instantiator.instantiate(Class.forName(actionHandlerClassName),
View Full Code Here

    String actors = element.attributeValue("actors");
    String to = element.attributeValue("to");
    String subject = jpdlReader.getProperty("subject", element);
    String text = jpdlReader.getProperty("text", element);
    Delegation delegation = jpdlReader.createMailDelegation(template, actors, to, subject, text);
    this.action = new Action(delegation);
  }
View Full Code Here

      if (event==null) {
        event = new Event(notificationEvent);
        task.addEvent(event);
      }
      Delegation delegation = createMailDelegation(notificationEvent, null, null, null, null);
      Action action = new Action(delegation);
      action.setProcessDefinition(processDefinition);
      event.addAction(action);
    }

    // task controller
    Element taskControllerElement = taskElement.element("controller");
View Full Code Here

    if (name==null) name = "timer-for-task-"+task.getId();
   
    CreateTimerAction createTimerAction = new CreateTimerAction();
    createTimerAction.read(timerElement, this);
    createTimerAction.setTimerName(name);
    Action action = null;
    if ("timer".equals(timerElement.getName())) {
      action = readSingleAction(timerElement);
    } else {
      Delegation delegation = createMailDelegation("task-reminder", null, null, null, null);
      action = new Action(delegation);
    }
    createTimerAction.setTimerAction(action);
    addAction(task, Event.EVENTTYPE_TASK_CREATE, createTimerAction);

    // read the cancel-event types
View Full Code Here

    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

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.