Skip to main content
1-Visitor
July 24, 2012
Question

Disable Container Level OIR's

  • July 24, 2012
  • 13 replies
  • 2058 views

OIR question.


At my current client location, they have a wc10.1 OIR disable at container level issue.


For whatever reason, they have like 50 containers with 10 different OIR's.


They now want to override & disable those 50 or so, with 10 new ORG level
OIR's, that they will loadfromfile create.

Obviously they dont want to manually select disable for 500 OIR's from the interface.


I'll assume that you cant change the container level OIR's to disabled
through loadfronfile, but I could be wrong.


Does anybody know the route to diable those. LoadFromFile, coding, ???


Thanks
L Jett

13 replies

cadjett1-VisitorAuthor
1-Visitor
July 24, 2012

Update:

We are upgrading from 9.1 to 10.1.

We tried the diable container level OIR route through loadfromfile enable="false", as in loadfromfile snippet below:



<organizationconfig>

<typebasedrule>
<enginerule isdefault="false" enabled="&lt;strong">false">
<rulename>Test OIR</rulename>
<rulespecification> <attributevalues objtype="wt.doc.WTDocument|&lt;type">">
.........

But the false did not work on an existing OIR. But if you manually delete the OIR 1st,
then run the same loadfromfile with false on, it creates & is disabled.

Just wont work on existing.

We have a call in to ptc support & they mentioned possible code on wc9.1 to delete the OIR. Thats not a preference,
but well accept what we can get. But we are waiting.

If anyone has working loadfromfile &/or source to disable or delete, it would be very helpful.

L Jett

1-Visitor
July 24, 2012
I never investigated, but I wanted a SQL script to disable the OIR's at the database level. Or a commamnd line tool.

I like to load them to be able to see them, but still use my own. Each system is different of course.

Dave

Sent from my Verizon Wireless BlackBerry
cadjett1-VisitorAuthor
1-Visitor
July 24, 2012

Good idea Dave,

I did a little research on the sql side:


I just noticed there is a "ENABLEDFLAG" column in the TYPEBASEDRULE table



select * from windchill.TYPEBASEDRULE

CLASSNAMEKEYCONTAINERREFEREN|IDA3CONTAINERREFERENCE|DEFAULTRULE|DESCRIPTION|CLASSNAMEKEYDOMAINREF|IDA3DOMAINREF|0|0|Document Control Form OIR|wt.doc.WTDocument|<type>|INIT||0||UTF8|2011-05-08 12:23:26.0|0|2011-05-08 12:23:26.0|wt.rule.TypeBasedRule|21262|1|2011-05-08 12:23:26.0



Its either a 1 or a 0


if all else fails, I bet we could use sql to disable the OIR's we want. change the 0 to 1.


Or write java class to run sql.


But I have been looking for java withTYPEBASEDRULE & ENABLEFLAG in java code.


I think I have already found the class that LoadFromFile uses to do OIR's:

wt.ixb.handlers.netmarkets.OrgConfigIXHandler


for(Enumeration enumeration7 = ixbelement.getElements("TypeBasedRule"); enumeration7.hasMoreElements(); vector.clear())
{
if(flag1)
{
orgTags;
vector.add("TypeBasedRule");
ProjectIXUtils.postFeedback(importer, "wt.ixb.handlers.netmarkets.NMIxResources", "20", vector.toArray(), 1);
vector.clear();
flag1 = false;
}
IxbElement ixbelement9 = (IxbElement)enumeration7.nextElement();
orgTags;
vector.add("TypeBasedRule");
typeRuleTags;
vector.add(ixbelement9.getValue("className"));
ProjectIXUtils.postFeedback(importer, "wt.ixb.handlers.netmarkets.NMIxResources", "22", vector.toArray(), 2);
importer.importElement(ixbelement9);
ProjectIXUtils.postFeedback(importer, "wt.ixb.handlers.netmarkets.NMIxResources", "23", vector.toArray(), 2);
}

if(!flag1)
{
orgTags;
vector.add("TypeBasedRule");
ProjectIXUtils.postFeedback(importer, "wt.ixb.handlers.netmarkets.NMIxResources", "21", vector.toArray(), 1);
vector.clear();
}


See the "TypeBasedRule" above.


I will run with the java side, because I am not great with sql to change table entries. more on the query side.

If anybody knows the sql to change the 0 to 1, that might help. I could test on a vmware.

LJett


