Package org.jbpm.graph.def

Examples of org.jbpm.graph.def.ProcessDefinition


      return getJbpmContext().getGraphSession().findProcessDefinition(processName, newVersion);
  }

  public ProcessInstance execute(ProcessInstance pi)
  {
    ProcessDefinition oldDef = pi.getProcessDefinition();
    ProcessDefinition newDef = loadNewProcessDefinition(oldDef.getName());
   
    if (newDef==null) {
      throw new JbpmException("Process definition " + oldDef.getName() + " in version " + newVersion + " not found.");
    }
   
    // set process variable to remember old version
    pi.getContextInstance().setVariable(OLD_VERSION_PROCESS_VARIABLE_NAME, oldDef.getVersion());

    log.debug("Start changing process id " + pi.getId() + " from version " + pi.getProcessDefinition().getVersion() + " to new version " + newDef.getVersion());
    pi.setProcessDefinition(newDef);

    changeTokenVersion(pi.getRootToken());

    log.debug("process id " + pi.getId() + " changed to version " + pi.getProcessDefinition().getVersion());
View Full Code Here


    return t.getProcessInstance().getProcessDefinition();
  }

  private void changeTokenVersion(Token token)
  {   
    ProcessDefinition newDef = getNewProcessDefinition(token);
    log.debug("change token id " + token.getId() + " to new version " + newDef.getVersion());

    // change node reference on token (current node)
    Node oldNode = token.getNode();
    Node newNode = findReplacementNode(newDef, oldNode);
    token.setNode(newNode);
View Full Code Here

    }
  }

  private void adjustTaskInstancesForToken(Token token)
  {
    ProcessDefinition newDef = getNewProcessDefinition(token);
    Iterator<TaskInstance> iter = getTasksForToken(token).iterator();
    while (iter.hasNext())
    {
      TaskInstance ti = iter.next();
View Full Code Here

    }
  }

  private void adjustTimersForToken(Token token)
  {
    ProcessDefinition newDef = getNewProcessDefinition(token);
    List<Job> jobs = getJbpmContext().getJobSession().findJobsByToken(token);
    for (Job job : jobs)
    {
      if (job instanceof Timer)
      {
View Full Code Here

                inputStream = new ByteArrayInputStream(bytes);
            } else {
                context.setError("Error deploying process", "Type of 'archive' attribute is not recognized");
                return;
            }
            final ProcessDefinition processDefinition;
            try {
                ZipInputStream zis = new ZipInputStream(inputStream);
                try {
                    processDefinition = ProcessDefinition.parseParZipInputStream(zis);
                    final JbpmContext jbpmContext = context.getJbpmContext();
View Full Code Here

import org.jbpm.graph.def.Transition;

public class ProcessFactory {

  public static ProcessDefinition createProcessDefinition(String[] nodes, String[] transitions) {
    ProcessDefinition pd = new ProcessDefinition();
    addNodesAndTransitions(pd, nodes, transitions);
    return pd;
  }
View Full Code Here

                return;
            }
            if (!(processValue instanceof ProcessDefinition)) {
                context.setError("Error reading form information", "The process value is not of type ProcessDefinition");
            }
            final ProcessDefinition processDefinition = (ProcessDefinition) processValue;
            final FileDefinition fileDefinition = processDefinition.getFileDefinition();
            if (! fileDefinition.hasFile("forms.xml")) {
                targetExpression.setValue(elContext, Collections.emptyMap());
                context.selectOutcome("success");
                return;
            }
View Full Code Here

  public void deployProcessDefinition(ProcessDefinition processDefinition) {
    String processDefinitionName = processDefinition.getName();
    // if the process definition has a name (versioning applies to named process definitions only)
    if (processDefinitionName != null) {
      // find the current latest process definition
      ProcessDefinition previousLatestVersion = findLatestProcessDefinition(processDefinitionName);
      // if there is a current latest process definition
      if (previousLatestVersion != null) {
        // take the next version number
        processDefinition.setVersion(previousLatestVersion.getVersion() + 1);
      }
      else {
        // start from 1
        processDefinition.setVersion(1);
      }
View Full Code Here

  public void read(Element element, JpdlXmlReader jpdlReader) {
    // TODO

    // just making sure that the context definition is present
    // because the interleave node needs the context instance at runtime
    ProcessDefinition processDefinition = jpdlReader.getProcessDefinition();
    if (processDefinition.getDefinition(ContextDefinition.class) == null) {
      processDefinition.addDefinition(new ContextDefinition());
    }
  }
View Full Code Here

    @SuppressWarnings ({"unchecked"})
    public void handleAction(JbpmJsfContext context, ActionEvent event) {
        try {
            final FacesContext facesContext = FacesContext.getCurrentInstance();
            final ELContext elContext = facesContext.getELContext();
            final ProcessDefinition processDefinition = (ProcessDefinition) processExpression.getValue(elContext);
            final List<TaskInstance> taskList =
                Collections.unmodifiableList(context.getJbpmContext().getSession()
                    .createQuery("select ti from org.jbpm.taskmgmt.exe.TaskInstance ti join ti.processInstance pi where pi.processDefinition = ?")
                    .setEntity(0, processDefinition)
                    .list());
View Full Code Here

TOP

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

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.