try {
procDefDir = workflowService.processDefinitionDirectory();
procDir = workflowService.processDirectory();
ProcessMgr pmgr = procDefDir.processMgr
("chabacc", "chabacc_test_rec_send_indirect");
WfProcess process
= pmgr.createProcess(new DefaultRequester (workflowService));
chan = workflowService.getChannel(process, "test_channel");
Map pd = new HashMap ();
pd.put ("message", "Do you echo?");
chan.sendMessage(pd);
process.start();
pd = chan.receiveMessage();
assertTrue ("Got: " + pd.get("message"),
"Do you echo?".equals(pd.get("message")));
assertTrue (stateReached (process, "closed.completed"));
pd = process.processContext();
assertTrue (pd.get("feedback").equals ("Got message"));
// cleanup
Iterator acts = process.activitiesInState("closed").iterator();
assertTrue (acts.hasNext ());
Activity act = null;
while (true) {
act = (Activity)acts.next ();
if (act.name().equals ("Run subflow")) {