Ejemplo n.º 1
0
  public ProcessInstance getProcessInstance(Long id) {
    JbpmContext context = Jbpm.instance().getJbpmConfiguration().createJbpmContext();
    // log.debug("!!!!!!!!!!!!!!!!!!!!!!!!!: " + context);
    /*
    try {
    	log.debug("!!!!!!!!!!!!!!!!!!!!!!!!!: " + context.getConnection().isClosed());
    }catch(SQLException e) {
    	e.printStackTrace();
    }
    */

    return context.getProcessInstance(id);
  }
Ejemplo n.º 2
0
  /** Resume Process Instance */
  public static void resumeProcessInstance(long processInstanceId) throws WorkflowException {
    log.debug("resumeProcessInstance({})", processInstanceId);
    JbpmContext jbpmContext = JBPMUtils.getConfig().createJbpmContext();

    try {
      org.jbpm.graph.exe.ProcessInstance pi = jbpmContext.getProcessInstance(processInstanceId);
      pi.resume();
      jbpmContext.getSession().flush();
    } catch (JbpmException e) {
      throw new WorkflowException(e.getMessage(), e);
    } finally {
      jbpmContext.close();
    }
  }
Ejemplo n.º 3
0
  /** Delete Process Instance */
  public static void deleteProcessInstanceVariable(long processInstanceId, String name)
      throws WorkflowException {
    log.debug("deleteProcessInstanceVariable({}, {})", new Object[] {processInstanceId, name});
    JbpmContext jbpmContext = JBPMUtils.getConfig().createJbpmContext();

    try {
      org.jbpm.graph.exe.ProcessInstance pi = jbpmContext.getProcessInstance(processInstanceId);
      pi.getContextInstance().deleteVariable(name);
      jbpmContext.getSession().flush();
    } catch (JbpmException e) {
      throw new WorkflowException(e.getMessage(), e);
    } finally {
      jbpmContext.close();
    }
  }