Skip to main content
1-Visitor
December 15, 2011
Question

Object-Initialisation Rule - GetDiscreteSetConstraint Question

  • December 15, 2011
  • 3 replies
  • 4020 views

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

3 replies

22-Sapphire I
December 15, 2011

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.

1-Visitor
December 16, 2011

@ 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 ?

22-Sapphire I
December 16, 2011

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.

1-Visitor
December 19, 2011

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

1-Visitor
January 19, 2012

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.