More later.
20-Turquoise
July 24, 2012
On 07/24/12 12:23, Lawrence Jett wrote:
>
> Good idea Dave,
>
> I did a little research on the sql side:
>
> I just noticed there is a "*ENABLEDFLAG*" column in the *TYPEBASEDRULE* table
> select * from windchill.TYPEBASEDRULE
>
> CLASSNAMEKEYCONTAINERREFEREN|IDA3CONTAINERREFERENCE|DEFAULTRULE|DESCRIPTION|CLASSNAMEKEYDOMAINREF|IDA3DOMAINREF|*ENABLEDFLAG*|INHERITEDDOMAIN|NAME|OBJTYPE|RULETYPE|SECURITYLABELS|SPECIFICATIONISNULL|CONTENTSA5|ENCODINGA5|CREATESTAMPA2|MARKFORDELETEA2|MODIFYSTAMPA2|CLASSNAMEA2A2|IDA2A2|UPDATECOUNTA2|UPDATESTAMPA2
> wt.inf.container.OrgContainer|14523|0||wt.admin.AdministrativeDomain|14524|*0*|0|*FMCNA Document
> Control Form OIR|wt.doc.WTDocument|<type>*|INIT||0||UTF8|2011-05-08 12:23:26.0|0|2011-05-08
> 12:23:26.0|wt.rule.TypeBasedRule|21262|1|2011-05-08 12:23:26.0
> Its either a 1 or a 0
> if all else fails, I bet we could use sql to disable the OIR's we want. change the 0 to 1.
> Or write java class to run sql.
> But I have been looking for java with TYPEBASEDRULE & ENABLEFLAG in java code.
> I think I have already found the class that LoadFromFile uses to do OIR's:
>
> *wt.ixb.handlers.netmarkets.OrgConfigIXHandler*
> for(Enumeration enumeration7 = ixbelement.getElements("*TypeBasedRule*");
> enumeration7.hasMoreElements(); vector.clear())
> {
> if(flag1)
> {
> orgTags;
> vector.add("*TypeBasedRule*");
> ProjectIXUtils.postFeedback(importer, "wt.ixb.handlers.netmarkets.NMIxResources",
> "20", vector.toArray(), 1);
> vector.clear();
> flag1 = false;
> }
> IxbElement ixbelement9 = (IxbElement)enumeration7.nextElement();
> orgTags;
> vector.add("*TypeBasedRule*");
> typeRuleTags;
> vector.add(ixbelement9.getValue("className"));
> ProjectIXUtils.postFeedback(importer, "wt.ixb.handlers.netmarkets.NMIxResources",
> "22", vector.toArray(), 2);
> importer.importElement(ixbelement9);
> ProjectIXUtils.postFeedback(importer, "wt.ixb.handlers.netmarkets.NMIxResources",
> "23", vector.toArray(), 2);
> }
> if(!flag1)
> {
> orgTags;
> vector.add("*TypeBasedRule*");
> ProjectIXUtils.postFeedback(importer, "wt.ixb.handlers.netmarkets.NMIxResources",
> "21", vector.toArray(), 1);
> vector.clear();
> }
> See the "*TypeBasedRule" *above*.*
> *I will run with the java side, because I am not great with sql to change table entries. more on
> the query side.
>
> If anybody knows the sql to change the 0 to 1, that might help. I could test on a vmware.
> *

The sql is trivial:
update TYPEBASEDRULE set ENABLEDFLAG = '0' where ???;
commit;

The "where" is the key in only updating rows that are appropriate. ie
update TYPEBASEDRULE set ENABLEDFLAG = '0' where ida3domainref = '7';
commit;

or

update TYPEBASEDRULE set ENABLEDFLAG = '0' where ida3domainref = '13420' and objtype =
'wt.epm.document';
commit;


> *
> LJett
> *
> More later.
>
> -----End Original Message-----


--
------------------------------------------------------------------------
Randy Jones
Systems Administrator
Great Plains Mfg., Inc.
1525 E North St
PO Box 5060
Salina, KS USA 67401
email: -
Phone: 785-823-3276
Fax: 785-667-2695
------------------------------------------------------------------------

1-Visitor
July 25, 2012

Randy is right. The sql is trivial, I would suggest:


update TYPEBASEDRULE set ENABLEDFLAG = '1' where NAME in ('<an_oir_name_here>', '<another_oir_name_here>', '<etc>');


However, I noticed in our system, the ENABLEDFLAG field has values of 0,1or 2. So before making the change in production, I would suggest that someone determine the difference between the intended use of 1 and 2 in a test system. Lawrence has suggested he would try this first on a vmware image. I would be interested in knowing what the difference between the Flag values is.

cadjett1-VisitorAuthor
1-Visitor
July 25, 2012

Yes, I was already using:

UPDATE TYPEBASEDRULE SET enabledFlag='0' WHERE IDA2A2='6460';

But I ran into an issue. I had read or assumed that the enableFlag would either be 0 or 1.

I am finding values other than those. I will research.

L Jett

10-Marble
July 25, 2012
Change one through the UI to disabled, what is the value? Use that in your SQL
cadjett1-VisitorAuthor
1-Visitor
July 25, 2012

I found values other than 0,1,2. Some 100,200,300 plus.

The odd part is that on the dev box, they are all 0 & enabled.

On the vmware, they are 0-399, with no consistancy.

I at first that it would be 0 or 1 for org level. Then maybe 0 or 200 for product xyz, 0 or 300 for library abc.

No dice. All over the place.

Still researching...

L Jett

cadjett1-VisitorAuthor
1-Visitor
July 25, 2012

I did that. Disable.

For "? CN OIR", it changed the enableFlag to 361.
I thought OK, when I change the "? CA OIR", it will also be 361. Nope. 362. I actually figured it would be different.

I would assume that when I go back & change it to enable, it will go back to 0.

Opps, what happens when you assume with PTC &/or Windchill, you make an azzOfPTC....sorry Jeff....ha..ha

Let me go check that.

L Jett

cadjett1-VisitorAuthor
1-Visitor
July 25, 2012

Enabled both & they went back to 0.


For the heck of it, I disabled to see if it would go back to either 361 or 362.

It went to 363. Incremental.

Now I should run the sql code & change it to 1 & see what it does. See if it disables or freaks out.

It does seem the the "wt.inf.container.ExchangeContainer" ones are all 0 or 1.

Where the 356 is container level (product/Library).

More research/testting.

L Jett