Community Tip - Did you get an answer that solved your problem? Please mark it as an Accepted Solution so others with the same problem can find the answer easily. X
Hi, Myself Akash,
here in Promotion Request, having set object state event that contains below expression (screenshot)
this expression only setting to iteration which is added as a promotion Object, below iterations are still having same previous state.
need API for set state all iterations in same revision of Promotion Object.
Solved! Go to Solution.
Hi @AS_10747835
That API does not exists. You need to create own method where you set the state to all iterations of the object.
OOTB each iteration can be in different state.
PetrH
Hi @AS_10747835
That API does not exists. You need to create own method where you set the state to all iterations of the object.
OOTB each iteration can be in different state.
PetrH
If you knows please suggest few methods.
i can write a method inside expression page of that robo or write it in workflow helper java file?
Hi @AS_10747835
You can try this code:
if (primaryBusinessObject instanceof PromotionNotice)
{
PromotionNotice promotionNotice = (PromotionNotice) primaryBusinessObject;
QueryResult qr = null;
State newState = promotionNotice.getMaturityState();
try
{
qr = MaturityHelper.service.getPromotionTargets(promotionNotice);
} catch (WTException e)
{
e.printStackTrace();
}
WTList objectToSetState = new WTArrayList();
while (qr.hasMoreElements())
{
objectToSetState.add(qr.nextElement());
}
try
{
if (!objectToSetState.isEmpty())
{
LifeCycleHelper.service.setLifeCycleState(objectToSetState, newState, true);
}
} catch (WTException e)
{
e.printStackTrace();
}
}
PetrH