You can make the beanshell normally pass thru the json output, but when an
error is detected, instead return an Exception object:

if(everythingFine) {
out1=in1;
} else {
out1=new Exception("Invalid results");
}

Downstream workflow processors receiving out1 will then bail out on the
error, just as if the REST activity had failed on http errors.

Alternatively you can use
throw new Exception("Invalid results"), the msin difference is that this
would look like the beanshell itself failed.
 On 29 Jul 2014 22:33, "Kotliarov, Alex (NIH/NLM/NCBI) [C]" <
[email protected]> wrote:

>  Hello,
>
>
>
> What would be a proper way to signal that a step has failed?
>
>
>
> Use-case:
>
> -          HTTP API returns status code 200, and sends back a JSON object
> that describes result of a request
>
> -          A “Bean Shell” script parses JSON reply, detects that HTTP
> request failed and has to raise some sort of exception to stop workflow
> run.
>
>
>
>
>
> Thank you,
>
>
>
> Alex Kotliarov
>
>
>
>
> ------------------------------------------------------------------------------
> Infragistics Professional
> Build stunning WinForms apps today!
> Reboot your WinForms applications with our WinForms controls.
> Build a bridge from your legacy apps to the future.
>
> http://pubads.g.doubleclick.net/gampad/clk?id=153845071&iu=/4140/ostg.clktrk
> _______________________________________________
> taverna-users mailing list
> [email protected]
> [email protected]
> Web site: http://www.taverna.org.uk
> Mailing lists: http://www.taverna.org.uk/about/contact-us/
>
>
------------------------------------------------------------------------------
Infragistics Professional
Build stunning WinForms apps today!
Reboot your WinForms applications with our WinForms controls. 
Build a bridge from your legacy apps to the future.
http://pubads.g.doubleclick.net/gampad/clk?id=153845071&iu=/4140/ostg.clktrk
_______________________________________________
taverna-users mailing list
[email protected]
[email protected]
Web site: http://www.taverna.org.uk
Mailing lists: http://www.taverna.org.uk/about/contact-us/

Reply via email to