Heres the Publish rule I used to control what get submitted for publishing based on EPM document name, in thoery this allows us to reduce our publishing by up to 90% by only publishing items that are actually useful to view. this also allows us to create schedule publish jobs to clean up items with no representations due to job failurs etc.
The trickey bit was the regex syntax to find the EPMdoc names
I added some <additional files> publishing to the rule as an added benefit.
This table shows what we want to publish and on what trigger:
| Published by rule (Y/N) |
7-fig part & assembly (#######.prt, #######.asm) |
7-fig drawing (#######.drw) |
CAD number (CAD*.prt, CAD*.asm) |
scheme assembly (sc*.asm) |
Scheme drawing (sc*.drw) |
TR & PR DRAWINGS (tr*.drw, pr*.drw) |
TR & PR parts (tr*.prt, tr*.asm, pr*.prt, pr*.asm) |
| checkin |
Y |
Y |
Y |
N |
Y |
Y |
N |
| schedule (LATEST NO REP) |
Y |
Y |
N |
N |
N |
Y |
N |
| create rep |
Y |
Y |
Y |
Y |
Y |
Y |
Y |
<rules xmlns="http://www.ptc.com"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.ptc.com PublishRulesSchema.xsd">
<!-- version 4 -->
<authoring-application name="PROE">
<!-- conditions to identify items based on part number and extension to determine if they should be published -->
<condition name="7_FIG_PART">
<or>
<attribute name="epmdoc_CADName" regex="\b[0-9][0-9][0-9][0-9][0-9][0-9][0-9].*\.*asm" />
<attribute name="epmdoc_CADName" regex="\b[0-9][0-9][0-9][0-9][0-9][0-9][0-9].*\.*prt" />
</or>
</condition>
<condition name="7_FIG_DRAWING">
<attribute name="epmdoc_CADName" regex="\b[0-9].*\.*drw" />
</condition>
<condition name="SCHEME_DRAWING">
<or>
<attribute name="epmdoc_CADName" regex="\bSC.*\.*drw" />
<attribute name="epmdoc_CADName" regex="\bsc.*\.*drw" />
</or>
</condition>
<condition name="TR_OR_PR_DRAWING">
<or>
<attribute name="epmdoc_CADName" regex="\bPR.*\.*drw" />
<attribute name="epmdoc_CADName" regex="\bTR.*\.*drw" />
<attribute name="epmdoc_CADName" regex="\bpr.*\.*drw" />
<attribute name="epmdoc_CADName" regex="\btr.*\.*drw" />
</or>
</condition>
<condition name="CAD_NUMBER">
<or>
<attribute name="epmdoc_CADName" regex="\bCAD.*" />
<attribute name="epmdoc_CADName" regex="\bcad.*" />
</or>
</condition>
<condition name="Scheme_ASSY">
<or>
<attribute name="epmdoc_CADName" regex="\bSC.*\.*asm" />
<attribute name="epmdoc_CADName" regex="\bsc.*\.*asm" />
</or>
</condition>
<condition name="TR_OR_PR_PARTS_AND_ASSEMBLIES" >
<or>
<attribute name="epmdoc_CADName" regex="\bPR.*\.*asm" />
<attribute name="epmdoc_CADName" regex="\bTR.*\.*asm" />
<attribute name="epmdoc_CADName" regex="\bPR.*\.*prt" />
<attribute name="epmdoc_CADName" regex="\bTR.*\.*prt" />
<attribute name="epmdoc_CADName" regex="\bpr.*\.*asm" />
<attribute name="epmdoc_CADName" regex="\btr.*\.*asm" />
<attribute name="epmdoc_CADName" regex="\bpr.*\.*prt" />
<attribute name="epmdoc_CADName" regex="\btr.*\.*prt" />
</or>
</condition>
<!-- Publish additional files -->
<additional-files name="2D">
<file output-prefix="pdf" default="false" type="pdf" visible="true" display-label="PDF_file"/>
<file output-prefix="dxf" default="false" type="dxf" visible="true" display-label="dxf_file"/>
</additional-files>
<additional-files name="3D">
<file type="step" display-label="STEP_file" default="false" visible="true" output-prefix="Step_file"/>
<file display-label="iges_3D" type="iges" default="false" visible="true" output-prefix="Iges_file"/>
</additional-files>
<!-- START IFs -->
<if condition="7_FIG_PART">
<publish on="checkin" />
<publish on="create-representation"/>
<publish on="create-representation" additional-files="3D"/>
<publish on="schedule" />
</if>
<if condition="7_FIG_DRAWING">
<publish on="checkin" />
<publish on="create-representation"/>
<publish on="create-representation" additional-files="2D"/>
<publish on="schedule" />
</if>
<if condition="SCHEME_DRAWING">
<publish on="checkin" />
<publish on="create-representation"/>
<publish on="create-representation" additional-files="2D"/>
</if>
<if condition="TR_OR_PR_DRAWING">
<publish on="checkin" />
<publish on="create-representation"/>
<publish on="create-representation" additional-files="2D"/>
<publish on="schedule" />
</if>
<if condition="CAD_NUMBER">
<publish on="checkin" />
<publish on="create-representation"/>
<publish on="create-representation" additional-files="3D"/>
<publish on="create-representation" additional-files="2D"/>
</if>
<if condition="Scheme_ASSY">
<publish on="create-representation"/>
<publish on="create-representation" additional-files="3D"/>
</if>
<if condition="TR_OR_PR_PARTS_AND_ASSEMBLIES">
<publish on="create-representation"/>
<publish on="create-representation" additional-files="3D"/>
</if>
<publish on="create-representation" additional-files="3D"/>
<publish on="create-representation" additional-files="2D"/>
</authoring-application>
</rules>