Skip to main content
1-Visitor
October 4, 2016
Question

Publishing not happening between set states?

  • October 4, 2016
  • 3 replies
  • 2941 views

When we change the status of drawing, the worker doesn't publish the drawing. This was not the behavior before and we have to manually click on the thumbnail to create the representation. Could someone  provide me inputs as to where to begin investigating the cause of this issue.

3 replies

22-Sapphire I
October 4, 2016

Here are some related articles CS43043, CS238377, CS229067, CS55087.

Unfortunately it's fairly complex.

1-Visitor
October 6, 2016

 

Change the publish.republishondocumentchange & publish.republishonepmdocumentchange to true in WVS.propeties.

 

 

Thanks

Shreyas

 

 

jfrancis1-VisitorAuthor
1-Visitor
October 6, 2016

these properties have been set to true

jfrancis1-VisitorAuthor
1-Visitor
October 17, 2016

Can publishing be handled through code?

HelesicPetr
22-Sapphire II
22-Sapphire II
November 2, 2016

You can use the following code in a Promotion Request workflow in expresion robot in the end.

The code sends the EPM documents to publish queue

try

{

   

    //create publisher action -  action string .... M queue

    com.ptc.wvs.common.ui.PublisherAction pa = new com.ptc.wvs.common.ui.PublisherAction(com.ptc.wvs.common.ui.PublisherAction.QUEUEPRIORITY, "M");

    //check all target objects

    wt.fc.QueryResult promotables = wt.maturity.MaturityHelper.getService().getBaselineItems((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;

           

            //Find the latest version of document!!!

            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();

                }

            }                       

           

           

            //check the EPMDocument object

            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();

            //Start 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();

}