HI,
is it possible to send a email notification when the workflow finish failed ?
rgds
jeremie
I highly recommend Burke's approach since there's a lot of nuances that make a general solution will not work perfectly. There is also a high likelihood that if you haven't gotten e-mails or Error Handling to work that you are pretty new to vCO, so that website would be the BEST place to start! I'm sure they have examples of error handling and e-mails, but perhaps not e-mails for error handling...
With that said, I can try to help you along quickly... here are some quick and dirty steps to get something going... you may need the e-mail plugin installed... I'm not sure...
1. For all scripts or places where workflows can fail, bind the Exception variable to a string attribute of your choosing (I will call this ErrorText)
2. Link the exception workflow routes (instead of a normal blue color, link the red color) to a script. Make sure this script has access to ErrorText.
3. Inside the script, use the following (sloppily written) e-mail function:
function send_email(subject, body)
{
var message = new EmailMessage();
message.smtpHost = "xxxx.xxx.xxx.xxx";
message.fromName = "vCD Admin";
message.fromAddress = "vCD_Admin@example.com";
message.toAddress = emailReceivers();
message.subject = subject;
message.addMimePart(body,"text/html; charset=UTF-8");
System.log( "sending mail from:" + message.fromAddress + ", to:" + message.toAddress );
message.sendMessage();
}
send_email("Notice: Workflow Error",ErrorText);
Sure, sort-of ...
If you have a workflow that has the potential of failing, you should either build in error handling within the workflow and pass the errorCode details to a Send E-mail Notification workflow OR Create another workflow that calls the one that could fail.. Add error handler to this one that sends the e-mail.
COuld you show me an exemple ?
I recommend you start your journey with vCO by reading a few blogs... mine is a good source of detail (http://www.vcoteam.info ), but for your particular question, I would actually recommend you read James Bowling's (@vsential) series of posts here: vCenter Orchestrator: Operation Automate – Part One | vSential. This article series includes exception handling and e-mail notifications
I highly recommend Burke's approach since there's a lot of nuances that make a general solution will not work perfectly. There is also a high likelihood that if you haven't gotten e-mails or Error Handling to work that you are pretty new to vCO, so that website would be the BEST place to start! I'm sure they have examples of error handling and e-mails, but perhaps not e-mails for error handling...
With that said, I can try to help you along quickly... here are some quick and dirty steps to get something going... you may need the e-mail plugin installed... I'm not sure...
1. For all scripts or places where workflows can fail, bind the Exception variable to a string attribute of your choosing (I will call this ErrorText)
2. Link the exception workflow routes (instead of a normal blue color, link the red color) to a script. Make sure this script has access to ErrorText.
3. Inside the script, use the following (sloppily written) e-mail function:
function send_email(subject, body)
{
var message = new EmailMessage();
message.smtpHost = "xxxx.xxx.xxx.xxx";
message.fromName = "vCD Admin";
message.fromAddress = "vCD_Admin@example.com";
message.toAddress = emailReceivers();
message.subject = subject;
message.addMimePart(body,"text/html; charset=UTF-8");
System.log( "sending mail from:" + message.fromAddress + ", to:" + message.toAddress );
message.sendMessage();
}
send_email("Notice: Workflow Error",ErrorText);
MAny thanks for the links and answers.
sorry for all this questions but I'm beginner on vCO and it's not easy but very insterresting.
We are my masters
I know this is already answered but thought I would contribute a workflow monitor I created a while back. I added the details in the Documents section: