Author |
Message
|
raghav |
Posted: Fri Apr 15, 2005 6:51 am Post subject: WF Activity Impl. - Calling Java pgm/Shell script on AIX |
|
|
Novice
Joined: 15 Apr 2005 Posts: 24
|
We are using MQSeries Workflow 3.4 (WMQ 5.3 CSD 4) and I am facing a problem when trying to call a Java program or Shell script from on activity.
Following is the fdl snapshot:
PROGRAM 'Dummy1' ( 'Default Data Structure', 'Default Data Structure' )
DESCRIPTION ""
NO STRUCTURES_FROM_ACTIVITY
UNATTENDED
AIX EXE PATH_AND_FILENAME "/usr/temp/dummy.sh"
PARAMETER ""
INHERIT ENVIRONMENT
RUN_IN_XTERM
WINNT EXE PATH_AND_FILENAME "java.exe"
PARAMETER "E:\General\Dummy1"
INHERIT ENVIRONMENT
STYLE VISIBLE
START FOREGROUND
END 'Dummy1'
PROCESS 'TestWF' ( 'Default Data Structure', 'Default Data Structure' )
DO NOT PROMPT_AT_PROCESS_START
WINDOW VIEW_REFERENCE_POINT XPOS 0 YPOS 54
WINDOW SHOW ALL CONNECTORS
WINDOW SHOW NO CONDITIONS
SOURCE 1 XPOS -800 YPOS 200
SINK 1 XPOS 500 YPOS 200
PROGRAM_ACTIVITY 'Program' ( 'Default Data Structure', 'Default Data Structure
' )
START AUTOMATIC WHEN AT_LEAST_ONE CONNECTOR TRUE
EXIT AUTOMATIC WHEN "_RC=0" XPOS -200 YPOS 50
LAYOUT XPOS -200 YPOS 200
NAME_POSITION XPOS -200 YPOS 125
PRIORITY DEFINED_IN INPUT_CONTAINER
PROGRAM 'Dummy1'
SYNCHRONIZATION NESTED
END 'Program'
DATA
FROM SOURCE 1 TO 'Program'
MAP '_STRUCT' TO '_STRUCT'
DATA
FROM 'Program' TO SINK 1
MAP '_STRUCT' TO '_STRUCT'
END 'TestWF'
Following is the content within dummy.sh:
. /usr/env/setenv.sh
export CLASSPATH=/usr/temp:$CLASSPATH
java Dummy1
echo "bye"
During runtime, this activity does not get completed. It returns to the "Ready" state without logging any error
Any idea why this activity is not getting completed..? |
|
Back to top |
|
 |
jmac |
Posted: Fri Apr 15, 2005 7:07 am Post subject: |
|
|
 Jedi Knight
Joined: 27 Jun 2001 Posts: 3081 Location: EmeriCon, LLC
|
What is the value of _RC?
if it is not 0 you are getting the expected result.
EXIT AUTOMATIC WHEN "_RC=0" _________________ John McDonald
RETIRED |
|
Back to top |
|
 |
raghav |
Posted: Fri Apr 15, 2005 7:29 am Post subject: |
|
|
Novice
Joined: 15 Apr 2005 Posts: 24
|
Following is the explanation I found about "_RC":
_RC This data member contains the return code of the activity
implementation when the implementation is a program. Typically it is
used to evaluate exit and transition conditions. It cannot be read from
input containers and, unless it has not been set explicitly, it is
automatically set to the exit code of the activity implementation when
that program ends. If set explicitly, then that value stays.
In cases where your compiler does not support an exit code, you can
use the Container API to set its value.
Data type: LONG
As I understand, "_RC=0" means that the activity was completed successfully. |
|
Back to top |
|
 |
jmac |
Posted: Fri Apr 15, 2005 11:38 am Post subject: |
|
|
 Jedi Knight
Joined: 27 Jun 2001 Posts: 3081 Location: EmeriCon, LLC
|
I know what _RC is....
What I am asking you is what value are you setting to _RC. You are running from a shell script, so I would imagine that the value is not being set automatically.
Also, your thought on _RC=0 means successful, may be right if that's what you want it to mean... I think you should read some of the doc that is referenced in this forum to get a handle on how MQWF works. _________________ John McDonald
RETIRED |
|
Back to top |
|
 |
kotha |
Posted: Fri Apr 15, 2005 12:13 pm Post subject: |
|
|
Partisan
Joined: 12 Mar 2005 Posts: 333
|
What is the importance of _RC?. I have come across it many times. In some of the examples, they use it in build time model?
Can you give brief idea?
thank you |
|
Back to top |
|
 |
jmac |
Posted: Fri Apr 15, 2005 12:34 pm Post subject: |
|
|
 Jedi Knight
Joined: 27 Jun 2001 Posts: 3081 Location: EmeriCon, LLC
|
It is my opinion that _RC is just another variable. This is definitely true in the case where you use Checkout/Checkin as opposed to Start. Of course, this means that _RC is most useful in a Fat client environment.
Personally, I never use _RC anymore. In my old Fat Client days, I used to use it quite a bit, but no longer. _________________ John McDonald
RETIRED |
|
Back to top |
|
 |
raghav |
Posted: Sun Apr 17, 2005 9:53 pm Post subject: Reg. _RC = 0 |
|
|
Novice
Joined: 15 Apr 2005 Posts: 24
|
Hi,
You are right. We are not setting any value explicitly to _RC. But, we are assuming that when a shell script is called successfully, WF will set _RC=0, specifying the activity was completed successfully.
Let me know if I need to set _RC explicitly / make changes to the fdl to make it work. |
|
Back to top |
|
 |
hos |
Posted: Mon Apr 18, 2005 12:17 am Post subject: |
|
|
Chevalier
Joined: 03 Feb 2002 Posts: 470
|
Hi,
what triggers the setting of _RC is not the (successfull) call of a
program/shell script but how it exits. I am not a UNIX guy but I would assume that you can say something like
in your script. I would expect this to set _RC (
would set it to 99). Alternately you could set _RC in your Java Program. |
|
Back to top |
|
 |
raghav |
Posted: Thu Apr 21, 2005 9:30 pm Post subject: |
|
|
Novice
Joined: 15 Apr 2005 Posts: 24
|
Hi,
This is working now. We were able to call java program successfully from the process. Problem was with db2 password we were using. Earlier it was 10 charecters. Now, we had reduced it to 8 charecters. After that we were able to call java program successfully. |
|
Back to top |
|
 |
jmac |
Posted: Fri Apr 22, 2005 5:24 am Post subject: |
|
|
 Jedi Knight
Joined: 27 Jun 2001 Posts: 3081 Location: EmeriCon, LLC
|
I would think that this should have been generating some error messages in fmcsys.log and fmcerr.log. I am assuming you are talking about the DB2 password for the RTDB. You should always have a look at these files for information to help in your debugging. _________________ John McDonald
RETIRED |
|
Back to top |
|
 |
|