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.