It is really a shame I guess but I can't seem to be able to make the
engine work on the basic helloWorld example;
My test class code:
public WorkflowEngine() {
engine = new MemEngine();
engine.addNodeType( "helloWorld", HelloNode.class );
try {
File xml = new File("/main/webapp/WEB-INF/bootstrap.xml");
engine.getLoader().load(xml);
} catch (LoadException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (JAXBException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
Graph graph = engine.getRepository().getLatestGraph("hello-world");
GraphProcess process = engine.startProcess(graph);
LoggingManager.println(process.getState().toString());
}
my bootstrap helloWorld:
<?xml version="1.0"?>
<process-definition name="hello-world"
xmlns="
http://sarasvati.googlecode.com/
ProcessDefinition">
<node name="hello" type="helloWord" isStart="true"/>
</process-definition>
And finally the Node class:
public class HelloNode extends MemNode {
@Override public void execute (Engine engine, NodeToken token)
{
System.out.println( "Hello, world!" );
engine.completeExecution( token, Arc.DEFAULT_ARC );
}
}
I execute this code and get no errors. When showing the state of the
graph it says it has completed but no "Hello, World" message in my
console. What am I missing here? I tried to see whether there was a
guard preventing this node to execute and go directly into Completed
state, but nothing. A plain null meaning Accept (cf javadoc).
Thanks
PS. Where can I get the xml dtd for workflow-descriptions?