StatefulKnowledgeSession ksession = kbase.newStatefulKnowledgeSession();
KnowledgeRuntimeLogger logger = KnowledgeRuntimeLoggerFactory.newFileLogger(ksession, "test");
TestWorkItemHandler handler = new TestWorkItemHandler();
ksession.getWorkItemManager().registerWorkItemHandler("Human Task", handler);
// start a new process instance
ProcessInstance processInstance = (ProcessInstance) ksession.startProcess("org.drools.dynamic");
DynamicNodeInstance dynamicContext = (DynamicNodeInstance)
((WorkflowProcessInstance) processInstance).getNodeInstances().iterator().next();
Map<String, Object> parameters = new HashMap<String, Object>();
parameters.put("TaskName", "Dynamic Task");
assertNull(handler.getWorkItem());