Creating "service task" using process API
sanbhat Jul 2, 2014 7:49 AMI have a requirement to create the service task (a task which is associated with a service class) using Process API (Chapter 6. Processes) . I took the example mentioned in the Processes chapter and started exploring options. Here I found that, an action node can be created with a class, which should implement org.jbpm.process.instance.impl.Action (I thought this will solve my problem). But when I created such an action node, by supplying an implementor of org.jbpm.process.instance.impl.Action, I got the following error
java.lang.ClassCastException: org.jbpm.workflow.core.DroolsAction cannot be cast to org.jbpm.workflow.core.impl.DroolsConsequenceAction
at org.jbpm.bpmn2.xml.XmlBPMNProcessDumper.visitEscalations(XmlBPMNProcessDumper.java:505)
at org.jbpm.bpmn2.xml.XmlBPMNProcessDumper.visitProcess(XmlBPMNProcessDumper.java:143)
at org.jbpm.bpmn2.xml.XmlBPMNProcessDumper.dump(XmlBPMNProcessDumper.java:98)
at org.jbpm.bpmn2.xml.XmlBPMNProcessDumper.dump(XmlBPMNProcessDumper.java:89)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at junit.framework.TestCase.runTest(TestCase.java:176)
at junit.framework.TestCase.runBare(TestCase.java:141)
at junit.framework.TestResult$1.protect(TestResult.java:122)
at junit.framework.TestResult.runProtected(TestResult.java:142)
at junit.framework.TestResult.run(TestResult.java:125)
at junit.framework.TestCase.run(TestCase.java:129)
at junit.framework.TestSuite.runTest(TestSuite.java:255)
at junit.framework.TestSuite.run(TestSuite.java:250)
at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:84)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
Doing a google search yielded this result ([JBPM-4378] ClassCastException when dumping process with an action node - JBoss Issue Tracker) which seems to be an Open bug. My question is, is there any alternative? or workaround?
I am using Jbpm-6.0.0-Final. Please help me with an advice. Thanks for your time on this post.