[JBoss jBPM] - implications of a node
by WalterTaus
Hallo,
I am using jBPM in a database environment. I have the following process definition
| <?xml version="1.0" encoding="UTF-8"?>
| <process-definition xmlns="" name="TestFork">
| <start-state name="StartState1219404587924">
| <transition to="StartDecision1219404587924/StartDecision1219404587924"></transition>
| </start-state>
| <super-state name="StartDecision1219404587924">
| <decision name="StartDecision1219404587924">
| <transition name="To_R9v0MGIXEd2c76EEAkhdWA" to="../Fork1/Fork1">
| </transition>
| </decision>
| </super-state>
| <super-state name="Fork1">
| <fork name="Fork1">
| <transition name="To_1k7IQHAeEd2zyONQHdQlYg" to="../State1/State1">
| </transition>
| <transition name="To_atT-cGReEd2afZhBo4aBRw" to="../State2/State2">
| </transition>
| </fork>
| <join name="Join1">
| <event type="node-enter">
| <script><expression>
| executionContext.setDiscriminator(true);
| </expression></script></event>
| <transition name="End" to="../End/End"></transition>
| </join>
| </super-state>
| <super-state name="State1">
| <state name="State1">
| <transition name="To_QPWKwGReEd2afZhBo4aBRwJoin" to="../Fork1/Join1">
| </transition>
| </state>
| </super-state>
| <super-state name="State2">
| <state name="State2">
| <transition name="To_QPWKwGReEd2afZhBo4aBRwJoin" to="../Fork1/Join1">
| </transition>
| </state>
| </super-state>
| <super-state name="End">
| <end-state name="End">
| </end-state>
| </super-state>
| </process-definition>
|
When I run this process past the fork, I correctly have two child tokens, one for State1 and one for State2.
Now I add a node in front of the fork. My process definition now looks as follows.
| <?xml version="1.0" encoding="UTF-8"?>
| <process-definition xmlns="" name="TestFork">
| <start-state name="StartState1219404587924">
| <transition to="StartDecision1219404587924/StartDecision1219404587924"></transition>
| </start-state>
| <super-state name="StartDecision1219404587924">
| <decision name="StartDecision1219404587924">
| <transition name="To_R9v0MGIXEd2c76EEAkhdWA" to="../Node1/Node1">
| </transition>
| </decision>
| </super-state>
| <super-state name="Node1">
| <node name="Node1">
| <event type="node-enter">
| <script><expression>
| System.out.println("Node1 entered");
| executionContext.leaveNode();
| </expression></script></event>
| <transition name="To_QPWKwGReEd2afZhBo4aBRw" to="../Fork1/Fork1">
| </transition>
| </node>
| </super-state>
| <super-state name="Fork1">
| <fork name="Fork1">
| <transition name="To_1k7IQHAeEd2zyONQHdQlYg" to="../State1/State1">
| </transition>
| <transition name="To_atT-cGReEd2afZhBo4aBRw" to="../State2/State2">
| </transition>
| </fork>
| <join name="Join1">
| <event type="node-enter">
| <script><expression>
| executionContext.setDiscriminator(true);
| </expression></script></event>
| <transition name="End" to="../End/End"></transition>
| </join>
| </super-state>
| <super-state name="State1">
| <state name="State1">
| <transition name="To_QPWKwGReEd2afZhBo4aBRwJoin" to="../Fork1/Join1">
| </transition>
| </state>
| </super-state>
| <super-state name="State2">
| <state name="State2">
| <transition name="To_QPWKwGReEd2afZhBo4aBRwJoin" to="../Fork1/Join1">
| </transition>
| </state>
| </super-state>
| <super-state name="End">
| <end-state name="End">
| </end-state>
| </super-state>
| </process-definition>
|
When I now run this process past the fork, I have four child tokens in JBPM_TOKEN table, two for State1 and two for State2.
Can somebody explain why this happens and how to avoid this behaviour.
Thanks in advance
Walter
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4172024#4172024
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4172024
17 years, 8 months
[JBoss Cache: Core Edition] - Re: ClassNotFoundException during deserialisation
by mbrade
Hello
I looked at the source code and it is impossible to fix that bug by writing your own Marshaller.
The VersionAwareMarshaller is used to work as a wrapper for the Marshaller you define. It creates a org.jboss.util.stream.MarshalledValueInputStream as an replacement for Suns java.io.ObjectInputStream. The MarshalledValueInputStream seems to have problems with primitives. It should take aware of a ClassNotFoundException and check if the name of the class which should be returned matches one of the primitives.
I looked at the source code of ObjectInputStream of the JDK 1.6 and noticed that they have fixed the bug.
I could fix this bug by writting and setting my own classloader in the DefaultCacheFactory.
| DefaultCacheFactory factory = new DefaultCacheFactory();
| factory.setDefaultClassLoader( new MyClassLoader() );
| ...
| import java.util.HashMap;
|
|
| @SuppressWarnings("unchecked")
| public class MyClassLoader extends ClassLoader {
| //from java.io.ObjectInputStream
| private static final HashMap primClasses = new HashMap();
| static {
| primClasses.put("boolean", boolean.class);
| primClasses.put("byte", byte.class);
| primClasses.put("char", char.class);
| primClasses.put("short", short.class);
| primClasses.put("int", int.class);
| primClasses.put("long", long.class);
| primClasses.put("float", float.class);
| primClasses.put("double", double.class);
| primClasses.put("void", void.class);
| }
|
|
| public MyClassLoader() {
| super(PrimitiveAwareClassLoader.class.getClassLoader());
| }
|
| public MyClassLoader(ClassLoader parent) {
| super(parent);
| }
|
| @Override
| public Class<?> loadClass(String name) throws ClassNotFoundException {
| try{
| return super.loadClass(name);
| }catch(ClassNotFoundException cnfe){
| Class cl = (Class) primClasses.get(name);
| if (cl != null) {
| return cl;
| } else {
| throw cnfe;
| }
| }
| }
|
| }
|
Maybee I can help someone with that.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4172022#4172022
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4172022
17 years, 8 months