0 Replies Latest reply on Feb 4, 2009 4:58 PM by mgommeringer

    Copy a ProcessDefinition Java object in memory

    mgommeringer

      Hi all,

      this may be a stupid question but since I did not find any hints I will post it nevertheless.

      I use JBPM without storing the processdefinition in the database in a JEE environment. I only parse the processdefinition.xml once and (re)use the ProcessDefinition java object. Since I want to ensure that Threads do not disturb each other (Actions for example are instantiated once and the reused always which may cause trouble if an implementor of an action stores local variables) I need to create a new ProcessDefinition in every invocation of my EJB. My preferred way to do this would be to invoke a copy-constructor or a clone method instead of parsing the XML every time; like this I can save the cost of the XML parsing.

      Is there a simple way to copy a ProcessDefinition object? Or should I use some bean utility library? If so, can somebody recommend me one?

      Thanks a lot and regards,
      matthias

      P.S.: jBPM is really cool! Thanks for this great work!