Unable to find Change Orders.Affected Items.Item Number in exit criteria
Hi,
I am trying to enter the below field in the exit required field of a workflow, the criteria is “All Change Orders”, I am unable to find below field in the selection.
Change Orders.Affected Items.Item Number
Thanks,
Surya
Hi Surya –
This is something that many people have wanted for a long time, but unfortunately there isn’t any way to enforce the presence of affected items through exit required fields.
One thing you can do – is create workflow criteria and/or status criteria to check for affected items before the workflow can be used or before the change can enter a particular status. The major downside to this (compared to exit required fields) is that there won’t be any specific error message telling the user exactly what the issue is – so it becomes a training issue.
Hi Danny,
Thanks for your suggestion, rather I better go with PX to stop routing of work flow with out the affected items in change.
Thanks,
Surya
Hi Surya,
The best way to go about it is writing a simple Groovy Script. Configure it on Change-Status event and in subscriber mention Error Handling Rule –> Stop.
Sample Script
——————
import com.agile.agileDSL.ScriptObj.IBaseScriptObj
import com.agile.agileDSL.ScriptObj.AgileDSLException;
import com.agile.api.*;
void invokeScript(IBaseScriptObj obj) {
try {
def session = obj.getAgileSDKSession()
IWFChangeStatusEventInfo eventInfo = obj.getPXEventInfo()
dataObject = eventInfo.getDataObject()
IChange m_change = (IChange)dataObject
ITable affectedItem = m_change.getTable(ChangeConstants.TABLE_AFFECTEDITEMS)
if (affectedItem.size()<=0) {
throw new AgileDSLException(“Please add Affected Item(s) prior to submitting this Change”);
}
}
catch(AgileDSLException ex) {
throw new AgileDSLException(ex.getMessage());
}
}
Regards,
Arif