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

We are happy to announce the new Windchill Customization board! Learn more.

Object-Initialisation Rule - GetDiscreteSetConstraint Question

CarstenMueller
1-Newbie

Object-Initialisation Rule - GetDiscreteSetConstraint Question

Hello,

I try to create a OIR that uses the GetDiscreteSetConstraint to specify a list of valid entries.

The documentation just lists the rule name com.ptc.core.rule.server.impl.GetDiscreteSetConstraint

but there is no example how to use it.

What I want is to assign a list of customers (currently > 1000) to a lot of different document types.

using the Attribute Manager / Constraint Editor is a pain as it takes about 5 minutes to open the GUI.

(And I need it to do it on a lot of types.)

So now I found this OIR rule in the documentation.

Has anyone experience with this?

My OIR code:

<AttrConstraint id="Customer"

algorithm="com.ptc.core.rule.server.impl.GatherAttributeConstraints">

<Value algorithm="com.ptc.core.rule.server.impl.GetDiscreteSetConstraint">

<Arg>A</Arg>

<Arg>B</Arg>

<Arg>C</Arg>

</Value>

<Value algorithm="com.ptc.core.rule.server.impl.GetImmutableConstraint"> </Value>

</AttrConstraint>

As customer is an IBA I also tried <AttrConstraint id="IBA|Customer"

Without any effect.

Any help would be appreciated.

Carsten

6 REPLIES 6

If you're on 10.0, it's best to use the new Enumerated list for this. Create the list, point to as the value set for the discrete set.

If on 9.0 / 9.1, need to also add the attribute to the list of attributes by object type that the OIR for that type can address. If forget what that file is.

@ Mike,

thank you for your fast reply.

We are on Version 9.1. I added the attribute to the document softtype in the Type Manager before.

Is there another place I need to add it in order to use it in the OIR ?

You must add the attribute to be controlled by OIR to com/ptc/core/rule/server/delegate/init/RuleConfigurableTypeAttribute.properties file.

The properties file tells you what xconfmanager command to run at the top.

Once registered in this file, the OIR can control. Don't remember exactly who showed us this general technique but we use it quite a bit. Don't know where the master list is of which attributes can be controlled this way.

Thank you very much. I'll have a look at this.

Mike, in WC10, anyway to import a text file to create the enumerated list? Saves typing time.

As we are moving to Windchill 10 this year, I will now focus on using the enumerated list.

I hope to get the test system ready February / March in order to verify it.

Thanks for your help. I much appreciate it.

Top Tags