Package org.jbpm

Examples of org.jbpm.JbpmConfiguration


   
    public synchronized void resumeProcessInstance()
    {
        if (suspendProcess)
        {
            final JbpmConfiguration jbpmConfiguration = JbpmConfiguration.getInstance() ;
            final JbpmContext jbpmContext = jbpmConfiguration.createJbpmContext() ;
           
            final ProcessInstance processInstance = jbpmContext.loadProcessInstance(processInstanceId) ;
            processInstance.resume() ;
           
            jbpmContext.close() ;
View Full Code Here


{
    private static final String PROCESS_DEFINITION = "/jbpmReplyTest.xml" ;
   
    public synchronized void deployProcess()
    {
        final JbpmConfiguration jbpmConfiguration = JbpmConfiguration.getInstance() ;
        final JbpmContext jbpmContext = jbpmConfiguration.createJbpmContext() ;
       
        // Create process definition
        final InputStream is = ClassUtil.getResourceAsStream(PROCESS_DEFINITION, getClass()) ;
        final ProcessDefinition processDefinition = ProcessDefinition.parseXmlInputStream(is) ;
        jbpmContext.deployProcessDefinition(processDefinition) ;
View Full Code Here

    @BeforeClass
    public static void setup() throws Exception
    {
        logger.info("Setting up jBPM");
        JbpmConfiguration jbpmConfiguration = JbpmConfiguration.getInstance();
       
        jbpmConfiguration.getJobExecutor().start();
        JbpmContext jbpmContext = jbpmConfiguration.createJbpmContext();
        //Extract a process definition from the processdefinition.xml file.
        ProcessDefinition processDefinition = ProcessDefinition.parseXmlResource(PROCESS_DEF_XML);
        assertNotNull(processDefinition);
        //Create an instance of the process definition.
        jbpmContext.deployProcessDefinition(processDefinition);
View Full Code Here

     * @throws Exception
     */
    @Test
    public void timeOut() throws Exception
    {
        JbpmConfiguration jbpmConfiguration = JbpmConfiguration.getInstance();
        JbpmContext jbpmContext = jbpmConfiguration.createJbpmContext();
        ProcessInstance processInstance = jbpmContext.loadProcessInstance(processInstanceId);
       
        Token token = processInstance.getRootToken();
        processInstance.signal();
        assertEquals("wait1",token.getNode().getName());
        jbpmContext.close();
       
        int seconds=0;
        while (true) {
            try {
                Thread.sleep(1000);
            } catch (InterruptedException e) {}
            jbpmContext = jbpmConfiguration.createJbpmContext();
            processInstance = jbpmContext.loadProcessInstance(processInstanceId);
            token = processInstance.getRootToken();
            String currentNode = token.getNode().getName();
            System.out.println(seconds++ + " " + currentNode);
            jbpmContext.close();
View Full Code Here

        epr1 = new EPR(new URI("test1"));
        courier1 = new MockCourier(true);
        MockRegistry.register(MOCK_CATEGORY, MOCK_SERVICE, epr1, courier1);
       
        logger.info("Setting up jBPM");
        JbpmConfiguration jbpmConfiguration = JbpmConfiguration.getInstance();
        JbpmContext jbpmContext = jbpmConfiguration.createJbpmContext();
        jbpmContext.getJbpmConfiguration().getJobExecutor().start();
     
        //Extract a process definition from the processdefinition.xml file.
        ProcessDefinition processDefinition
            = ProcessDefinition.parseXmlResource(PROCESS_DEF_XML);
View Full Code Here

     * @throws Exception
     */
    @Test
    public void timeOut() throws Exception
    {
        JbpmConfiguration jbpmConfiguration = JbpmConfiguration.getInstance();
        JbpmContext jbpmContext = jbpmConfiguration.createJbpmContext();
        ProcessInstance processInstance = jbpmContext.loadProcessInstance(processInstanceId);
       
        Token token = processInstance.getRootToken();
        assertEquals("start",token.getNode().getName());
        //Move the process to service1
        processInstance.signal();
        jbpmContext.close();
        //Our timer fires after 1000 millies, so let's wait for that
        int seconds=0;
        while(true) {
            jbpmContext = jbpmConfiguration.createJbpmContext();
            processInstance = jbpmContext.loadProcessInstance(processInstanceId);
            token = processInstance.getRootToken();
            logger.info(seconds++ + " Node=" + token.getNode().getName());
            if ("ExceptionHandling".equals(token.getNode().getName())) break; //we're done waiting
            if (seconds > 20) break; // the timer must not have fired so we are bailing (and failing)
View Full Code Here

     * Tests bypassing the timout and taking the exception transition on service2.
     *
     */
    @Test
    public void takeExceptionTransition() {
        JbpmConfiguration jbpmConfiguration = JbpmConfiguration.getInstance();
        JbpmContext jbpmContext = jbpmConfiguration.createJbpmContext();
        ProcessInstance processInstance = jbpmContext.loadProcessInstance(processInstanceId);
       
        Token token = processInstance.getRootToken();
        assertEquals("start",token.getNode().getName());
        //Move the process to service1
View Full Code Here

     * Tests bypassing the timout and setting exception of 3 to take the conditional transition.
     *
     */
    @Test
    public void takeConditionalTransition() {
        JbpmConfiguration jbpmConfiguration = JbpmConfiguration.getInstance();
        JbpmContext jbpmContext = jbpmConfiguration.createJbpmContext();
        ProcessInstance processInstance = jbpmContext.loadProcessInstance(processInstanceId);
       
        Token token = processInstance.getRootToken();
        assertEquals("start",token.getNode().getName());
        //Move the process to service1
View Full Code Here

     * Tests bypassing the timout and setting exception of 3 to take the conditional transition.
     *
     */
    @Test
    public void doNotTakeConditionalTransition() {
        JbpmConfiguration jbpmConfiguration = JbpmConfiguration.getInstance();
        JbpmContext jbpmContext = jbpmConfiguration.createJbpmContext();
        ProcessInstance processInstance = jbpmContext.loadProcessInstance(processInstanceId);
       
        Token token = processInstance.getRootToken();
        assertEquals("start",token.getNode().getName());
        //Move the process to service1
View Full Code Here

     * Tests bypassing the timout and setting exception of 3 to take the conditional transition.
     *
     */
    @Test
    public void doNotTakeConditionalTransition2() {
        JbpmConfiguration jbpmConfiguration = JbpmConfiguration.getInstance();
        JbpmContext jbpmContext = jbpmConfiguration.createJbpmContext();
        ProcessInstance processInstance = jbpmContext.loadProcessInstance(processInstanceId);
       
        Token token = processInstance.getRootToken();
        assertEquals("start",token.getNode().getName());
        //Move the process to service1
View Full Code Here

TOP

Related Classes of org.jbpm.JbpmConfiguration

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.