Package org.jbpm.pvm.internal.model

Examples of org.jbpm.pvm.internal.model.ActivityImpl


public class MoveToParentActivity extends AtomicOperation {

  private static final long serialVersionUID = 1L;

  public void perform(ExecutionImpl execution) {
    ActivityImpl activity = execution.getActivity();
    ActivityImpl parentActivity = activity.getParentActivity();
    ExecutionImpl propagatingExecution = execution.endActivity(activity);
   
    propagatingExecution.setActivity(parentActivity);
    propagatingExecution.performAtomicOperation(new Signal(null, null));
  }
View Full Code Here


  public boolean isAsync(ExecutionImpl execution) {
    return execution.getActivity().isAsync();
  }

  public void perform(ExecutionImpl execution) {
    ActivityImpl activity = execution.getActivity();
   
    if (log.isDebugEnabled()) {
      if (execution.getName()!=null) {
        log.debug(execution.toString()+" executes "+activity);
      } else {
        log.debug("executing "+activity);
      }
    }
   
    ActivityBehaviour activityBehaviour = activity.getBehaviour();
   
    try {
      execution.setPropagation(Propagation.UNSPECIFIED);
      execution.setHistoryActivityStart(Clock.getCurrentTime());
View Full Code Here

  public boolean isAsync(ExecutionImpl execution) {
    return false;
  }

  public void perform(ExecutionImpl execution) {
    ActivityImpl activity = execution.getActivity();
   
    if (execution.getName()!=null) {
      log.debug(execution.toString()+" signals "+activity);
    } else {
      log.debug("signalling "+activity+", signalName="+signalName);
    }

    ExternalActivityBehaviour externalActivityBehaviour = (ExternalActivityBehaviour) activity.getBehaviour();
   
    try {
      execution.setPropagation(Propagation.UNSPECIFIED);
      externalActivityBehaviour.signal(execution, signalName, parameters);
View Full Code Here

    }
   
    String initialStateName = null;
    if (element.hasAttribute("initial")) {
      initialStateName = element.getAttribute("initial");
      ActivityImpl initial = (ActivityImpl) lifeCycleProcess.getActivity(initialStateName);
      if (initial!=null) {
        lifeCycleProcess.setInitial(initial);
      } else {
        parse.addProblem("initial "+initialStateName+" doesn't exist", element);
      }
View Full Code Here

    if (! element.hasAttribute("name")) {
      parse.addProblem("state doesn't have a name: "+XmlUtil.toString(element), element);
      return;
    }
    String stateName = element.getAttribute("name");
    ActivityImpl state = (ActivityImpl) lifeCycleProcess.getActivity(stateName);
   
    List<Element> transitionElements = XmlUtil.elements(element, "transition");
    for (Element transitionElement: transitionElements) {
      parseTransition(transitionElement, state, parse);
    }
View Full Code Here

    if (! element.hasAttribute("to")) {
      parse.addProblem("transition "+transitionName+" doesn't have a to attribute indicating the destination state: "+XmlUtil.toString(element), element);
      return;
    }
    String destinationName = element.getAttribute("to");
    ActivityImpl destination = (ActivityImpl) state.getProcessDefinition().getActivity(destinationName);
    if (destination!=null) {
      TransitionImpl transition = state.createOutgoingTransition();
      transition.setDestination(destination);
      transition.setName(transitionName);
    } else {
View Full Code Here

    if (! element.hasAttribute("name")) {
      parse.addProblem("state doesn't have an id: "+XmlUtil.toString(element), element);
      return;
    }
    String stateName = element.getAttribute("name");
    ActivityImpl state = lifeCycleProcess.createActivity(stateName);
    state.setBehaviour(new LifeCycleState());
  }
View Full Code Here

    }
  }

  protected void resolveFlows() {
    for (UnresolvedFlow unresolvedFlow: unresolvedFlows) {
      ActivityImpl destination = (ActivityImpl) processDefinition.findActivity(unresolvedFlow.destinationName);
      if (destination==null) {
        errorUnexistingFlowDestination(unresolvedFlow);
      }
      destination.addIncomingTransition(unresolvedFlow.transition);
    }
  }
View Full Code Here

  public String execute(Environment environment) {
    RepositorySession repositorySession = Environment.getFromCurrent(RepositorySession.class);
    ProcessDefinitionImpl processDefinition = repositorySession.findProcessDefinitionById(processDefinitionId);
   
    ActivityImpl activity = processDefinition.getActivity(activityName);
   
    ActivityBehaviour behaviour = activity.getBehaviour();
    if (behaviour instanceof FormBehaviour) {
      return ((FormBehaviour)behaviour).getFormResourceName();
    }

    return null;
View Full Code Here

   
    Set<String> outcomes = new HashSet<String>();
    outcomes.add(Task.STATE_COMPLETED);

    ExecutionImpl execution = (task!=null ? task.getExecution() : null);
    ActivityImpl activity = (execution!=null ? execution.getActivity() : null);
    List<Transition> outgoingTransitions = (activity!=null ? activity.getOutgoingTransitions() : null);

    if (outgoingTransitions!=null) {
      for (Transition transition: outgoingTransitions) {
        outcomes.add(transition.getName());
      }
View Full Code Here

TOP

Related Classes of org.jbpm.pvm.internal.model.ActivityImpl

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.