cancel
Showing results for 
Search instead for 
Did you mean: 

Redwood REL Expression check spool file output

awreyaaaaah
Discoverer
0 Kudos

Hi,

I would like to make a precondition for a system_mail_send inside a chain whether it should run or skip. The expression I would like is to check whether the data inside a spool have "Failed" word. if there is, the Error notification system mail send will run and if there is none, it will skip.

AlexGourdet
Product and Topic Expert
Product and Topic Expert
0 Kudos

Thank you for visiting SAP Community to get answers to your questions.

As you're looking to get most out of your community membership, please consider include a profile picture to increase user engagement & additional resources to your reference that can really benefit you:

I hope you find this advice useful, and we're happy to have you as part of SAP Community!

All the best,

Alex

gmblom
Active Contributor

Hello,

The easiest way to achieve this is by adding a File Search on the SAP job and set an alternative Return Code in the case the "Failed" keyword was found. Then you can use the JobChainParameters.getReturnCode builtin REL expression on the precondition.

Regards Gerben

awreyaaaaah
Discoverer
0 Kudos

Hi Gerben,

Thanks for your reply. But i am not familliar with scripting, will you be able to provide a step by step process on how can i do this? Your help is very much appreciated. Thankyou so much.

Regards,

Au

View Entire Topic
h_carpenter
Active Contributor
0 Kudos

Hi,

Hardly any scripting required.

Perform a search similar to the above, you might want to change the Filename for the search.

Now, you need to specify a precondition in the chain, getJobReturnCode wants <step_name>, Job <job_number_in_step>, here first job of step named Step 2 - I set the return code to 123 above in the file search when Failed is found, here, I need to compare that it is 123 in the precondition:

=JobChainParameters.getJobReturnCode('Step 2, Job 1') == 123



Hope this helps!

Best regards,

HP