其实我正在尝试这个链接的例子 https://community.jboss.org/people/bpmn2user/blog/2011/02/21/jbpm5-example-for-forms-with-variables
现在当它在达到HUMAN TASK时调用ftl文件时,它会在jsp页面上显示
Model Number: MarshalledContentWrapper{content=B@1e0d7c5,
marshaller=org.drools.marshalling.impl.SerializablePlaceholderResolverStrategy,
type=class java.lang.String}
Quantity: MarshalledContentWrapper{content=[B@75ffe5,
marshaller=org.drools.marshalling.impl.SerializablePlaceholderResolverStrategy,
type=class java.lang.String}
Priority: MarshalledContentWrapper{content=[B@f31cdb,
marshaller=org.drools.marshalling.impl.SerializablePlaceholderResolverStrategy,
type=class java.lang.String}
然后是文本框和提交按钮。
点击提交时
我在控制台上收到了这个输出。
Human Task Started....
Exception in thread "Thread-2" java.lang.ClassCastException: java.lang.String cannot be cast to org.jbpm.task.utils.MarshalledContentWrapper
at org.jbpm.task.utils.ContentMarshallerHelper.unmarshall(ContentMarshallerHelper.java:157)
at org.jbpm.process.workitem.wsht.GenericHTWorkItemHandler$TaskCompletedHandler.handleCompletedTask(GenericHTWorkItemHandler.java:208)
at org.jbpm.process.workitem.wsht.GenericHTWorkItemHandler$TaskCompletedHandler$1.run(GenericHTWorkItemHandler.java:187)
at java.lang.Thread.run(Thread.java:679)
如何解决这个问题是否有人对此有所了解。
答案 0 :(得分:2)
我在BPMN文件的脚本任务中编写了以下代码
map = new java.util.HashMap();
map.put("priority","High");
map.put("modelNumber","1234");
map.put("quantity","225");
kcontext.setVariable("map", map);
我正在通过此链接做人工任务的例子
https://community.jboss.org/people/bpmn2user/blog/2011/02/21/jbpm5-example-for-forms-with-variables