Package org.jbpm.env.session

Examples of org.jbpm.env.session.PvmDbSession


        "org/jbpm/examples/ch10/jbpm.environment.xml"
    );
   
    Environment environment = environmentFactory.openEnvironment();
    try {
      PvmDbSession pvmDbSession = environment.get(PvmDbSession.class);
     
      ProcessDefinition processDefinition = ProcessFactory.build("persited process")
      .done();
     
      pvmDbSession.save(processDefinition);
     
    } finally {
      environment.close();
    }
  }
View Full Code Here


  public StartExecution(long processDefinitionDbid) {
    this.processDefinitionDbid = processDefinitionDbid;
  }

  public Object execute(Environment environment) throws Exception {
    PvmDbSession pvmDbSession = environment.get(PvmDbSession.class);

    ProcessDefinition processDefinition = null;
   
    if (processDefinitionName!=null) {
      processDefinition = pvmDbSession.findProcessDefinition(processDefinitionName);
    } else {
      processDefinition = pvmDbSession.get(ProcessDefinitionImpl.class, processDefinitionDbid);
    }
   
    ExecutionImpl execution = (ExecutionImpl) processDefinition.startExecution(key, variables);
   
    pvmDbSession.save(execution);
    return execution;
  }
View Full Code Here

  public Deploy(ProcessDefinition processDefinition) {
    this.processDefinition = processDefinition;
  }

  public Object execute(Environment environment) throws Exception {
    PvmDbSession pvmDbSession = environment.get(PvmDbSession.class);
   
    String name = processDefinition.getName();
    if (name==null) {
      throw new PvmException("process must have a name to deploy it");
    }
   
    int version = processDefinition.getVersion();
   
    if (pvmDbSession.findProcessDefinition(name, version)!=null) {
      throw new PvmException("process ["+name+"|"+version+"] already exists");
    }
   
    pvmDbSession.save(processDefinition);

    return processDefinition;
  }
View Full Code Here

  public FindExecution(long executionDbid) {
    this.executionDbid = executionDbid;
  }

  public Object execute(Environment environment) throws Exception {
    PvmDbSession pvmDbSession = environment.get(PvmDbSession.class);
    if (processDefinitionName!=null) {
      return pvmDbSession.findExecution(processDefinitionName, key);
    }
    return pvmDbSession.get(ExecutionImpl.class, executionDbid);
  }
View Full Code Here

  public FindProcessDefinition(long processDefinitionDbid) {
    this.processDefinitionDbid = processDefinitionDbid;
  }

  public Object execute(Environment environment) throws Exception {
    PvmDbSession pvmDbSession = environment.get(PvmDbSession.class);
    if (processDefinitionName!=null) {
      return pvmDbSession.findProcessDefinition(processDefinitionName, processDefinitionVersion);
    } else {
      return pvmDbSession.get(ProcessDefinitionImpl.class, processDefinitionDbid);
    }
  }
View Full Code Here

TOP

Related Classes of org.jbpm.env.session.PvmDbSession

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.