cancel
Showing results for 
Search instead for 
Did you mean: 

Run Operating System Commands to trigger mail.

Former Member
0 Kudos

Hi Experts ,

    I wish to execute a operating system command to trigger mails based on certain payloads in the payload body . Is it possible . And if yes , can some one help me with the code.

  I am planning to  run the  Operating system command after message processing .

Thanks and Regards,

Arnab Mondal.

Accepted Solutions (0)

Answers (1)

Answers (1)

RaghuVamseedhar
Active Contributor
0 Kudos

Abhishek,

Depending on PI server OS. To trigger email, in UNIX (write shell script), in Windows (write batch scripting).

OS Commands are difficult to maintain and they are not encouraged. Please let us know, what is the actual requirement (the more details the better).

Former Member
0 Kudos

The OS is Windows  2012. I need to send a mail to the management each time  the SFTP channel is used to send a file to Vendor. The payload / subject line to have one of the contents ( Order Number ) from the payload.

So , in a day , multiple orders go to Vendors . And the order number needs to be send to Management. Management only needs records of  successful SFTP flows only. It should not be the case , that the channel has failed , but mail gets triggered.

( The maintain order at runtime concept with a parallel mail flow in ICO was ruled out by management as this was a risk , the first flow , if fails , will prevent other orders to the same vendor to be stuck .

Regards,

Abhi 

Former Member
0 Kudos

Hi,

One approach could be using acknowledgements. If you receive a successful acknowledgemnt, trigger an email from the BPM.

Thanks,

Sudhansu

RaghuVamseedhar
Active Contributor
0 Kudos

Abhishek,

To send email from Window Server, Powershell should be installed. Link.

I think, using File/FTP protocol it is difficult to get acknowledgement. Use web-service (https, soap). If possible, request target team to develop a synchronous web-service and consume it.

Former Member
0 Kudos


Hi , thanks for the info.

But can you tell me if I apply this code to send emails after : Run operating system commands after message processing " does that make sure that the channel has successfully placed the file in SFTP folder?

Does it guarantee that or it is independent of the success/failure of the SFTP channel putting / failing to place the file .

Regards,

Arnab.

Former Member
0 Kudos

Hi,

When we use "Run operating system commands after message processing". It gives an Information in the audit log of PI instead of Success/Failure. It would be difficult to understand from the SFTP adapter logs whether the OS command has been successful.

AFAIF you will have to go into the file logs of the OS to ensure whether the file posting has been successful.

Thanks,

Sudhansu