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

Part II Enhancements on Windows Explorer Integration for Windchill Desktop Integration 10.2

Re: Getting the most from the WVS Job Scheduler

Gary, may need some clarification on these two lines from the document:

Line 1) - by forcing the republishing for existing default representations, or not

Line 2) - Note: The Publish_EPMDoc_WithCSVFile schedule method deletes the existing Representation (along with any Annotation Sets) before publishing a new Representation

What happens if I'm NOT forcing the republishing of existing default representations and using the publish_epmdoc_withcsvfile function?  I don't want to lose annotation sets on assemblies that are already published with a default representation.  Do I need to make sure assemlbies with a default representation are not inlcuded in the CSV file for this scenario?

Re: Getting the most from the WVS Job Scheduler

One more note...is it possible to have an "included" list of Contexts instead of an "excluded"?  We have over 500 contexts.   Maybe it's as easy as changing the text from excluded to included. 

wvs.jobs.publishFilter.excludedContextNameForPublication=PRODUCT3,LIBRARY1

Re: Getting the most from the WVS Job Scheduler

Bill Ryan wrote:

Gary, may need some clarification on these two lines from the document:

Line 1) - by forcing the republishing for existing default representations, or not

Line 2) - Note: The Publish_EPMDoc_WithCSVFile schedule method deletes the existing Representation (along with any Annotation Sets) before publishing a new Representation

What happens if I'm NOT forcing the republishing of existing default representations and using the publish_epmdoc_withcsvfile function?  I don't want to lose annotation sets on assemblies that are already published with a default representation.  Do I need to make sure assemlbies with a default representation are not inlcuded in the CSV file for this scenario?

This is YSH's response:

Publish_EPMDoc_WithCSVFile UI scheduler method only use wvs.jobs.publishFilter.withCSV parameter and do not get any other parameter value in additionalEPMDocJobs.properties. It is hard-corded in AdditionalEPMDocJobs.java source as below.

AdditionalEPMDocJobs.java source 794 ~ 814 lines:

----------------------------------------------------------------------------------------------8<-----------------------------------------------------------------------------------------------------------------------------

/**

* Attempts to publish a Representable generating a Representation

*

* @param     viewableLink    If true and the data has already been published, the viewable data will be passed back to allow access by getViewableLink

* @param     forceRepublish  Overwrites an existing representation should one already exist

* @param     objectReference Reference of the Representable to be published

* @param     configReference Reference of the EPM Config Spec, if null, latest is used.

* @param     partConfigReference Reference of the Part Config Spec, if null, latest is used.

* @param     defaultRep      Should the created representation be the default or not.  The first representation in always default.

* @param     repName Name of The representation to be created

* @param     repDescription  Description of the representation to be created

* @param     structureType   The type of structure walk to be performed

* @param     actionString string representation of the action XML file contents

* @param     jobSource       int of source that submitted the job, 0=unknown, 1=manual, 2=checkin, 3=schedule

*

* @return    boolean true if successful

*

public boolean doPublish(boolean viewableLink, boolean forceRepublish, String objectReference, String configReference, String partConfigReference,

boolean defaultRep, String repName, String repDescription, int structureType, String actionString, int jobSource)

**/

result = pub.doPublish(false, true, objRef, (ConfigSpec) null, (ConfigSpec) null, true, null, null,

Publisher.EPM, null, 3);

----------------------------------------------------------------------------------------------8<-----------------------------------------------------------------------------------------------------------------------------

Publish_EPMDoc_WithCSVFile UI scheduler method is hard-coded with below values:

viewableLink : false

forceRepublish : true

objectReference: Retrieved from CVS file

configReference: null

partConfigReference: null

defaultRep: true

repName: null

repDescription : null

structureType: Publisher.EPM

jobSource: 3

And,

Publish_EPMDoc_WithCSVFile schedule method will delete the existing Representation (along with any Annotation Sets) before publishing a new Representation. It will remove previously published Representation and it’s annotation. Both Representation and it’s Annotation should be removed together.

If customer comments out below lines in AdditionalEPMDocJobs.java source (787 ~ 791 lines). Then, the Publish_EPMDoc_WithCSVFile schedule method will force republish the CAD model and will not remove previously created Representation and its annotation set. i.e. Customer will see 2 Representation in the CAD Document.

Comment out these line in AdditionalEPMDocJobs.java source (787 ~ 791 lines):

     /**

     try {

      deleteRepresentation(epm);

      } catch (WTException e) {

      throw e;

      }

     **/

Force to republish Result: 2 Representations

RepList.png

Re: Getting the most from the WVS Job Scheduler

Bill Ryan wrote:

One more note...is it possible to have an "included" list of Contexts instead of an "excluded"?  We have over 500 contexts.  Maybe it's as easy as changing the text from excluded to included. 

wvs.jobs.publishFilter.excludedContextNameForPublication=PRODUCT3,LIBRARY1

YSH's Response:

