public static JbpmContext createPageflowContext() { return pageflowConfiguration.createJbpmContext(); }
public JbpmContext createJbpmContext() { return createJbpmContext(JbpmContext.DEFAULT_JBPM_CONTEXT_NAME); }
public JbpmContext createJbpmContext() { return createJbpmContext(JbpmContext.DEFAULT_JBPM_CONTEXT_NAME); }
JbpmConfiguration jbpmConfiguration = JbpmConfiguration.getInstance("jbpm.cfg.xml")); ProcessDefinition processDefinition = ProcessDefinition.parseXmlInputStream(newPdStream); JbpmContext context = jbpmConfiguration.createJbpmContext(); context.getGraphSession().deployProcessDefinition(processDefinition);
JbpmConfiguration conf = JbpmConfiguration.parseResource("jbpm.cfg.xml"); JbpmContext context = conf.createJbpmContext(); List<TaskInstance> taskList = context.getTaskList("Head of Department");
JbpmConfiguration conf = JbpmConfiguration.parseResource("jbpm.cfg.xml"); JbpmContext context = conf.createJbpmContext(); List<TaskInstance> taskList = context.getTaskList();
public JbpmContext getJbpmContext() { final boolean debug = log.isLoggable(Level.FINE); if (jbpmContext==null) { jbpmContext = JbpmConfiguration.getInstance().createJbpmContext(); final Principal userPrincipal = FacesContext.getCurrentInstance().getExternalContext().getUserPrincipal(); if (userPrincipal != null && ConfigurationLocator.getInstance().useJsfActorId()) { jbpmContext.setActorId(userPrincipal.getName()); } if (debug) log.fine(toString() + " using NEW " + jbpmContext.toString()); } else { if (debug) log.fine(toString() + " using cached " + jbpmContext.toString()); } return jbpmContext; }
protected void createJbpmContext() { jbpmContext = getJbpmConfiguration().createJbpmContext(); initializeMembers(); }
protected void createJbpmContext() { jbpmContext = getJbpmConfiguration().createJbpmContext(); initializeMembers(); }
public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException { JbpmContext jbpmContext = getJbpmConfiguration().createJbpmContext(jbpmContextName); try { if (isAuthenticationEnabled && servletRequest instanceof HttpServletRequest) { HttpServletRequest httpServletRequest = (HttpServletRequest) servletRequest; Principal userPrincipal = httpServletRequest.getUserPrincipal(); if (userPrincipal != null) jbpmContext.setActorId(userPrincipal.getName()); } filterChain.doFilter(servletRequest, servletResponse); } finally { jbpmContext.close(); } }
public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException { JbpmContext jbpmContext = getJbpmConfiguration().createJbpmContext(jbpmContextName); try { if (isAuthenticationEnabled && servletRequest instanceof HttpServletRequest) { HttpServletRequest httpServletRequest = (HttpServletRequest) servletRequest; Principal userPrincipal = httpServletRequest.getUserPrincipal(); if (userPrincipal != null) jbpmContext.setActorId(userPrincipal.getName()); } filterChain.doFilter(servletRequest, servletResponse); } finally { jbpmContext.close(); } }
public ServiceFactory getServiceFactory(String serviceName, String jbpmContextName) { JbpmContext jbpmContext = createJbpmContext(jbpmContextName); try { return jbpmContext.getServices().getServiceFactory(serviceName); } finally { jbpmContext.close(); } }
public ServiceFactory getServiceFactory(String serviceName, String jbpmContextName) { JbpmContext jbpmContext = createJbpmContext(jbpmContextName); try { return jbpmContext.getServices().getServiceFactory(serviceName); } finally { jbpmContext.close(); } }
/** * Executes command based on its current context. Each command contains the appropriate * context information such as token, process instance, etc. to insure that the operation is * carried out on the proper graph object. * * @param command jBPM engine command to execute */ public Object execute(Command command) { JbpmContext jbpmContext = jbpmConfiguration.createJbpmContext(); try { if (log.isDebugEnabled()) log.debug("executing " + command); return command.execute(jbpmContext); } catch (RuntimeException e) { jbpmContext.setRollbackOnly(); throw e; } catch (Exception e) { jbpmContext.setRollbackOnly(); throw new JbpmException("failed to execute " + command, e); } finally { jbpmContext.close(); } }
private void installProcessDefinitions() { if ( isProcessDeploymentEnabled() ) { JbpmContext jbpmContext = getJbpmConfiguration().createJbpmContext(); try { if (processDefinitions!=null) { for ( String definitionResource : processDefinitions ) { deployProcess(jbpmContext, definitionResource); } } } catch (RuntimeException e) { throw new RuntimeException("could not deploy a process definition", e); } finally { jbpmContext.close(); } } }
private void handleProcessFile(JbpmConfiguration jbpmConfiguration, File processFile) { JbpmContext jbpmContext = jbpmConfiguration.createJbpmContext(); try { ProcessDefinition processDefinition = parseProcessArchive(processFile); deployProcessDefinition(processDefinition, jbpmContext); } catch (IOException e) { if (failOnError) { throw new BuildException("failed to read file " + processFile, e, getLocation()); } else { log("failed to read file " + processFile, e, Project.MSG_ERR); } } finally { jbpmContext.close(); } }
private void handleProcessFile(JbpmConfiguration jbpmConfiguration, File processFile) { JbpmContext jbpmContext = jbpmConfiguration.createJbpmContext(); try { ProcessDefinition processDefinition = parseProcessArchive(processFile); deployProcessDefinition(processDefinition, jbpmContext); } catch (IOException e) { if (failOnError) { throw new BuildException("failed to read file " + processFile, e, getLocation()); } else { log("failed to read file " + processFile, e, Project.MSG_ERR); } } finally { jbpmContext.close(); } }
@Create public void create() throws NamingException, RollbackException, SystemException { jbpmContext = Jbpm.instance().getJbpmConfiguration().createJbpmContext(); assertNoTransactionManagement(); log.debug( "created seam managed jBPM context"); }
private void unlockJob(Job job) { JbpmContext jbpmContext = jobExecutor.getJbpmConfiguration().createJbpmContext(); try { // reattach job to persistence context jbpmContext.getJobSession().reattachJob(job); // unlock job so it can be dispatched again job.setLockOwner(null); job.setLockTime(null); } catch (RuntimeException e) { jbpmContext.setRollbackOnly(); log.warn("failed to unlock " + job, e); } catch (Error e) { jbpmContext.setRollbackOnly(); throw e; } finally { try { jbpmContext.close(); } catch (RuntimeException e) { log.warn("failed to unlock " + job, e); } } }
protected void executeJob(Job job) throws Exception { JbpmContext jbpmContext = jobExecutor.getJbpmConfiguration().createJbpmContext(); try { // reattach job to persistence context JobSession jobSession = jbpmContext.getJobSession(); jobSession.reattachJob(job); // register process instance for automatic save // https://jira.jboss.org/browse/JBPM-1015 ProcessInstance processInstance = job.getProcessInstance(); jbpmContext.addAutoSaveProcessInstance(processInstance); // if job is exclusive, lock process instance if (job.isExclusive()) { jbpmContext.getGraphSession().lockProcessInstance(processInstance); } if (log.isDebugEnabled()) log.debug("executing " + job); if (job.execute(jbpmContext)) jobSession.deleteJob(job); } catch (Exception e) { jbpmContext.setRollbackOnly(); throw e; } catch (Error e) { jbpmContext.setRollbackOnly(); throw e; } finally { jbpmContext.close(); } }