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

Community Tip - Learn all about PTC Community Badges. Engage with PTC and see how many you can earn! X

Automatic revision during promotion - no publish from the Released objects

N-Pyn
14-Alexandrite

Automatic revision during promotion - no publish from the Released objects

 

Hi everyone,

 

We use a lifecycle template where an object uses numeric revision scheme when it is in the Development state but when it is Promoted to be released to production, it's automatically revised and the revisioning scheme is changed to alphabetical series.

 

Here is a pic from the PTC help describing a similar process:

 

AutoRevise.png

Otherwise the lifecycle works fine, but for some reason when an object is released to production through promote and auto-revise, it is not sent to the publisher and we don't get any visualizations or representations of it. The user needs to manually send the objects to the publisher in order to get PDF's and STEP's which is not great.

I found this article which tells some settings to enable publish on State Change:
https://www.ptc.com/en/support/article/CS115536

But we already have all those three wvs.properties set to true.

A colleague told that the Auto-Revise doesn't register as a State Change and for that reason those settings won't help with this situation.

Am I missing something or is this automatic revisioning feature just incomplete/broken?

ACCEPTED SOLUTION

Accepted Solutions
HelesicPetr
22-Sapphire I
(To:N-Pyn)

Hello @N-Pyn 

It is normal OOTB behavior. 

 

If the autorevision is used you have to add a specific code to a workflow to send the object to publish queue.

Following code can help to solve your issue.

 

 

try
{
	//H queue
	com.ptc.wvs.common.ui.PublisherAction pa = new com.ptc.wvs.common.ui.PublisherAction(com.ptc.wvs.common.ui.PublisherAction.QUEUEPRIORITY, "H");
	//all target object
	wt.fc.QueryResult promotables = wt.maturity.MaturityHelper.getService().getPromotionTargets((wt.maturity.PromotionNotice)primaryBusinessObject);
	while (promotables.hasMoreElements())
	{
		Object obj = (Object) promotables.nextElement();

		if (obj instanceof wt.epm.EPMDocument)
		{
			wt.epm.EPMDocument epmdoc = (wt.epm.EPMDocument) obj;

			//search latest version !!!!
			wt.vc.config.ConfigSpec configSpec =  wt.vc.config.ConfigHelper.service.getDefaultConfigSpecFor(wt.epm.EPMDocument.class);
			wt.fc.QueryResult qr =  wt.vc.config.ConfigHelper.service.filteredIterationsOf(epmdoc.getMaster(), configSpec);
			if (qr != null)
			{
				while (qr.hasMoreElements())
				{
					epmdoc = (wt.epm.EPMDocument)qr.nextElement();
				}
			}
			//get obj EPMDocument
			java.lang.String objRef;
			objRef = wt.fc.ObjectReference.newObjectReference(epmdoc).toString();
			//create publisher
			com.ptc.wvs.common.ui.Publisher pub = new com.ptc.wvs.common.ui.Publisher();
			//run publisher
			result = pub.doPublish(false, true, objRef, (wt.vc.config.ConfigSpec) null, (wt.vc.config.ConfigSpec) null, true, null, null, com.ptc.wvs.common.ui.Publisher.EPM, pa.toString(), 0);
		}//if
	}//while
} catch (wt.util.WTException e)
{
	e.printStackTrace();
}

 

 

 

PetrH

View solution in original post

9 REPLIES 9
HelesicPetr
22-Sapphire I
(To:N-Pyn)

Hello @N-Pyn 

It is normal OOTB behavior. 

 

If the autorevision is used you have to add a specific code to a workflow to send the object to publish queue.

Following code can help to solve your issue.

 

 

