Examples of BPMS


Examples of org.mule.module.bpm.BPMS

        assertEquals("test.def", c.getResource());
        assertEquals("myId", c.getProcessIdField());

        // BPMS gets set implicitly via MuleRegistry.lookupObject(BPMS.class)
        BPMS bpms = c.getBpms();
        assertNotNull(bpms);
        assertEquals(TestBpms.class, bpms.getClass());
        assertEquals("bar", ((TestBpms) bpms).getFoo());
    }
View Full Code Here

Examples of org.mule.module.bpm.BPMS

   
    @Test
    public void testSimpleProcess() throws Exception
    {
        MuleClient client = muleContext.getClient();
        BPMS bpms = muleContext.getRegistry().lookupObject(BPMS.class);
        assertNotNull(bpms);

        // Create a new process.
        MuleMessage response = client.send("vm://simple", "data", null);
        Object process = response.getPayload();

        String processId = (String)bpms.getId(process);
        // The process should be started and in a wait state.
        assertFalse(processId == null);
        assertEquals("dummyState", bpms.getState(process));

        // Advance the process one step.
        Map<String, Object> props = new HashMap<String, Object>();
        props.put(Process.PROPERTY_PROCESS_ID, processId);
        response = client.send("vm://simple", null, props);
        process = response.getPayload();

        // The process should have ended.
        assertTrue(bpms.hasEnded(process));
    }
View Full Code Here

Examples of org.mule.module.bpm.BPMS

   
    @Test
    public void testVariables() throws Exception
    {
        MuleClient client = muleContext.getClient();
        BPMS bpms = muleContext.getRegistry().lookupObject(BPMS.class);
        assertNotNull(bpms);

        Map<String, Object> props = new HashMap<String, Object>();
        props.put("foo", "bar");
        MuleMessage response = client.send("vm://variables", "data", props);
        String processId = (String)bpms.getId(response.getPayload());
        assertNotNull(processId);

        response = client.request("vm://queueA", TIMEOUT);
        assertNotNull(response);
        assertEquals("bar", response.getInboundProperty("foo"));
View Full Code Here

Examples of org.mule.module.bpm.BPMS

   
    @Test
    public void testSendMessageProcess() throws Exception
    {
        MuleClient client = muleContext.getClient();
        BPMS bpms = muleContext.getRegistry().lookupObject(BPMS.class);
        assertNotNull(bpms);

        // Create a new process.
        MuleMessage response = client.send("vm://message", "data", null);
        Object process = response.getPayload();
        assertTrue(bpms.isProcess(process));

        String processId = (String)bpms.getId(process);
        // The process should have sent a synchronous message, followed by an asynchronous message and now be in a wait state.
        assertFalse(processId == null);
        assertEquals("waitForResponse", bpms.getState(process));

        // Advance the process one step.
        Map<String, Object> props = new HashMap<String, Object>();
        props.put(Process.PROPERTY_PROCESS_ID, processId);
        response = client.send("vm://message", "data", props);
        process = response.getPayload();

        // The process should have ended.
        assertTrue(bpms.hasEnded(process));
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.