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

Community Tip - Your Friends List is a way to easily have access to the community members that you interact with the most! X

Publish rules based on EPM Document Name

taruchamy
10-Marble

Publish rules based on EPM Document Name

Hi,

Looking for ideas to publish objects different from regular publishing output with specific file names.

Say if object name with MANF Ex: 12190242-MANF-00A.drw, this need to publish additional or different output from the regular publishing.

Let me know.

Thanks

Murthi

11 REPLIES 11

You can add a regular expression in your publishing rule,similar to the highlighted one. You can ignore the rest of the rules, we have that to publish DRW as a pdf and store it as a WTDocument in published content directory

<rules xmlns="http://www.ptc.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.ptc.com/PublishRulesSchema.xsd">

<authoring-application name="PROE">

<additional-files name="DrawingPDF">

<file display-label="PDF" type="pdf" default="true" output-prefix="pdf"/>

</additional-files>

<param-set name="Share with WTDocumentReleased Drawing">

<post-publish name="delegate">com.ptc.wvs.server.publish.AdditionalFilesPostPublishDelegate</post-publish>

<post-publish name="published-content-link">create</post-publish>

<post-publish name="name">{EPM_NAME}</post-publish>

<post-publish name="lifecycle-state">RELEASED</post-publish>

<post-publish name="lifecycle-template">Basic</post-publish>

<post-publish name="type">com.companyname.publishedContent</post-publish>

<post-publish name="folder">/Published Contents</post-publish>

<post-publish name="additional-file-primary">.*\.pdf</post-publish>

</param-set>

<condition name="IS_Released_Drawing">

<attribute name="epmdoc_name" regex=".*\.drw" />

<attribute name="epmdoc_lifeCycleState" value="Released"/>

</condition>

<if condition="IS_Released_Drawing">

<publish evaluate-rules-on-republish="true"  additional-files="DrawingPDF" param-set="Share with WTDocumentReleased Drawing" on="create-representation"/>

<publish evaluate-rules-on-republish="true"  additional-files="DrawingPDF" param-set="Share with WTDocumentReleased Drawing" on="schedule"/>

<publish evaluate-rules-on-republish="true"  additional-files="DrawingPDF" param-set="Share with WTDocumentReleased Drawing" on="checkin"/>

<publish evaluate-rules-on-republish="true"  additional-files="DrawingPDF" param-set="Share with WTDocumentReleased Drawing" on="unknown-source"/>

</if>

<publish evaluate-rules-on-republish="true" on="checkin"/>

<publish evaluate-rules-on-republish="true" on="create-representation"/>

<publish evaluate-rules-on-republish="true" on="schedule"/>

<publish evaluate-rules-on-republish="true" on="unknown-source"/>

</authoring-application>

</rules>

Thank you,

Binesh Kumar

Medtronic - MITG

Thanks Binesh Kumar

Will try this...

<?xml version="1.0" encoding="UTF-8"?>

<rules xmlns="http://www.ptc.com"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="http://www.ptc.com PublishRulesSchema.xsd"
       evaluate-rules-on-republish="true">


      <authoring-application name="PROE">

            
        <additional-files name="part_files">
            <!--only default='true' files will be generated at this time -->
            <!--<file display-label="PLT" type="plt" default="true" output-prefix="plt" />-->
        </additional-files>
        <additional-files name="asm_files">
            <!--only default='true' files will be generated at this time -->
            <file display-label="STEP" type="step" default="true" output-prefix="stp"/>
         </additional-files>
         <additional-files name="special_asm_files">
            <!--only default='true' files will be generated at this time -->
            <file display-label="PLT" type="plt" default="true" output-prefix="plt" />
         </additional-files>

        <condition name="is_part">
           <!--<attribute name="epmdoc_number" regex=".*\.prt" />-->
           <attribute name="epmdoc_docType" value="CAD Part"/>
            </condition>
            <condition name="is_asm">
          <!-- <attribute name="epmdoc_number" regex=".*\.asm" />-->
           <attribute name="epmdoc_docType" value="Assembly"/>
          <condition name="is_special_asm">
          <!-- <attribute name="epmdoc_number" regex="11111*\.asm" />-->
           <attribute name="epmdoc_docType" value="Assembly"/>
           </condition>
      
           <!-- Following conditions are evaluated based on the order they appear in this file -->

        <if condition="is_part">
            <publish on="checkin" display-label="Publish part - checkin" additional-files="part_files" />
            <publish on="create-representation" display-label="Publish part" additional-files="part_files" />
        </if>
        <if condition="is_asm">
           <publish on="checkin" display-label="Publish assembly - checkin" additional-files="asm_files"  />
          <publish on="create-representation" display-label="Publish assembly" additional-files="asm_files"  />
        </if>
        <if condition="is_special_asm">
           <publish on="checkin" display-label="Publish assembly - checkin" additional-files="special_asm_files"  />
          <publish on="create-representation" display-label="Publish assembly" additional-files="special_asm_files"  />
        </if>
    </authoring-application>

</rules>

I mentioned as a special Assembly with prefix 11111 to be published as PLT as addditional format.

But validation fails :

(wt.viewmarkup.configurationTemplateLoadResource/SCHEMA_VALIDATION_FAILED) wt.util.WTException: PublishRules-AdditionalFiles-Special ASM.xml failed schema validation - Line 32: cvc-complex-type.2.4.d: Invalid content was found starting with element 'condition'. No child element is expected at this point..

You did not close the condition - <condition name="is_asm">, add a </condition> after that

Also your regular expression should be something like this, I guess - (1111).*\.asm

Thank you

Binesh Kumar

Medtronic - MITG

Hi Binesh,

I did the closed now and works fine.

It creates additional file format instead of alternate format.

Any clues ??

Thanks

Hello Murthi,

Are you getting any error? anything in BGMS log.

Thank you

Binesh

Hi Binesh,

My testing results are wrong.

The validation was sucess, but the rules applied to all drawings instead of drawing with the number "ISPL"

I changed the condition as below for Regular Expression to find only the Number containing ISPL -

<condition name="is_insulator_plate_drw">
<attribute name="epmdoc_number" regex="\bISPL\b" />


Though validator seems to be right, Rule is accepted in Windchill

I need to have two conditions  -

1) EPM Document Number to contain ISPL

2) EPM Document type should be Drawing.

TomU
23-Emerald IV
(To:taruchamy)

I would suggest that you keep the two criteria separate.  For example:

<condition name="is_insulator_plate_drw">

   <and>

        <attribute name="epmdoc_docType" value="Drawing"/>

        <attribute name="epmdoc_number" regex="\bISPL\b" />

    </and>

</condition>

SV_9649587
5-Regular Member
(To:BineshKumar1)

Hello Binesh,

 

I am new to windchill customization. I have managed to publish PDF to a WTdocument with AdditionalFilesPostPublishDelegate. However, I would like to auto publish pdf to drawing content as attachment instead of WTdocument. Any suggestions for this?

 

Regards,

Siju

Thanks Tom and Binesh.

\bISPL\b failed to search for the intended object though. But And condition works fine.

I did achieved this with

<attribute name="epmdoc_number" regex= ".*(?i:ispl).*\.DRW" /> 

Where I could create additional file type, but still searching for the rule to alternate file type [By Default I have defined DXF for all the drawings] - I need to replace with TIF for drawings containing ISPL.

Thanks

Dear all,

Any ideas how to get this working on 10.1?

Thanks in advance.

Regards,

Gautham

Top Tags