Alternative for AgileDSLException

Hi,

When trying to stop autopromotion of a workflow, i am currently using “throw new AgileDSLException”. 

Is there an alternate way I can stop the autopromotion and show a message to user?

Add Comment
2 Answer(s)

Easy – just throw a regular exception.  This is kind of what I use.  Let me know if it doesn’t work for you.

try {
//condition 1
//must use -Pre, Synchronous, and Stop event subscriber settings and an equivalent catch block

Boolean valid = false
if (!valid) {   
   throw new Exception (“Hi, your ECO failed validation checks because of some reason. Please fix.”)
}

} catch (Exception ex) {
obj.logMonitor(ex.getMessage().toString());
throw new AgileDSLException(ex);
}

Agile Angel Answered on July 17, 2018.

Hi Matt,

Thank you. The code worked. I wanted to throw an error,say maybe in a dialog box or something. Currently,since i am throwing an exception, the error message is shown in the status change window and in a small red background colour portion. 

on July 20, 2018.
Add Comment

Hi Nikhil,

If you’re using Groovy, then yes, you have to throw DSLException to stop the promotion of workflow status if a condition is not satisfied or some error happens and propagate the message to users. There’s no other way than throwing the exception.

Agile Expert Answered on July 17, 2018.
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.