Author |
Message
|
MaheshPN |
Posted: Tue Aug 05, 2003 10:00 am Post subject: Auto completion/Terminating an activity |
|
|
 Master
Joined: 21 May 2003 Posts: 245 Location: Charlotte, NC
|
Hi,
I have a scenario where there are two parallel activities A and B . A is an UPES activity (synchronous) and B is a dummy activity(Business requirement).
I want to finish/Terminate activity B(automatically, like notification) as soon as activity A gets completed.
Assuming no other activities after this , is there any way to build like this in buildtime without using API's ?
Thanks,
Mahesh
IBM Certified Solution Expert - MQWorkflow |
|
Back to top |
|
 |
Ratan |
Posted: Tue Aug 05, 2003 10:52 am Post subject: |
|
|
 Grand Master
Joined: 18 Jul 2002 Posts: 1245
|
I belive you can do something like this (may be there are better approaches):
Have a member called Flag set to False in the i/p & o/p containers of both A and B.
have a data connector from A to B.
When Activity A completes set this Flag to True.
Have the Exit condition of B to Flag=True and put it in a block (for automatic execution).
When Activity A finishes, B will have its Exit condition met and it will finish. _________________ -Ratan |
|
Back to top |
|
 |
vennela |
Posted: Tue Aug 05, 2003 10:58 am Post subject: |
|
|
 Jedi Knight
Joined: 11 Aug 2002 Posts: 4055 Location: Hyderabad, India
|
I am not very good at building Workflow solutions, but how about this.
Let the second dummy activity also be a UPES synchronous activity. After you send the response to Activity A, you send the resonse to Activity B.
Anybody see any downsides to it. |
|
Back to top |
|
 |
MaheshPN |
Posted: Tue Aug 05, 2003 11:35 am Post subject: Auto completion/Terminating an activity |
|
|
 Master
Joined: 21 May 2003 Posts: 245 Location: Charlotte, NC
|
Hi Ratan,
I was trying your solution. I am getting an error, No control path from A to B.
Here is the FDL
/*
*
* FDL definitions generated by MQ Workflow at 2003-08-05, 3:30:51 PM.
*
*/
CODEPAGE 1252
FM_RELEASE V3R4 0
/*
* STRUCTUREs
*/
STRUCTURE 'test'
'flag': STRING;
END 'test'
/*
* PROGRAMs
*/
PROGRAM 'fmcnshow'
DESCRIPTION ""
STRUCTURES_FROM_ACTIVITY
NOT UNATTENDED
WINNT EXE PATH_AND_FILENAME "fmcnshow.exe"
INHERIT ENVIRONMENT
STYLE VISIBLE
START FOREGROUND
END 'fmcnshow'
/*
* PROCESSes
*/
/*
* PROCESS test
*/
PROCESS 'test' ( 'test', 'test' )
DO NOT PROMPT_AT_PROCESS_START
WINDOW VIEW_REFERENCE_POINT XPOS 0 YPOS 27
WINDOW SHOW ALL CONNECTORS
WINDOW SHOW NO CONDITIONS
SOURCE 2 XPOS -700 YPOS 500
SINK 3 XPOS 200 YPOS 400
PROGRAM_ACTIVITY 'ProgramA' ( 'test', 'test' )
START MANUAL WHEN AT_LEAST_ONE CONNECTOR TRUE
EXIT AUTOMATIC
LAYOUT XPOS -300 YPOS 700
NAME_POSITION XPOS -300 YPOS 625
PRIORITY DEFINED_IN INPUT_CONTAINER
PROGRAM 'fmcnshow'
SYNCHRONIZATION NESTED
END 'ProgramA'
PROGRAM_ACTIVITY 'ProgramB' ( 'test', 'test' )
START MANUAL WHEN AT_LEAST_ONE CONNECTOR TRUE
EXIT AUTOMATIC WHEN "flag = ""True""" XPOS -300 YPOS 150
LAYOUT XPOS -300 YPOS 300
NAME_POSITION XPOS -300 YPOS 225
PRIORITY DEFINED_IN INPUT_CONTAINER
PROGRAM 'fmcnshow'
SYNCHRONIZATION NESTED
END 'ProgramB'
DATA
FROM 'ProgramA' TO SINK 3
MAP '_STRUCT' TO '_STRUCT'
DATA
FROM SOURCE 2 TO 'ProgramA'
MAP '_STRUCT' TO '_STRUCT'
DATA
FROM SOURCE 2 TO 'ProgramB'
MAP '_STRUCT' TO '_STRUCT'
DATA
FROM 'ProgramA' TO 'ProgramB'
MAP '_STRUCT' TO '_STRUCT'
END 'test'
Even I also thought of UPES, there again some program needs to construct reply xml to complete the Activity.
Thanks,
Mahesh |
|
Back to top |
|
 |
