From: <st...@us...> - 2006-11-29 16:40:32
|
Revision: 3672 http://svn.sourceforge.net/smartfrog/?rev=3672&view=rev Author: steve_l Date: 2006-11-29 08:38:56 -0800 (Wed, 29 Nov 2006) Log Message: ----------- Delay with no action is a sleep Modified Paths: -------------- trunk/core/smartfrog/src/org/smartfrog/sfcore/workflow/combinators/Delay.java trunk/core/smartfrog/src/org/smartfrog/sfcore/workflow/combinators/delay.sf trunk/core/smartfrog/src/org/smartfrog/sfcore/workflow/eventbus/eventbus.sf trunk/core/testharness/testcases/org/smartfrog/test/system/workflow/delay/DelayTest.java Modified: trunk/core/smartfrog/src/org/smartfrog/sfcore/workflow/combinators/Delay.java =================================================================== --- trunk/core/smartfrog/src/org/smartfrog/sfcore/workflow/combinators/Delay.java 2006-11-28 17:12:22 UTC (rev 3671) +++ trunk/core/smartfrog/src/org/smartfrog/sfcore/workflow/combinators/Delay.java 2006-11-29 16:38:56 UTC (rev 3672) @@ -88,7 +88,7 @@ public synchronized void sfDeploy() throws SmartFrogException, RemoteException { super.sfDeploy(); - checkActionDefined(); + //checkActionDefined(); time = ((Integer)sfResolve(timeRef)).intValue(); } @@ -153,11 +153,16 @@ } synchronized (this) { if (!terminated && !isWorkflowTerminating()) { - try { - sfCreateNewChild(name + "_actionRunning", action, null); - } catch (Exception e) { - sfTerminate(TerminationRecord.abnormal( - "error in launching delayed component", name, e)); + if(action!=null) { + try { + sfCreateNewChild(name + "_actionRunning", action, null); + } catch (Exception e) { + sfTerminate(TerminationRecord.abnormal( + "error in launching delayed component", name, e)); + } + } else { + //no work to do; terminate + sfTerminate(TerminationRecord.normal(name)); } } } Modified: trunk/core/smartfrog/src/org/smartfrog/sfcore/workflow/combinators/delay.sf =================================================================== --- trunk/core/smartfrog/src/org/smartfrog/sfcore/workflow/combinators/delay.sf 2006-11-28 17:12:22 UTC (rev 3671) +++ trunk/core/smartfrog/src/org/smartfrog/sfcore/workflow/combinators/delay.sf 2006-11-29 16:38:56 UTC (rev 3672) @@ -20,7 +20,7 @@ #include "/org/smartfrog/sfcore/workflow/eventbus/eventbus.sf" -Delay extends ActionCompound { +Delay extends OptionalActionCompound { sfClass "org.smartfrog.sfcore.workflow.combinators.Delay"; delaySchema extends Schema { //delay in milliseconds Modified: trunk/core/smartfrog/src/org/smartfrog/sfcore/workflow/eventbus/eventbus.sf =================================================================== --- trunk/core/smartfrog/src/org/smartfrog/sfcore/workflow/eventbus/eventbus.sf 2006-11-28 17:12:22 UTC (rev 3671) +++ trunk/core/smartfrog/src/org/smartfrog/sfcore/workflow/eventbus/eventbus.sf 2006-11-29 16:38:56 UTC (rev 3672) @@ -49,7 +49,6 @@ eventCompoundSchema extends EventCompoundSchema; sendTo extends LAZY {} registerWith extends LAZY {} - } /** @@ -64,6 +63,9 @@ } } +OptionalActionCompound extends ActionCompound { + actionCompoundSchema:action:optional true; +} /** * A compound that can have a child component Modified: trunk/core/testharness/testcases/org/smartfrog/test/system/workflow/delay/DelayTest.java =================================================================== --- trunk/core/testharness/testcases/org/smartfrog/test/system/workflow/delay/DelayTest.java 2006-11-28 17:12:22 UTC (rev 3671) +++ trunk/core/testharness/testcases/org/smartfrog/test/system/workflow/delay/DelayTest.java 2006-11-29 16:38:56 UTC (rev 3672) @@ -49,4 +49,8 @@ expectAbnormalTermination((TestBlock) application); } + public void testDelayNoAction() throws Throwable { + application = deployExpectingSuccess(FILES + "testDelayNoAction.sf", "testDelayNoAction"); + expectSuccessfulTermination((TestBlock) application); + } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |