ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » Workflow Engines - IBM MQ Workflow & Business Process Choreographer » WF Activity Impl. - Calling Java pgm/Shell script on AIX

Post new topic  Reply to topic
 WF Activity Impl. - Calling Java pgm/Shell script on AIX « View previous topic :: View next topic » 
Author Message
raghav
PostPosted: Fri Apr 15, 2005 6:51 am    Post subject: WF Activity Impl. - Calling Java pgm/Shell script on AIX Reply with quote

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
View user's profile Send private message
jmac
PostPosted: Fri Apr 15, 2005 7:07 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger
raghav
PostPosted: Fri Apr 15, 2005 7:29 am    Post subject: Reply with quote

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
View user's profile Send private message
jmac
PostPosted: Fri Apr 15, 2005 11:38 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger
kotha
PostPosted: Fri Apr 15, 2005 12:13 pm    Post subject: Reply with quote

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
View user's profile Send private message
jmac
PostPosted: Fri Apr 15, 2005 12:34 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger
raghav
PostPosted: Sun Apr 17, 2005 9:53 pm    Post subject: Reg. _RC = 0 Reply with quote

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
View user's profile Send private message
hos
PostPosted: Mon Apr 18, 2005 12:17 am    Post subject: Reply with quote

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
Code:
EXIT 0
in your script. I would expect this to set _RC (
Code:
EXIT 99
would set it to 99). Alternately you could set _RC in your Java Program.
Back to top
View user's profile Send private message
raghav
PostPosted: Thu Apr 21, 2005 9:30 pm    Post subject: Reply with quote

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
View user's profile Send private message
jmac
PostPosted: Fri Apr 22, 2005 5:24 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » Workflow Engines - IBM MQ Workflow & Business Process Choreographer » WF Activity Impl. - Calling Java pgm/Shell script on AIX
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.