Author |
Message
|
jhea |
Posted: Fri Jan 24, 2003 2:26 am Post subject: restart an activity after it expires |
|
|
Novice
Joined: 18 Dec 2002 Posts: 19 Location: UK Hursley
|
Hi,
I want an activity to be restarted after it expires. I set its Exit condition to _RC=0. It expires after 2 minites in the status of either 'ready' or 'running' with scheduling server running at 1-m notification check interval, 1-m check interval, and autostart. However it doesn't restart after expiry, instead the process proceeds to the next activity . Any comments why this happens? Any hits to resolve this?
Cheers,
Jenny |
|
Back to top |
|
 |
yaakovd |
Posted: Fri Jan 24, 2003 5:17 am Post subject: |
|
|
Partisan
Joined: 20 Jan 2003 Posts: 319 Location: Israel
|
You must add Data Loop Connector on your activity, it working together.
Take block activity with Data Loop Connector and Exit condition on it. Put your Programm activity inside, add Data default connector on it self (when activity expired - it will transfer data from input to output, other you will loose your data).
You can do it without Block, but both of connectors are required. _________________ Best regards.
Yaakov
SWG, IBM Commerce, Israel |
|
Back to top |
|
 |
jmac |
Posted: Fri Jan 24, 2003 7:17 am Post subject: |
|
|
 Jedi Knight
Joined: 27 Jun 2001 Posts: 3081 Location: EmeriCon, LLC
|
Jenny wrote: |
I want an activity to be restarted after it expires. I set its Exit condition to _RC=0. |
I believe that the way to get what you need is to add an activity that will receive control via the Transition Condition
Code: |
_State() <> _Expired |
Now your original activity and this new activity will have to be in a Block
This new activity activity will have to set an item in the Sink of the Block such that the Block fails its exit conditon.
The reason you need to do this is because it is my opinion that when an activity expires the Exit condition is not evaluated.
Note that I have NOT tested this, but I believe it should work... If you try this please let us know. _________________ John McDonald
RETIRED |
|
Back to top |
|
 |
dkrawczynski |
Posted: Fri Jan 24, 2003 9:51 am Post subject: |
|
|
 Apprentice
Joined: 19 Dec 2002 Posts: 26 Location: Dallas, TX
|
The behavior you are seeing is correct. Expiration means the workitem will exit the activity. I have tested expiration on activities that have exit conditions and the exit condition is ignored just like it is if you force finish a workitem. If you want an expired workitem to reappear in the same activity you must do as John explained in the previous post.
Why are you using the expiration feature if you do not wish the workitem to leave the activity? Also, what is the purpose of "restarting" an activity every two minutes? Answers to these questions may lead to alternative solutions that do not involve using the expiration feature. _________________ Doug Krawczynski
IBM Certified Solutions Expert -
MQSeries Workflow |
|
Back to top |
|
 |
jhea |
Posted: Fri Jan 24, 2003 10:19 am Post subject: |
|
|
Novice
Joined: 18 Dec 2002 Posts: 19 Location: UK Hursley
|
Many thanks to the replies. I have made some experiments. Here are the findings:
1) as John said, when the activity expires, the exit condition for the activity doesn't get evaluated, which makes sense.
2) I coudn't use _State() <> _Expired as the transition condition because the buildtime complains both of _State and _Expired are not valid.
3) I used setup suggested by Yaakov, i.e. to put the activity in a block, connected to a source and sink as it is simpler solution. the block exit condition used is to evaluate a member of the output data container of the block. It successfully achieved my purpose.
Have a nice weekend.
Jenny |
|
Back to top |
|
 |
jmac |
Posted: Fri Jan 24, 2003 10:25 am Post subject: |
|
|
 Jedi Knight
Joined: 27 Jun 2001 Posts: 3081 Location: EmeriCon, LLC
|
Jenny wrote: |
I coudn't use _State() <> _Expired as the transition condition because the buildtime complains both of _State and _Expired are not valid. |
What version of MQWF are you using? Both of these are certainly valid, in fact I ran a test before I sent my original response. _________________ John McDonald
RETIRED |
|
Back to top |
|
 |
jhea |
Posted: Fri Jan 24, 2003 10:26 am Post subject: |
|
|
Novice
Joined: 18 Dec 2002 Posts: 19 Location: UK Hursley
|
Doug,
Quote: |
Why are you using the expiration feature if you do not wish the workitem to leave the activity? |
This is because the activity we are trying to implement involving third-party system. If the third-party system is down for sometime, we would like the activity to give some response back to the use, and let the user to decide if to restart the activity or not.
Quote: |
Also, what is the purpose of "restarting" an activity every two minutes? |
To make it restart every two minutes is just for testing purpose
Many thanks to your opinion.
Jenny |
|
Back to top |
|
 |
jhea |
Posted: Fri Jan 24, 2003 10:31 am Post subject: |
|
|
Novice
Joined: 18 Dec 2002 Posts: 19 Location: UK Hursley
|
Quote: |
What version of MQWF are you using? |
I use 3.3.2 no CSD. Is _State a member of output container of the activity? I couldn't see it though. Maybe that's the reason why the transition condition wasn't accepted. By the way, is _State the same as _State()?
Cheers,
Jenny |
|
Back to top |
|
 |
jmac |
Posted: Fri Jan 24, 2003 10:40 am Post subject: |
|
|
 Jedi Knight
Joined: 27 Jun 2001 Posts: 3081 Location: EmeriCon, LLC
|
_State() is a Builtin function added w/ V 330 I believe.
_State is not valid.
Look at the doc in Buildtime by using the Help button and you can see the syntax. _________________ John McDonald
RETIRED |
|
Back to top |
|
 |
|