assertNotNull(bpm);
BpmWorkflow testWorkflow = bpm.getWorkflow("test01");
assertNotNull(testWorkflow);
BpmInstance testInstance = testWorkflow.start(new AttributeMap("v01","value01"));
assertNotNull(testInstance);
//start
System.out.println(testInstance.getCurrentActivities());
System.out.println("v01=" + testInstance.getContext().getString("v01", null));
testInstance.execute();
System.out.println(testInstance.getCurrentActivities() + " " + testInstance.getStatus());
System.out.println("v01=" + testInstance.getContext().getString("v01", null));
assertEquals("value01", testInstance.getContext().getString("v01", null));
testInstance.getCurrentActivities()[0].execute();
// testInstance.execute("a");
// testInstance.waitForActivity
System.out.println(testInstance.getCurrentActivities() + " " + testInstance.getStatus());
System.out.println("v01=" + testInstance.getContext().getString("v01", null));
assertEquals("AA", testInstance.getContext().getString("v01", null));
// wait for scheduling
BpmActivity activityC = testInstance.waitForActivity("c",-1);
System.out.println("");
System.out.println(testInstance.getCurrentActivities() + " " + testInstance.getStatus());
System.out.println("v01=" + testInstance.getContext().getString("v01", null));
// testInstance.execute("c");
activityC.execute();
System.out.println(testInstance.getCurrentActivities() + " " + testInstance.getStatus());
System.out.println("v01=" + testInstance.getContext().getString("v01", null));
testInstance.execute("d");
System.out.println(testInstance.getCurrentActivities() + " " + testInstance.getStatus());
System.out.println("v01=" + testInstance.getContext().getString("v01", null));
try {
testInstance.execute();
System.out.println(testInstance.getCurrentActivities() + " " + testInstance.getStatus());
fail();
} catch (BpmException e) {
}
testInstance.destroy();
}