Ratan |
Posted: Tue Aug 05, 2003 1:40 pm Post subject: |
|
|
 Grand Master
Joined: 18 Jul 2002 Posts: 1245
|
Yeah, It is wrong. We cant have a data connector from A to B unless there is a control flow from A to B ( too bad, I did not think of that). Well you can always write the flag to a table/ file and let B query that. When A finishes you can change the flag, B will read this and finish. It is the same as the first solution, the only difference is you have to write the flag to somewhere else instead of using WF data mapping.
-Ratan. _________________ -Ratan |
|
Back to top |
|
 |
Ratan |
Posted: Tue Aug 05, 2003 1:43 pm Post subject: |
|
|
 Grand Master
Joined: 18 Jul 2002 Posts: 1245
|
Venny, you solution looks cool, but I feel this logic should not be in the UPES. UPES should not worry about application logic. I dont like it to be intelligent as you suggest. Al it need to do is process ActivityInvoke messages in the order it receives.
What do you think? _________________ -Ratan |
|
Back to top |
|
 |
jmac |
Posted: Tue Aug 05, 2003 6:27 pm Post subject: |
|
|
 Jedi Knight
Joined: 27 Jun 2001 Posts: 3081 Location: EmeriCon, LLC
|
vennela wrote: |
I am not very good at building Workflow solutions, but how about this.
Let the second dummy activity also be a UPES synchronous activity. After you send the response to Activity A, you send the resonse to Activity B.
Anybody see any downsides to it. |
Venny:
How would "Real" UPES activity get the Correlation ID for "Dummy" activity. Without it you wouldnt be able to send the Response message.
It is my opinion that the easiest way to do this would be to use the MQWF API to Logon, Query the Workitem, ForceFinish it, Logoff.
GOOD LUCK _________________ John McDonald
RETIRED |
|
Back to top |
|
 |
vennela |
Posted: Wed Aug 06, 2003 5:10 am Post subject: |
|
|
 Jedi Knight
Joined: 11 Aug 2002 Posts: 4055 Location: Hyderabad, India
|
Quote: |
How would "Real" UPES activity get the Correlation ID for "Dummy" activity. Without it you wouldnt be able to send the Response message.
|
I thought about it after I posted the message. It may not work. But I told you beforehand I am not good at designing workflow processes.  |
|
Back to top |
|
 |
MaheshPN |
Posted: Wed Aug 06, 2003 7:38 am Post subject: Auto completion/Terminating an activity |
|
|
 Master
Joined: 21 May 2003 Posts: 245 Location: Charlotte, NC
|
Hi Guys,
Thanks for the inputs
Well let me mix and match all the solutions !!!
I will make the dummy activity to UPES activity and when the Activity A finishes, it will also send reply xml to Activity B UPES. hope this will work.
My question to Jhon is, which one is faster when there are more instaces?
Using UPES method or as you suggested, terminating the activity by logging. for this to happen I need to have one more activity after activity A which will terminate it.
Thanks,
Mahesh |
|
Back to top |
|
 |
vennela |
Posted: Wed Aug 06, 2003 8:43 am Post subject: |
|
|
 Jedi Knight
Joined: 11 Aug 2002 Posts: 4055 Location: Hyderabad, India
|
Mahesh:
UPES solution is definitely not the right one.
How can you get the CorrelId of the Activity B message corresponding to the ActivityA, when you have multiple process instances running. You will have to browse first and then get the message which I thing is slower than an API call. |
|
Back to top |
|
 |
|