cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - You can subscribe to a forum, label or individual post and receive email notifications when someone posts a new topic or reply. Learn more! X

Auto revise in State Based Versioning via ECN

DKWc
13-Aquamarine

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.

 

 

2 REPLIES 2
HelesicPetr
22-Sapphire I
(To:DKWc)

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

joe_morton
17-Peridot
(To:DKWc)

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)
{

}

Top Tags