I am trying to run a Informatica PowerCenter workflow using pmcmd command from Strawberry Perl. I am failing the working in case of any errored data received in the source files. Once PowerCenter workflow fails, I want to send an email from Perl script (not from Post session task in Session properties). Please help in capturing the workflow status from perl script. I really appreciate your time and help.
I tried multiple options like using system(), qw(), IPC::Run3 , IPC::System::Simple qw(system) etc but still I am not able to capture the success or failure of the workflow execution. I am aware of the pmcmd getworkflowdetails as well but that would be my last option.
use strict;
use warnings;
use IPC::Run3;
use IPC::System::Simple qw(system);
my ($stdout, $stderr,$command,$run);
$command = "pmcmd.exe startworkflow -sv......." # not putting the complete command as it is very lengthy
$run = run3($command);
if ( $run == 0) {
print "success";
} else {
print "fail ";
}
I have 2 workflows, 1 fails and 1 run successful. But whichever option I have tried, it gives same result for both the workflow execution.
Thank you Grinnz for your time and explanation ! It really helped for my knowledge. For my question, issue was with my pmcmd command. I was missing -wait option to use as an argument. Hence, pmcmd command was just returning a generic error code which was 0. After using -wait, I could capture the workflow failure status. Thanks once again !
For anyone out there facing same issue, here is the complete command I am using :
pmcmd.exe startworkflow -sv <integrationservice> -d <domain> -u <user> -p <pwd> -f <folder name> -paramfile <parameter file name> -wait <workflow name>