Package org.springmodules.workflow.jbpm31

Examples of org.springmodules.workflow.jbpm31.SpringContextWiringTests


        Collection<Long> tis = getOpenTaskInstancesByActorAndCriteria(actor, null);
        return tis;
    }

    public ProcessInstance createNewProcessInstance(final String defS) {
        ProcessInstance inst = (ProcessInstance) getJbpmTemplate().execute(new JbpmCallback() {
            public Object doInJbpm(JbpmContext ctx) throws JbpmException {
                ProcessDefinition def = ctx.getGraphSession().findLatestProcessDefinition(defS);
                ProcessInstance inst = def.createProcessInstance();
                return inst;
            }
View Full Code Here


   * automatically create a JbpmTemplate for the given JbpmConfiguration.
   *
   * @param jbpmConfiguration the jbpmConfiguration to set
   */
  public final void setJbpmConfiguration(JbpmConfiguration jbpmConfiguration) {
    template = new JbpmTemplate(jbpmConfiguration);
  }
View Full Code Here

  }

  public void testDeployDefinitions() throws Exception {

    Resource definitionLocation = new ClassPathResource("org/springmodules/workflow/jbpm31/simpleWorkflow.xml");
    ProcessDefinitionFactoryBean definition = new ProcessDefinitionFactoryBean();
    definition.setDefinitionLocation(definitionLocation);
    definition.afterPropertiesSet();

    MockControl sfCtrl = MockControl.createControl(SessionFactory.class);
    SessionFactory sf = (SessionFactory) sfCtrl.getMock();

    MockControl sCtrl = MockControl.createNiceControl(Session.class);
    Session session = (Session) sCtrl.getMock();

    MockControl queryCtrl = MockControl.createNiceControl(Query.class);
    Query query = (Query) queryCtrl.getMock();

    session.getNamedQuery("");
    sCtrl.setMatcher(MockControl.ALWAYS_MATCHER);
    sCtrl.setReturnValue(query);

    sfCtrl.expectAndReturn(sf.openSession(), session);
    sfCtrl.replay();
    sCtrl.replay();
    queryCtrl.replay();

    configuration.setProcessDefinitions(new ProcessDefinition[] { (ProcessDefinition) definition.getObject() });
    configuration.setConfiguration(configurationResource);
    // configuration.setUseSpringObjectFactory(false);
    configuration.setSessionFactory(sf);
    configuration.afterPropertiesSet();
View Full Code Here

            for (int i = 0; i < processDefinitions.length; i++) {
              context.deployProcessDefinition(processDefinitions[i]);
            }
          }
          if (processDefinitionsResources != null) {
            ProcessDefinitionFactoryBean factory = new ProcessDefinitionFactoryBean();
            String toString = Arrays.asList(processDefinitionsResources).toString();
            logger.info("deploying process definitions (from resources):" + toString);

            for (int i = 0; i < processDefinitionsResources.length; i++) {
              factory.setDefinitionLocation(processDefinitionsResources[i]);
              factory.afterPropertiesSet();
              context.deployProcessDefinition((ProcessDefinition) factory.getObject());
            }
          }
        }
      }
View Full Code Here

TOP

Related Classes of org.springmodules.workflow.jbpm31.SpringContextWiringTests

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.