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

Community Tip - Have a PTC product question you need answered fast? Chances are someone has asked it before. Learn about the community search. X

contradictory conditions in publish rules

Hans_TS
1-Newbie

contradictory conditions in publish rules

I am using Windchill PDMLink Release 12.0 and Datecode with CPS 12.0.2.8

Is it possible to have contradictory conditions in publish rules.
We want to have a condtion in the publish where content (STEP/PDF) only is published when attribute MODEL_TYPE is empty. If this value is not empy it should not publish any content only the pvz.

1 ACCEPTED SOLUTION

Accepted Solutions
HelesicPetr
22-Sapphire I
(To:Hans_TS)

Hi @Hans_TS 

But you use regex definition in the value definition.

Iam sure that it can not work. 

 

use <or> definition for each value or use regex= parameter instead of value= 

 

PetrH

View solution in original post

9 REPLIES 9

We already tried the following:

<condition name="3DPRT_released">
<and>
<attribute name="epmdoc_docType" value="CAD Part" />
<attribute name="epmdoc_MODEL_TYPE" regex=")$" />
<or>
<attribute name="epmdoc_lifeCycleState" value="Design Review" />
<attribute name="epmdoc_lifeCycleState" value="Design Approved" />
<attribute name="epmdoc_lifeCycleState" value="Design Manual Approved" />
<attribute name="epmdoc_lifeCycleState" value="Prototype" />
<attribute name="epmdoc_lifeCycleState" value="Production" />
<attribute name="epmdoc_lifeCycleState" value="Obsolete" />
</or>
</and>
</condition>

 

Publish rule has no error but when attribute MODEL_TYPE is empty is not publishing any content

HelesicPetr
22-Sapphire I
(To:Hans_TS)

Hi @Hans_TS 

Empty? so try value="" 

PetrH

Hi,

Thank you for your response.

We already tried that but this is not working.

This is resulting in an error during replacing the publish_rules.xml.

H.smits

HelesicPetr
22-Sapphire I
(To:Hans_TS)

So if it does not work you need to find better way.

For example why the parameter should be empty? use some default or not empty value that you can use in the condition. 

PetrH

It could be configured in two ways.

1. attribute value is empy

2. Attribute is not .....|...|

 

Do you know how to set up the rule that the value must not have some value?

As example 

<condition name="3DPRT_released">
<and>
<attribute name="epmdoc_docType" value="CAD Part" />
<attribute name="epmdoc_MODEL_TYPE" value=not "SOLIDPART|SHEETMETALPART" />
<or>
<attribute name="epmdoc_lifeCycleState" value="Design Review" />
<attribute name="epmdoc_lifeCycleState" value="Design Approved" />
<attribute name="epmdoc_lifeCycleState" value="Design Manual Approved" />
<attribute name="epmdoc_lifeCycleState" value="Prototype" />
<attribute name="epmdoc_lifeCycleState" value="Production" />
<attribute name="epmdoc_lifeCycleState" value="Obsolete" />

HelesicPetr
22-Sapphire I
(To:Hans_TS)

Hi @Hans_TS 

Check the help

Using Conditions in Publish Rules

Examples of Publish Rules XML Files

 

Supported element NOT

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

PetrH

I tried the following:

    <condition name="3DPRT_released">  
      <and>
          <attribute name="epmdoc_docType" value="CAD Part" />
        <not>
<attribute name="epmdoc_MODEL_TYPE" value="(SOLIDPART|SOLIDPART).*$" />
      </not>
        <or>
          <attribute name="epmdoc_lifeCycleState" value="Design Review" />        
          <attribute name="epmdoc_lifeCycleState" value="Design Approved" />        
          <attribute name="epmdoc_lifeCycleState" value="Design Manual Approved" />        
        </or>
      </and>
 
Now the additional output is created as a step file when attribute MODEL_TYPE is empty but when it is set to example SOLIDPART it will also create a stepfile so it is not working as we want.
     
 
HelesicPetr
22-Sapphire I
(To:Hans_TS)

Hi @Hans_TS 

But you use regex definition in the value definition.

Iam sure that it can not work. 

 

use <or> definition for each value or use regex= parameter instead of value= 

 

PetrH

Thank you I think this is the solution.

Top Tags