Display Message during Workflow Transition from PX
We’ve created a Process Extension which performs some validation during Workflow Transitions. With Action Menu Process Extensions we can return a ActionResult that accepts a Serializable result. That result is typically displayed with a Yellow background.
It appears this result is ignored if the Change Order is moving through a Workflow. I’ve tried creating a simple PX which returns a String and automatically fails a Workflow transition and the only thing that happens is the message is put in the History tab.
Is there a way to display Text to the user if a PX fails a Workflow transition?
Hello
So, you want the PX to run some validation checks, display results to user and stop going to next step in the workflow? If so, you need to do this in a pre-event. I don’t think you can do in a PX
Workflow PXs run in the background in async mode in Agile so you won’t be able to achieve what you’re trying to. If you wanna do some validation during the status change & stop proceeding further if the check fails with showing error message in the UI, you need to achieve it using the Event Framework and its Pre subscriber with Error Handling rule set to Stop. Have you given a thought about it?
Our PX is on the Workflow itself, and it does stop the transition from proceeding. It however, does not show the error message to the user. It is only in the History tab.
Would the Event Type be ‘Change Status for Workflow’?
We are able to stop it from transitioning by essentially rolling it back. It’s displaying the Error Message to the user on the same screen that does not work. As it is Async that makes sense as to why it wouldn’t show an error message.
Thank you!
Actually, all PXes are synchronous. Here is a snippet from the SDK Developer Guide – Developing PLM extensions
<<
>>
Not exactly sure why Agile displays the message in Action based PX and not in Workflow transition. But, that’s how it works
Hi,
I just configured a simple groovy event and as Swagoto suggested it’s doable following that pattern.
Kept the same config:
Trigger Type : Pre ; Execution Mode : Synchronous ; Error Handling : Stop
In-code kept one simple condition and printed the error:
if (MyConditionIsTrue) {
throw new AgileDSLException(“Please enter the value for attribute on Change “+ dataObject.getName());
}
}
It will display error on Workflow Status transition screen.