}
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 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));
}