RE: big OSWF update
"Greg Nyberg" <[email protected]>
| Newsgroups | gmane.comp.java.open-symphony.devel |
|---|---|
| Message-ID | <[email protected]> |
Hani- Your auto-action code has the same chicken-and-egg problem I was seeing with initial actions using my workaround.. the propertyset is not ready for the first automatic step. Attached is a simple workflow example that shows what I mean. The auto action in step 0 outputs the contents of the propertySet variable which returns null, even though it was initialized in the initial actions.. I think the problem is the way property sets are created in memory during "initialize" and not converted to persistent until after the first transition is complete (line 381)... ? -Greg -----Original Message----- From: [email protected] [mailto:[email protected]]On Behalf Of Hani Suleiman Sent: Saturday, May 10, 2003 2:58 PM To: [email protected] Subject: [Opensymphony-developers] big OSWF update I've fixed/modified the exception handling in oswf to be a lot more useful/helpful. All exceptions are now checked, which means that any code calling oswf needs to catch them. This is the only thing that client code has to modify. The advantage is that you now get a lot more information about what actually went wrong, whether it's a store problem (StoreException), a factory problem (FactoryException), or something else (WorkflowException). Also implemented is the auto action functionality. I think I''m missing something because this turned out to be simpler than I thought. Basically an action can now have an optional 'auto' attribute, which can be true or false. If true, then when the workflow moves to its step, the auto actions are checked, the first one that matches is auto executed, and so on until we get to a state where no auto actions apply. I've added 4 test cases that illustrate how this works. Please be aware that I do not need this functionality myself, so I don't know if I'm testing the use cases you guys are trying to implement. I'd be hugely grateful if people can write simple example auto action descriptors that aren't covered by the existing cases, so we can add them to the test suite, even better would be descriptors which show errors with the current implementation! I'm sure there are some problem since so much code has changed, so please be patient and I promise it'll all be ironed out very quickly, assuming of course people who run into bugs report them promptly ;) Existing projects shouldn't have any problems, I've tested this with JIRA's sourcecode as well as our own portal app which uses osworkflow quite a bit. ------------------------------------------------------- Enterprise Linux Forum Conference & Expo, June 4-6, 2003, Santa Clara The only event dedicated to issues related to Linux enterprise solutions www.enterpriselinuxforum.com _______________________________________________ Opensymphony-developers mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/opensymphony-developers
autoproblem.xml
(text/xml, 1.4 KB)
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE workflow PUBLIC "-//OpenSymphony Group//DTD OSWorkflow 2.1//EN" "http://www.opensymphony.com/osworkflow/workflow.dtd">
<workflow>
<initial-actions>
<action id="1" name="Start Workflow">
<restrict-to>
</restrict-to>
<pre-functions>
<function type="beanshell">
<arg name="script">
propertySet.setString("myvar","anything"); // put something in propertyset
</arg>
</function>
</pre-functions>
<results>
<unconditional-result old-status="Finished" status="Underway" step="0"/>
</results>
</action>
</initial-actions>
<steps>
<step id="0" name="Start">
<actions>
<action id="50" name="Start Workflow" auto="true">
<pre-functions>
<function type="beanshell">
<arg name="script"><![CDATA[
System.out.println("Starting first step, myvar is "+propertySet.getString("myvar"));
]]></arg>
</function>
</pre-functions>
<results>
<unconditional-result old-status="Finished" status="Underway" step="1"/>
</results>
</action>
</actions>
</step>
<step id="1" name="Step 1">
<actions>
<action id="101" name="Stop Workflow">
<results>
<unconditional-result old-status="Finished" status="Finished" step="1"/>
</results>
</action>
</actions>
</step>
</steps>
</workflow>