I'm very new at jBPM. I'm trying to get a DecisionHandler working in a new workflow I've defined:
<?xml version="1.0" encoding="UTF-8"?> <process-definition xmlns="urn:jbpm.org:jpdl-3.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:jbpm.org:jpdl-3.1 http://jbpm.org/jpdl-3.1.xsd" name="jpgWorkflow"> <start-state> <transition to="check gif"/> </start-state> <decision name="check gif"> <handler class="com.amg.condenet.mediaflow.task.GifTypeDecisionHandler"> <targetBean>sizeGifImageAction</targetBean> <factoryKey>jbpmConfiguration</factoryKey> </handler> <transition name="gif identified as anmiated" to="keyframe" /> <transition name="gif identified as image" to="size gif" /> </decision> <node name="size gif"> <transition name="image sized" to="crop gif" /> </node> <node name="crop gif"> <transition name="image cropped" to="end" /> </node> <node name="keyframe"> <transition name="keyframe extracted" to="gif2swf conversion" /> </node> <node name="gif2swf conversion"> <transition name="gif2swf converted" to="end" /> </node> <end-state name="end"/> </process-definition>
public class GifTypeDecisionHandler implements DecisionHandler {
private static Log log = LogFactory.getLog(GifTypeDecisionHandler.class);
public String decide(ExecutionContext executionContext) throws Exception {
log.info("********************************");
log.info("* GifTypeDecisionHandler *");
log.info("********************************");
return "size gif";
}
}
Ah, this was my error, the workflow was named 'jpgWorkflow'. My mistake. I simply had to rename the name of the workflow.