We have an adaptor that runs several custom tools. We're able to parse the output of many of the tool using Regex, but we have a new tool that has no output; it just has a return code of 0 (pass) or 1 (fail).
I'd like to fail the adaptor if this tool comes back with a fail, but according to the adaptor docs, there's no way to check the return code of a command run by an <execute> block.
I'm able to modify the tool to print something to stdout, but I didn't want to do this if I didn't have to.
Has anyone else been able to get the return code of a command run with <execute> from within an adaptor? Is this possible? If so, how do you do it?
Thanks for your time,
NOTICE: developerWorks Community will be offline May 29-30, 2015 while we upgrade to the latest version of IBM Connections. For more information, read our upgrade FAQ.
This topic has been locked.
3 replies Latest Post - 2010-05-12T07:07:58Z by sngping
Pinned topic How can I get the return code of a command run with <execute> in an Adaptor
Answered question This question has been answered.
Unanswered question This question has not been answered yet.
Updated on 2010-05-12T07:07:58Z at 2010-05-12T07:07:58Z by sngping
drnilsson 060001TR1E1 PostACCEPTED ANSWER
Re: How can I get the return code of a command run with <execute> in an Adaptor2010-05-11T21:22:00Z in response to SystemAdminNot sure if it is what you need, but it sounds like it may solve the issue. Do you think you could save the return in a variable and then test the variable in a conditional step? I did something like this on a project and it worked well.
SystemAdmin 110000D4XK805 PostsACCEPTED ANSWER
Re: How can I get the return code of a command run with <execute> in an Adaptor2010-05-11T22:00:49Z in response to drnilssonCan you tell me exactly how you did this? I have not been able to get the return value of the call. Instead, I had to make my tool write out "success", and have the adaptor regex against the output, looking for "success".
What syntax did you use in the adaptor to get the return code of a process launched with <execute>? The docs dont mention anything like this.
sngping 270001Y6HM1 PostACCEPTED ANSWER
Re: How can I get the return code of a command run with <execute> in an Adaptor2010-05-12T07:07:58Z in response to SystemAdminThere is no way other than using the <resultsblock> coupled with <match> tag to parse the output of <execute>, unless I am missing something like you.