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?

Add Comment
4 Answer(s)

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

Agile Angel Answered on October 17, 2018.
Add Comment
Best answer

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?

Agile Expert Answered on October 17, 2018.

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!

on October 18, 2018.

Yes the event type will be Change Status for Workflow

on October 18, 2018.
Add Comment

Actually, all PXes are synchronous. Here is a snippet from the SDK Developer Guide – Developing PLM extensions

<<

Can Process Extensions support asynchronous operations?
Agile Process Extensions only support synchronous operations. If your Process Extension requires asynchronous behavior, you must modify your PX code to
implement asynchronous solutions of your choice. For example, you can spawn a thread.
>>

Not exactly sure why Agile displays the message in Action based PX and not in Workflow transition. But, that’s how it works

Agile Angel Answered on October 18, 2018.
Add Comment

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.

RE: Display Message during Workflow Transition from PX

Agile Angel Answered on October 22, 2018.
Add Comment

Your Answer

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