Below lines (286 ~ 299 lines) in AdditionalEPMDocJobs.java source. If customer change SearchCondition.NOT_EQUAL to be SearchCondition.EQUAL, then it will have an "included" list of Contexts instead of an "excluded"

-----------------------------------------------8<------------------------------------------------

// excluded context from publication

   String[] excludedContextNameForPublication = getjobsprops.getExcludedContextNameForPublication();

   if (excludedContextNameForPublication != null){

      for (int i=0; i<excludedContextNameForPublication.length; i++){

         WTContainer wtc = findContainer(excludedContextNameForPublication[i]);

         if (wtc == null) getjobsprops.PrintOut("WTContainer excluded " + excludedContextNameForPublication[i] + " not found or not used");

         else {

            getjobsprops.PrintOut("found container: " + wtc.getIdentity()); //wt.pdmlink.PDMLinkProduct:291527

            qs.appendAnd();

            // idA3containerReference ObjectReference.KEY

            qs.appendWhere(new SearchCondition(EPMDocument.class, WTContained.CONTAINER_REFERENCE + ".key.id" , SearchCondition.NOT_EQUAL, PersistenceHelper.getObjectIdentifier(wtc).getId()));

         }

      }

   }

-----------------------------------------------8<------------------------------------------------


i.e. Change this:

qs.appendWhere(new SearchCondition(EPMDocument.class, WTContained.CONTAINER_REFERENCE + ".key.id" , SearchCondition.NOT_EQUAL, PersistenceHelper.getObjectIdentifier(wtc).getId()));


to be this:

qs.appendWhere(new SearchCondition(EPMDocument.class, WTContained.CONTAINER_REFERENCE + ".key.id" , SearchCondition.EQUAL, PersistenceHelper.getObjectIdentifier(wtc).getId()));

Re: Getting the most from the WVS Job Scheduler

Thanks Gary.  These are good answers.  Appreciate it.

Re: Getting the most from the WVS Job Scheduler

Gary Jackson‌, I have several questions.  For my initial go-around I'm only trying the command line version for CSV publishing.

  1. I ran the makeCommonUtils.bat and that went fine.  I then attempted to run makePublishUtil.bat but that prompted me for Oracle DB information.  We are using MS SQL server.  Should I point these prompts to the MS SQL equivalents or will they only work with Oracle?
  2. If I only want to try CSV publishing, is it sufficient to just run makeCommonUtils.bat and makePublishUtilreadCSV.bat and do nothing else (the stuff listed above for additional schedulers, extra properties, and other make files)?
  3. The PublishUtilreadCSV.bat appears to strip off everything but the OR from CSV file.  If that's the case, then is there really any reason to include anything other than just the OR in the CSV file?  Do I really need the other columns: OR||DOCNAME||DOCNUMBER
  4. What exactly is the || character?  Normally CSV files are comma separated.  I'm not sure if this is supposed to be a TAB or two "pipe" characters.

Thanks!

Re: Getting the most from the WVS Job Scheduler

Answering some of my own questions...

Apparently the steps I listed in question #2 were sufficient.  Those are the only things I did and the PublishUtilreadCSV.bat is working just fine.  Also, I only included the ORs in the text file, so apparently that answers question #3 as well. 

One thing you might want to ask the developer.  This script appears to delete the existing representation first, then submits the job for publishing.  On the other hand, if you resubmit a job from the WVS Job Monitor, it does not delete (or replace) the existing representation unless it is successfully republished.  Is there a way to have this script behave that way so that if there's some problem with publishing the existing representations aren't lost?  Probably not a big deal, just curious.

991 jobs were just submitted flawlessly.

pub_jobs.PNG

Thanks again for this!!!

Re: Getting the most from the WVS Job Scheduler

Just did my second run on production.  The script processed 4,225 items in 44 minutes, so 1.6 objects per second or 96 objects per minute.

pub_jobs2.PNG

In some ways this seems a little slow, but I guess it's not a big deal since I can only publish around 20 objects per minute anyway. 

Loving this!

Re: Getting the most from the WVS Job Scheduler

Hi Tom,

Sorry for the delayed reply, I was OOTO yesterday and have only just caught up this afternoon.

Glad to hear that this is helping!

Also glad to hear you've answered your questions #2 & #3! I assume you also have implicitly answered #1, given it's working?  Regarding #4, the "||" are just the chosen CSV delimiter (does not have to be a comma and double-pipe is more likely unique.

Gary

Re: Getting the most from the WVS Job Scheduler

Tom Uminn wrote:

One thing you might want to ask the developer.  This script appears to delete the existing representation first, then submits the job for publishing.  On the other hand, if you resubmit a job from the WVS Job Monitor, it does not delete (or replace) the existing representation unless it is successfully republished.  Is there a way to have this script behave that way so that if there's some problem with publishing the existing representations aren't lost?  Probably not a big deal, just curious.

This is how it's currently designed but refer to the from the TS developer comments paraphrased in my answer to Bill above: 09-Oct-2015 04:12.