-
1. Re: jBPM WorkItemHandler problem: when Object is passed as param it's transformed to String.
annah May 4, 2012 9:34 AM (in response to heathcliff)Hi Adam!
I had the same problem with our custom tasks, and found out that there is an unecpected editor behaviour when saving&reading a BPMN model. As you can see in Properties view, the editor uses XStream to serialize objects, and it all works until you save your model. But when you click Save, the object is saved to file using toString method instead of using XStream. Also when reading from the model, it is read as string, instead of deserializing the object. As a consequence you will always get a string when calling work.getParameter("myParameter"). I noticed this behaviour not only for Object types, but for every data type (including Integer, Float etc. which should be supported according to specification).
I don't know if this is a bug or it should really work this way.... unfortunately I didn't get any answer on this forum when I raised this question a month ago
I solved this problem by serializing/deserializing the object myself, using:
- to save parameter to workitem: work.setParameter("myParameter", xstream.toXML(data));
- to read from work item: (My_Object) xstream.fromXML((String) workItem.getParameter("myParameter"));
Hope this helps.
I also noticed the delay probleim with Properties view, but haven't tried to solve it.
-
2. Re: jBPM WorkItemHandler problem: when Object is passed as param it's transformed to String.
heathcliff May 4, 2012 2:37 PM (in response to annah)Are You refering to my problem with passing parameter or Properties editor? If You are saying aboute passing ObjectParams than as I have mentioned above igf You pass a para using parameter mapping than it works fine and is passed as object. it only breaks when you pass param as #{processVariable} in window which popsup when You doubleclick custom node.
-
3. Re: jBPM WorkItemHandler problem: when Object is passed as param it's transformed to String.
annah May 6, 2012 11:16 AM (in response to heathcliff)I'm talking about your problem with a custom popup editor, which uses workItem.put(name, value) to pass a parameter, which then gets serialized to your diagram's xml file.
Parameters that you pass directly into a knowledge session are of course passed correctly because they newer get serialized.
-
4. Re: jBPM WorkItemHandler problem: when Object is passed as param it's transformed to String.
shashikalagt Oct 9, 2012 7:59 AM (in response to annah)THis is my wid file here i am using file to upload from the form but in workitem i am getting String type, how we solve this problem
-
CausewayMail.wid.zip 514 bytes
-