Re: Retrieving an existing workflow instance variables?

"Hubert Felber" <[email protected]>
Newsgroups gmane.comp.java.open-symphony.devel
Message-ID <[email protected]>

>>> Jon Wilmoth <[email protected]> 05/23/03 09:44pm >>>
>I need to store information with a particular workflow
>instance.  If I'm correct in my assessment of the API,
>it appears that workflow instances can be saved with
>data via the Workflow.initialize(long, int,
>java.util.Map) method.  I would assume the Map of
>inputs is stored in the OS_PROPERTYENTRY table.  Is
>this true?  

No, the initialize function copies all variables from the inputs map to the transientVars map. They can be accessed only within the initial action by their names in the form of: ${variable}

make them persistent with:
<pre-functions>
  <function type="beanshell">
  <arg name="script">
    propertySet.setString("myvariable","${variablename}"); // assumes string variable here
  </arg>
  </function>
</pre-functions>


copy it to the transientVars map where you need it, for strings this can be done with

  <function type="beanshell">
  <arg name="script">
     transientVars.put("myvariable",propertySet.GetString("myvariable"));
  </arg>
  </function>

Then you can access it in the the workflow with ${myvariable}. Remember, variables in the transientVars map are only existent within the same sequence. For every transition, the transientVars map is cleared and populated again. Check AbstractWorkflow.java for more info.


Hubert





-------------------------------------------------------
This SF.net email is sponsored by: ObjectStore.
If flattening out C++ or Java code to make your application fit in a
relational database is painful, don't do it! Check out ObjectStore.
Now part of Progress Software. http://www.objectstore.net/sourceforge
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.