Community Tip - Need to share some code when posting a question or reply? Make sure to use the "Insert code sample" menu option. Learn more! X
I am using Windchill PDMLink Release 12.1 and Datecode with CPS 12.1.1.2
When applying solution from Article - CS362383 the example is not working as expected.
For drawings the pdf file is created regardless of drawing object state.
For CAD parts and CAD assembly step files are not created in any state.
Here are the errors that I faced
publishing rules are not evaluated as expected
Solved! Go to Solution.
Check your spelling and case (this is case sensitive) ... should be epmdoc_lifeCycleState not epmdoc_liveCycleState (the file you attached doesn't match what you pasted in the post)
Hi @nbojcetic
Provide your xml configuration for the publish rules.
For your information, if you use different language in Windchill you need to specify all conditions in specific languages
PetrH
Hi,
thank you all for your answers. Well my xml file is (we are using US English):
it is copy from CS362383 with small change regading step and pdf. If I lose check for Release state
I can, manually create both output files, but when check is in place and objects are in right state it
does not work as expected.
<?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">
<condition name="is_drawing">
<and>
<attribute name="epmdoc_liveCycleState" value="Released"/>
<attribute name="epmdoc_CADName" regex=".*\.drw$"/>
</and>
</condition>
<condition name="is_cadpart">
<and>
<attribute name="epmdoc_liveCycleState" value="Released"/>
<attribute name="epmdoc_CADName" regex=".*\.prt$"/>
</and>
</condition>
<condition name="is_asm">
<and>
<attribute name="epmdoc_liveCycleState" value="Released"/>
<attribute name="epmdoc_CADName" regex=".*\.asm$"/>
</and>
</condition>
<additional-files name="publish_drawing">
<file display-label="PDF" type="pdf" default="true" output-prefix="pdf"/>
</additional-files>
<additional-files name="publish_cadpart">
<file display-label="STEP" type="step" default="true" output-prefix="step"/>
</additional-files>
<additional-files name="publish_cadasm">
<file display-label="STEP" type="step" default="true" output-prefix="step"/>
</additional-files>
<if condition="is_drawing">
<publish on="checkin" additional-files="publish_drawing" />
<publish on="schedule" additional-files="publish_drawing" />
<publish on="create-representation" additional-files="publish_drawing" />
<publish on="unknown-source" additional-files="publish_drawing" />
</if>
<if condition="is_cadpart">
<publish on="checkin" additional-files="publish_cadpart" />
<publish on="create-representation" additional-files="publish_cadpart" />
<publish on="schedule" additional-files="publish_cadpart" />
<publish on="unknown-source" additional-files="publish_cadpart" />
</if>
<if condition="is_asm">
<publish on="checkin" additional-files="publish_cadasm" />
<publish on="create-representation" additional-files="publish_cadasm" />
<publish on="schedule" additional-files="publish_cadasm" />
<publish on="unknown-source" additional-files="publish_cadasm" />
</if>
<publish on="checkin"/>
<publish on="create-representation"/>
<publish on="schedule"/>
<publish on="unknown-source"/>
<publish on="manual-post"/>
</authoring-application>
</rules>
Best regards!
Nenad
Check your spelling and case (this is case sensitive) ... should be epmdoc_lifeCycleState not epmdoc_liveCycleState (the file you attached doesn't match what you pasted in the post)
With Creo you can also take advantage of the epmdoc_docType attribute instead of doing regex for separating out drawings, parts and assemblies, for what it's worth. Unless you're running NX and your definitions for drawings vary but the file extension is always .prt.
What @jbailey said though is probably what's not registering.
Dobriša
Hi jbailey,
that's it, a typo, now it works. Thank you very much. I didn't see it, blinded by code 🙂
Best regards,
Nenad
It depends how you have the rules structured. Like @HelesicPetr said, if you add a bit of your publish rules it would be more informative.
Your conditions need to be pretty accurate based on what your desired result is.
Here's a snippet that works:
Condition is "Released_Part" and on that condition there are certain triggers.
Order of things matters for fall through matching.
Hi Dobi,
thank you for your answer. In my xml (the whole xml file can be seen in other post) first I did
conditions like:
<condition name="is_drawing">
<and>
<attribute name="epmdoc_liveCycleState" value="Released"/>
<attribute name="epmdoc_CADName" regex=".*\.drw$"/>
</and>
</condition>
<condition name="is_cadpart">
<and>
<attribute name="epmdoc_liveCycleState" value="Released"/>
<attribute name="epmdoc_CADName" regex=".*\.prt$"/>
</and>
</condition>
<condition name="is_asm">
<and>
<attribute name="epmdoc_liveCycleState" value="Released"/>
<attribute name="epmdoc_CADName" regex=".*\.asm$"/>
</and>
</condition>
after that I check if condition is true:
<if condition="is_drawing">
<publish on="checkin" additional-files="publish_drawing" />
<publish on="schedule" additional-files="publish_drawing" />
<publish on="create-representation" additional-files="publish_drawing" />
<publish on="unknown-source" additional-files="publish_drawing" />
</if>
<if condition="is_cadpart">
<publish on="checkin" additional-files="publish_cadpart" />
<publish on="create-representation" additional-files="publish_cadpart" />
<publish on="schedule" additional-files="publish_cadpart" />
<publish on="unknown-source" additional-files="publish_cadpart" />
</if>
<if condition="is_asm">
<publish on="checkin" additional-files="publish_cadasm" />
<publish on="create-representation" additional-files="publish_cadasm" />
<publish on="schedule" additional-files="publish_cadasm" />
<publish on="unknown-source" additional-files="publish_cadasm" />
</if>
Also at the top of the file evaluation of rules is set: evaluate-rules-on-republish="true"
What I tried was the following:
Best regards,
Nenad
@nbojcetic - check your spelling... its lifecycle not livecycle ... also be careful with capitalization/syntax
Right or wrong this is what our first go looked like to publish PDF's for released drawings. One thing we found out though, was that our users needed stuff at other states as well, especially when they needed PDF's to be reviewed by outside folks during promotions/change task approvals. Something else we found was that case matters on the expressions when searching for filenames. This was something made apparent with our Solidworks publishing. .*\slddrw$ wouldnt publish a file that was MySWFile.SLDDRW but would publish MySWFile.slddrw