Community Tip - Learn all about the Community Ranking System, a fun gamification element of the PTC Community. X
Are you using a temporary state for locking your WTParts or an actual lock?
You can easily lock promotion targets like this:
wt.maturity.PromotionNotice pn = (wt.maturity.PromotionNotice)primaryBusinessObject;
try
{
wt.maturity.MaturityServerHelper.service.lockTargets( pn );
result = "Accepted";
}
I have not tried it, but it might be possible to progressively lock additional targets as you add them to your promotion request.
You can then unlock targets to return them to the original state if needed:
wt.maturity.MaturityServerHelper.service.unlockTargets (pn);
If it's an actual state and not the lock transition, you will need to store the original state somewhere and return it manually later.
As for other solutions - you can create a tiny customization that would refresh your promotion request to use latest iterations when needed. Also, you can make a check to see if any iteration of a given revision (in promotion request) is a part of another active promotion request.
I doubt that there is a silver bullet for this issue.
Kind regards,
Dmitry
We use the Pending Approval state as the lock state in the Lifecycle. And it is working otherwise okay, but we have this problem with WTParts dropping out of the promotion objects when the Promotion Request is edited.
To me, this is the issue:
Then when the Promotion Request is later edited and the related CAD documents are added to Promotion Objects, the WTParts drop out of the Promotion Objects because they are in the "Pending Approval" state, which we are not allowing to be promoted:
So you lock the Promotion Request itself and not just the promotable objects? How is that done? Have you added some state-changing robot to the workflow or is there some OOTB solution for this?
We lock both. When the PRM is submitted:
The OOTB workflow has an "Unlock Targets" for a Rework also, they just don't change the state of the Promotion. You could either add the Set State, or else grant the person with the "Rework Promotion Request" task permissions to edit the Promotion Request as part of the task itself.
End result is that you prevent people from editing the promotion while the items set for promotion are in the locked state.
Hi @N-Pyn,
I wanted to see if you got the help you needed.
If so, please mark the appropriate reply as the Accepted Solution. It will help other members who may have the same question.
Of course, if you have more to share on your issue, please pursue the conversation.
Thanks,
Anurag
We added the Promote transition from Pending Approval to Released, so the objects are not dropping out of Promotion Requests anymore when they are edited. But we still have the problem of some objects getting stuck to Pending Approval state when they are removed from Promotion Requests or if Promotion Requests are deleted.
There seems to be some kind of a bug in the process that should update the state of the promotion objects when they are not a part of a Promotion Request anymore.