Advanced Customization > Business Logic Customization > Customizing Workflow Administration > Enhanced Promotion Process > Solution > Procedure — Adding Automatic Revisioning
  
Procedure — Adding Automatic Revisioning
The workflow template used by the promotion request can be modified to support automatic revisioning.
The following example will outline the procedure used in the latest iteration of the “Promotion Request Approval Process” provided out-of-the-box.
In this example an additional conditional expression is added. It is added after the conditional that promotes the targets. The Conditional looks like the following:
The Routing Expression expanded:
wt.maturity.PromotionNotice pn = (wt.maturity.PromotionNotice)primaryBusinessObject;
try
{
java.util.Locale locale = wt.session.SessionHelper.getLocale();
com.ptc.core.ui.validation.UIValidationResultSet set= com.ptc.windchill.enterprise.maturity.PromotionNoticeWorkflowHelper.
revisePromotables(pn, pn.getCreator(), locale);

reviseValidationMsg= com.ptc.windchill.enterprise.maturity.validators.PromotionTargetsReviseValidator.getReviseResultSetMessage(set, locale);
if (!reviseValidationMsg.isEmpty() )
result="Partial";
else
result="Full";

}
catch( Exception wte )
{
wte.printStackTrace();
}
The method revisePromotables(pn, pn.getCreator(), locale); performs the revision of the promotion objects following the preferences defined above in Solution.
Once the eligible promotion objects have been revised a message is created containing any promotion targets not eligible for promotion along with the reason why the promotion object was disqualified. This message is sent to the promotion creator. Any valid promotion targets will be revised independent of whether there are any disqualified targets.
* 
If promoting CAD Documents and Parts together, if the revise disqualifies either the part or CAD document, the objects will not be revised together and will need to be correctively fixed by the promotion request creator (or another user) after promote.
Promotion Process as a Gate Review Process
For companies that use the Promotion Request as a "Gate Review" for production, a best practice is to switch the revision labels for objects from a numeric series to an alphanumeric series. With a proper life cycle design, such a gate state can be modeled that achieves the desired target state and automatically revises the promotion candidates to the initial revision label of the new revision series.
The following FIT table describes how this scenario would work based on various values of the preferences described in Solution.
Promotable
Is Life Cycle State Based
Preference
Preference Value
Preference
Preference Value
Valid for revise
part_1
No
Automatic Revision States
Released
Automatic Revision Mode
Automatically revise all the promotion candidates
Yes
part_2
Yes
Automatic Revision States
Released
Automatic Revision Mode
Automatically revise only the promotion candidates with versioning scheme changed
Yes
part_3
No
Automatic Revision States
Released
Automatic Revision Mode
Automatically revise only the promotion candidates with versioning scheme changed
No
part_4
No
Automatic Revision States
In Work
Automatic Revision Mode
Automatically revise all the promotion candidates
No
For this example the Maturity State of the promotion request is “Released”. In addition each part is in its own unique container.