try
{
	//H queue
	com.ptc.wvs.common.ui.PublisherAction pa = new com.ptc.wvs.common.ui.PublisherAction(com.ptc.wvs.common.ui.PublisherAction.QUEUEPRIORITY, "H");
	//all target object
	wt.fc.QueryResult promotables = wt.maturity.MaturityHelper.getService().getPromotionTargets((wt.maturity.PromotionNotice)primaryBusinessObject);
	while (promotables.hasMoreElements())
	{
		Object obj = (Object) promotables.nextElement();

		if (obj instanceof wt.epm.EPMDocument)
		{
			wt.epm.EPMDocument epmdoc = (wt.epm.EPMDocument) obj;

			//search latest version !!!!
			wt.vc.config.ConfigSpec configSpec =  wt.vc.config.ConfigHelper.service.getDefaultConfigSpecFor(wt.epm.EPMDocument.class);
			wt.fc.QueryResult qr =  wt.vc.config.ConfigHelper.service.filteredIterationsOf(epmdoc.getMaster(), configSpec);
			if (qr != null)
			{
				while (qr.hasMoreElements())
				{
					epmdoc = (wt.epm.EPMDocument)qr.nextElement();
				}
			}
			//get obj EPMDocument
			java.lang.String objRef;
			objRef = wt.fc.ObjectReference.newObjectReference(epmdoc).toString();
			//create publisher
			com.ptc.wvs.common.ui.Publisher pub = new com.ptc.wvs.common.ui.Publisher();
			//run publisher
			result = pub.doPublish(false, true, objRef, (wt.vc.config.ConfigSpec) null, (wt.vc.config.ConfigSpec) null, true, null, null, com.ptc.wvs.common.ui.Publisher.EPM, pa.toString(), 0);
		}//if
	}//while
} catch (wt.util.WTException e)
{
	e.printStackTrace();
}

 

 

 

PetrH

N-Pyn
14-Alexandrite
(To:HelesicPetr)

Thanks for the reply!

 

That's unfortunate that the publish process has not been taken into account when the auto-revise feature has been added. I think that it's a very crucial function of the PLM system to have up to date content on the objects at all times.

 

What workflow should I add this custom publish operation to?

I don't think adding this to the Promotion Approval Process workflow would work correctly because the automatic revisioning is happening after the promotion promotion process has been completed. So if I add this code to the end of the promotion process, the publish operation will be done to the object in the promotion process but then the object will be revised automatically to the new revision schema and that new revision will not have a representation.

HelesicPetr
22-Sapphire I
(To:N-Pyn)

Hi @N-Pyn 

Yes it is shame that autorevision does not care about visualization :D.

 

The Autorevision is done in the Approval Promotion Workflow

so if you add the code to the end of process then it will find latest revision and send it to publish queue with "H" priority

 

Trust me 😄

 

PetrH

N-Pyn
14-Alexandrite
(To:HelesicPetr)

Okay, I'll have to test it then. I'll report how it went. 🙂

HelesicPetr
22-Sapphire I
(To:N-Pyn)

@N-Pyn 

The autorevision is done here in the process>

HelesicPetr_0-1665750603668.png

PetrH

 

N-Pyn
14-Alexandrite
(To:HelesicPetr)

I just implemented this additional publish expression and tested it. Seems to be working great!

Thank you very much!

MikeLockwood
22-Sapphire I
(To:N-Pyn)

Just to add a note - Revise creates a new Revision object, but doesn't create a new Primary file. Because of this, the system determines there is nothing new to publish.

 

In past companies, we always set the first Iteration to .0 (due to coming from Intralink 3 where this was true).  Given that, nothing could be released unless it was .1 or higher, forcing someone to check out / edit as needed / check in.

 

Not suggesting this as a practice, but providing one part of the explanation why no publish occurred by default.

I tried implementing your code as shown on this thread but I am running in to a error that I can't diagnose. Where can I find and view the output from e.printStackTrace() in the catch exception or your code? I've enabled verbose workers and looked though all the logs I know to search (methodserver, monitor, helper, and worker) but can't find any mention of an error. The process manager show a health of Error: Stalled but doesn't indicate why.

 

I am using Windchill 12.0.2.7.

HelesicPetr
22-Sapphire I
(To:Ben_A)

Hello @Ben_A 

The error is presented in the log file of the Methodserver.

The workflow process is usually run under the BackroundMethodServer so you need to open the BackgroundMethodServer log file.

 

There are almost all errors from workflows.

 

If you don't configure backgroudMethodServer then standard Windchill log should contains all information what you need to diagnose the issue.

 

PS> <WT_HOME>/logs are the log files located.

 

PetrH 

Announcements


Top Tags