Topic
  • 3 replies
  • Latest Post - ‏2010-05-12T07:07:58Z by sngping
SystemAdmin
SystemAdmin
805 Posts

Pinned topic How can I get the return code of a command run with <execute> in an Adaptor

‏2010-05-04T15:16:52Z |
Greetings,

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,

-Adam Volker-Yoblick
Updated on 2010-05-12T07:07:58Z at 2010-05-12T07:07:58Z by sngping
  • drnilsson
    drnilsson
    1 Post

    Re: How can I get the return code of a command run with &lt;execute&gt; in an Adaptor

    ‏2010-05-11T21:22:00Z  
    Not 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
    SystemAdmin
    805 Posts

    Re: How can I get the return code of a command run with &lt;execute&gt; in an Adaptor

    ‏2010-05-11T22:00:49Z  
    • drnilsson
    • ‏2010-05-11T21:22:00Z
    Not 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.
    Can 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.

    Thanks!
  • sngping
    sngping
    1 Post

    Re: How can I get the return code of a command run with &lt;execute&gt; in an Adaptor

    ‏2010-05-12T07:07:58Z  
    There 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.