Community Tip - You can Bookmark boards, posts or articles that you'd like to access again 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