Community Tip - Did you get called away in the middle of writing a post? Don't worry you can find your unfinished post later in the Drafts section of your profile page. X
Good Morning all,
As you can see from below this is my current promotion request.
At the areas circled in red I would like the workflow to re publish the file (will only ever be .asm .prt or .drw)
The reason being is that the workflow changes the state and on our standard border displays the state.
Solved! Go to Solution.
Issue was resolved by setting republishonepmdocumentchange = true
xconfmanager -p -t D:\PTC\WC\Windchill\codebase\wvs.properties -s "publish.republishonepmdocumentchange=true"
Please see PTC CS115536 for rough details (Ignore prevent check in section)
you can use below code to publish all promotable.
public static void publishReleaseDocument(PromotionNotice primaryBusinessObject) throws WTException {
wt.fc.QueryResult qr = wt.maturity.MaturityHelper.service.getPromotionTargets((PromotionNotice) primaryBusinessObject);
while (qr.hasMoreElements()) {
RevisionControlled obj = (RevisionControlled) qr.nextElement();
if (obj.getClass().isAssignableFrom(EPMDocument.class)) {
QueryResult allIteration = VersionControlHelper.service.allIterationsOf(obj.getMaster());
;
if (allIteration != null && allIteration.hasMoreElements()) {
Persistable docs = (Persistable) allIteration.nextElement();
String objRef = ObjectReference.newObjectReference((Persistable) docs).toString();
ConfigSpec configSpec = new LatestConfigSpec();
com.ptc.wvs.common.ui.Publisher pub = new com.ptc.wvs.common.ui.Publisher();
com.ptc.wvs.common.ui.PublisherAction action = new com.ptc.wvs.common.ui.PublisherAction();
action.addAction(com.ptc.wvs.common.ui.PublisherAction.QUEUEPRIORITY, "H");
boolean result = pub.doPublish(true, true, objRef, configSpec, configSpec, true, "", "Created By Workflow", com.ptc.wvs.common.ui.Publisher.EPM, null, 0);
}
}
}
}
Hope it helps !!!
Thanks
Shreyas
Morning Shreyas Atre and thanks for the speedy reply!
Just a couple quick questions as I have not edited many workflows before:
Checking Syntax...
D:\ptc\WC\Windchill\temp\WfExpression_Administrator.java:33: illegal start of expression
public static void publishReleaseDocument(PromotionNotice primaryBusinessObject) throws WTException {
^
D:\ptc\WC\Windchill\temp\WfExpression_Administrator.java:33: illegal start of expression
public static void publishReleaseDocument(PromotionNotice primaryBusinessObject) throws WTException {
^
D:\ptc\WC\Windchill\temp\WfExpression_Administrator.java:33: ';' expected
public static void publishReleaseDocument(PromotionNotice primaryBusinessObject) throws WTException {
^
D:\ptc\WC\Windchill\temp\WfExpression_Administrator.java:33: ')' expected
public static void publishReleaseDocument(PromotionNotice primaryBusinessObject) throws WTException {
^
D:\ptc\WC\Windchill\temp\WfExpression_Administrator.java:33: illegal start of expression
public static void publishReleaseDocument(PromotionNotice primaryBusinessObject) throws WTException {
^
D:\ptc\WC\Windchill\temp\WfExpression_Administrator.java:33: ';' expected
public static void publishReleaseDocument(PromotionNotice primaryBusinessObject) throws WTException {
^
D:\ptc\WC\Windchill\temp\WfExpression_Administrator.java:33: not a statement
public static void publishReleaseDocument(PromotionNotice primaryBusinessObject) throws WTException {
^
D:\ptc\WC\Windchill\temp\WfExpression_Administrator.java:33: ';' expected
public static void publishReleaseDocument(PromotionNotice primaryBusinessObject) throws WTException {
^
8 errors
Syntax check complete.
Many thanks,
Mike
Issue was resolved by setting republishonepmdocumentchange = true
xconfmanager -p -t D:\PTC\WC\Windchill\codebase\wvs.properties -s "publish.republishonepmdocumentchange=true"
Please see PTC CS115536 for rough details (Ignore prevent check in section)