Status change events do not seem to fire when status is updated via PX
We are still currently on Agile 9.3.2.
I’ve written a Groovy script PX which runs multiple validations on a Change order. Once it determines that validations pass, it advances the CO to the next status. In that next status, there are multiple Java PXs that are configured to run on a “Change Status for Workflow” event. These events, handlers, and subscribers are all setup correctly and have never had an issue running when the user manually advances the workflow status. It is the fact that a PX is changing the status that seems to prevent the “Change Status for Workflow” from being triggered. Is there a way to “force” that event to be triggered from the Groovy PX? Is this a bug within Agile 9.3.2, or is this by design for some reason?
Events are only triggered by users in the web or Java clients, unfortunately. PXs, WSXs, Import, etc., do not trigger events. In this case you might consider the Groovy script to be a pre event script upon changing the status, then prevent the change if there are issues.
Hi again Keith.
I’ve given your pre-event suggestion some thought and feel like this is worth looking into. It seems like one of our developers tried pre-events before but found some issue with using them. At this point, I can’t recall what that issue was, so I’d like to know more about it. I’m assuming that the event object must have a method to tell it there is an error and prevent it from going forward. Either that, or I’m guessing you must force a particular exception to occur. Do you know what syntax I might use to cause the pre-event to not trigger the event?
Thank you both Keith and “D”. I’ve tried your suggestions, but here’s what I’m running into if I use PRE… When going from a Pending state to either Submitted or Review, Agile’s default behavior is to pop-up the “Change Status” dialog box to request users to select approvers, etc. No PX will begin until the Finish button is clicked. During the time that the PX runs, the dialog remains open while things process. One of the critical functions of my PX is to populate both a page 3 attribute and the history with information. Once this happens, an “Object has been modified” error is shown within the dialog. I believe this happens whether the PX passes of fails. The question now is… is there any known workaround? Can the dialog be suppressed? I don’t think it can be done by the PX because, like I said, the dialog come up prior to the PX being triggered.
I do not remember correctly, but it occurs to me that you have posted something similar a couple of days ago, may be am wrong.
Unfortunately I don’t quite get a clear picture of what you’re trying to achieve and what has been implemented in your system. And it seems to me you’ve used the words PX both for an Custom Action Process Extension as well as an Event, which is why it’s a little ambiguous to me.
Nevertheless, to answer your last question about getting Object Has Been Modified message when you click on Finish button of the Change Status pop up: you said you’ve configured a Pre Event for some validation on this change status event of the CO, right? In that case, it’s Agile’s default behavior that if you use Pre subscriber to check or validate something, you won’t be able to set any attribute’s value or perform any ‘write’ operation on any data object like changing status of an ECO, in the same thread. If you try to do, you’ll get the Object Has Been Modified error message.
Let me know if it helps and if you need any more suggestions.