how to stop the workflow status from pending to submit through code

Hi All

In an assembly the parent attribute value is not matching the BOM attribute value. When the user clicks the SUBMIT status button in the ECO workflow it should validate the condition above and should not change the status to SUBMIT. In other words the status must remain as PENDING till both Parent and BOM attribute values match up. How to achieve this using SDK. Please help.

No Files Were Attached
JaiPanicker Agile User Asked on March 15, 2019 in Product Collaboration.
Add Comment
4 Answer(s)

Take a look at pre-events with the Groovy event framework. From there, you can prevent the action from occurring when there is an error.

keithrust Agile Angel Answered on March 15, 2019.
Add Comment

Thanks Keith for the update. But the customer is keen on java SDK and does not want the groovy script. Also I have never written a Groovy script before.

JaiPanicker Agile User Answered on March 18, 2019.
Add Comment

Read and practice on doing basic SDK code per Oracle documentation on Agile PLM SDK/px

Setup System Event , Event Handler , Event Subscription to launch your very simple PX that display an Exception message every time to verify that your PX code runs.
Disable the Event subscription once you know the PX is being triggered.

I am assuming that you know how to use eclipse to create a jar with correct META-INF/services/IEventAction  file to drop into the extensions folder on A9.

Add “meat’ to your PX code.  Try to write the logic in a separate class so that you can “test” it from outside of A9 PX environment.

When tested, package all into single jar and drop into the extensions folder – make sure to use a slightly different package name so you know that A9 is picking up your new PX and not the old PX.

sspak9 Agile Talent Answered on March 27, 2019.
Add Comment

1. Use groovy script to get Parent and Child attributes and create a Script Px event handler.

2. Check your condition in Script px code and if it fails use AgileDSLException to prevent it from moving to next state.
   For ex: throw new AgileDSLException (“Your Message that you want to show as a banner in agile screen when user tries to move the ECO to Submit from Pending”);

3. Use Event type ‘Change Status’ event.

4. In event subscriber set the error handling rule to ‘Stop‘ and execution mode must be in ‘Pre‘ state.

Kunal.G Agile User Answered on March 30, 2019.
Add Comment

Your Answer

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