Auto revise in State Based Versioning via ECN
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Auto revise in State Based Versioning via ECN
Hi,
Trying to use State Based versioning ( numeric and alpha ).
Object starts in InWork state with numeric (1.0) revision, once object is released it should get auto revised to alpha (A.0)
Updated the revision file, created new series and seeds. Mapped to respective state in LC.
The challenge is when use ECN object gets released however it doesn't gets autorevised in Released State.
Manually revised it changes to Alpha revision.
Any references would be of great help.
Solved! Go to Solution.
- Labels:
-
Bus_System Administration
-
Change_Mgmt
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
You'll need to add a robot with custom code in your ECN workflow, like HelesicPetr said.
Look at the solution here: https://community.ptc.com/t5/Windchill/Revising-Using-Workflow/m-p/643#M89%3Fsource=search
The first line of that code won't work in your case, since it is for Promotion Objects and you want to use it for ECNs
wt.maturity.PromotionNotice pn = (wt.maturity.PromotionNotice)primaryBusinessObject;
This article shows how to get the Affected Objects and the Resulting Objects from an ECN: https://www.ptc.com/en/support/article/CS55955?source=search
Assuming you want to revise the Resulting Objects, I'd try something like this:
try
{
wt.change2.WTChangeOrder2 ecn = (wt.change2.WTChangeOrder2)primaryBusinessObject;
wt.fc.QueryResult qr = wt.change2.ChangeService2.getChangeablesAfter(ecn);
while (qr.hasMoreElements()) {
wt.vc.Versioned obj = (wt.vc.Versioned) qr.nextElement();
wt.vc.Versioned newObject = wt.vc.VersionControlHelper.service.newVersion(obj);
wt.fc.PersistenceHelper.manager.store(newObject);
}
}
catch (wt.util.WTException ex)
{
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi @DKWc
The autoRevision works just in Promotion Approval workflow.
For change process I would write own code based on the Promotion Approval revise robot to autorevise the resulting objects
//Promotion Approval Process has a Conditional robot with below code:
com.ptc.core.ui.validation.UIValidationResultSet set= com.ptc.windchill.enterprise.maturity.PromotionNoticeWorkflowHelper.revisePromotables(pn, pn.getCreator(), locale);
PetrH
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
You'll need to add a robot with custom code in your ECN workflow, like HelesicPetr said.
Look at the solution here: https://community.ptc.com/t5/Windchill/Revising-Using-Workflow/m-p/643#M89%3Fsource=search
The first line of that code won't work in your case, since it is for Promotion Objects and you want to use it for ECNs
wt.maturity.PromotionNotice pn = (wt.maturity.PromotionNotice)primaryBusinessObject;
This article shows how to get the Affected Objects and the Resulting Objects from an ECN: https://www.ptc.com/en/support/article/CS55955?source=search
Assuming you want to revise the Resulting Objects, I'd try something like this:
try
{
wt.change2.WTChangeOrder2 ecn = (wt.change2.WTChangeOrder2)primaryBusinessObject;
wt.fc.QueryResult qr = wt.change2.ChangeService2.getChangeablesAfter(ecn);
while (qr.hasMoreElements()) {
wt.vc.Versioned obj = (wt.vc.Versioned) qr.nextElement();
wt.vc.Versioned newObject = wt.vc.VersionControlHelper.service.newVersion(obj);
wt.fc.PersistenceHelper.manager.store(newObject);
}
}
catch (wt.util.WTException ex)
{
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Thanks a lot joe
