Focal Point
GOTO next process and stored procedure

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/8971032902

January 24, 2007, 09:31 AM
DarrenH
GOTO next process and stored procedure
Hi all,
I have a relatively simple task that I'm struggling a little with. I have 9 flows together in a process. Each time a flow completes (even if it fails) I want it to run a stored procedure and then move onto the next flow.
So far I have tried using:
-Big GrinEP_0
-TYPE (ICM18027) DEP_0: flow ftpbank started.
EX CMASAP REQ_NAME = ftpbank, CM_ASYNC = OFF, APPDIR = cmc, DEP_ALIAS = DEP_0, PRNT_REQ = &&CM__REQUEST
-RUN
-IF (&&KILL_RPC EQ 'Y') GOTO :STOPRPCS;
-TYPE (ICM18039) DEP_0 ftpbank Return Code = &&DEP_0_RC
-IF (&&DEP_0_RC EQ 0) GOTO Big GrinEP_1;
-IF (&&DEP_0_RC EQ 0) GOTO Big GrinEP_19;
-IF (&&DEP_0_RC NE 0) GOTO Big GrinEP_19;
-GOTO :ENDDEP
But this seems to go only to DEP_1 and not DEP_19. How to I get it to run both DEP_1 and DEP_19 if the condition is met?

Many thanks in advance!


Prod: Service Manager 5.5 - DataMigrator 7.6 - Win2K
Test: Service Manager 5.5 - DataMigrator 7.6 - Win2K
Local: DevStudio 5.5.3 - Management Console
- Windows XP SP2
January 24, 2007, 09:42 AM
Fernando
Darren,

A goto can only go to one place. You need to adjust your logic. I am guessing that all of your flows may run the same procedure and therefore go to the same label. So here are two choices.

1) Use different labels:
-IF (&&DEP_0_RC EQ 0) GOTO EP_1_19;

Then EP_1_19 would do both the actions of EP_1 and EP_19. This would require a lot of labels.

2) Use a variable as a second jumping point and test that at the end of EP_1

-SET &NEXT_JUMP=IF (&&DEP_0_RC EQ 0) THEN 19;
-IF (&&DEP_0_RC EQ 0) GOTO EP_1;
-EP_1
Your rpc stuff goes here
-IF (&NEXT_JUMP EQ 19) GOTO EP_19;

Fernando


Prod WF 8.1.04, QA WF 8.2.03, Dev WF 8.2.03
January 25, 2007, 09:05 AM
DarrenH
Ok. Thanks for that. I've changed the logic so that the sproc is called regardless, and I just update the status variable before I call the sporc and pass the parameters across.
Thanks guys!


Prod: Service Manager 5.5 - DataMigrator 7.6 - Win2K
Test: Service Manager 5.5 - DataMigrator 7.6 - Win2K
Local: DevStudio 5.5.3 - Management Console
- Windows XP SP2