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

Community Tip - You can change your system assigned username to something more personal in your community settings. X

Deleting Soft Attribute

Mona
1-Newbie

Deleting Soft Attribute

When I try to delete an attribute, which was previously linked to a soft type that has also been deleted, I get the following error message:

Delete "xxx" failed: "xxx" cannot be deleted because it is currently in use.

It is however not currently in use!Any ideas?

I'm using Windchill 9.1M010

12 REPLIES 12
avillanueva
22-Sapphire I
(To:Mona)

You likely have created an object that has used that attribute already?
bfrandsen
6-Contributor
(To:Mona)

Be sure you have language English (United States)[en-us] added in your
browser.
Tools > Internet Options... and button [Languages...]



Regards,
Bjarne



"mona abul-husn" <mona.abul-husn@raynet-it.com>
03-04-2009 12:15
Please respond to
"mona abul-husn" <mona.abul-husn@raynet-it.com>


To
-
cc

Subject
[solutions] - Deleting Soft Attribute






When I try to delete an attribute, which was previously linked to a soft
type that has also been deleted, I get the following error message:
Delete "xxx" failed: "xxx" cannot be deleted because it is currently in
use.
It is however not currently in use! Any ideas?
I'm using Windchill 9.1M010


Mona
1-Newbie
(To:Mona)

No, its a new soft type, so I am sure that I have not created objects with this attribute. Is it possible that the deleted soft type and its attributes, constraints is still stored somewhere? I think that would be the only reason for the error message...

In Reply to Antonio Villanueva:
You likely have created an object that has used that attribute already?
ddemay
1-Newbie
(To:Mona)

If you want to delete, tell me what type it is.



There is a definition table that has two entries created in the database
table and the user interface will not allow deletion. You have to remove it
through SQL or using a tool like dbVisualizer, sql developer, or toad. Let
me know more details about the soft type definition you created and I'll
help you delete it.







BTW, as a side note. If anyone ever wanted to to say have a string attribute
that contains numbers get converted to integer or vice versa.you can convert
attribute types provide you migrate the data also to a different table. I
have done this before also.





HTH,

David DeMay





_____
Mona
1-Newbie
(To:Mona)

It is a string attribute and it was linked to a Document soft type.

In Reply to Dave DeMay:

If you want to delete, tell me what type it is.



There is a definition table that has two entries created in the database
table and the user interface will not allow deletion. You have to remove it
through SQL or using a tool like dbVisualizer, sql developer, or toad. Let
me know more details about the soft type definition you created and I'll
help you delete it.







BTW, as a side note. If anyone ever wanted to to say have a string attribute
that contains numbers get converted to integer or vice versa.you can convert
attribute types provide you migrate the data also to a different table. I
have done this before also.





HTH,

David DeMay





_____
ddemay
1-Newbie
(To:Mona)

Every time a type is created, an implicit value is added to tables where
first attribute is defined.



So:



select ida2a2 from wttypedefinition where
LOGICALIDENTIFIER='testsoftdoctype';

delete from STRINGVALUE where ida3a4=<use ida2a2=" for=" wttypedefinition<br="/>returned by select above>;





Next, There is a table called StringDefinition - you'll need to delete the
string typed attributes out of here first. Knowing the information you
used to create it is important here:



delete from stringdefinition where name='name used to create attribute' and
hierarchydisplayname='heirarchy name used'



(Note be careful to make sure you aren't using in any other soft type since
attributes can be shared)



Now you need to delete the wttypedefintion and wttypedefinitionmaster.
Yes,it is iterated since you can check it in and check it out.



delete from WTTYPEDEFINITION where LOGICALIDENTIFIER='testsoftdoctype';



(Should say at least 2 rows deleted - more if several iterations were
created - these 2 rows are what keep the GUI from being able to delete)





Now to delete the master for the definition:



delete from WTTYPEDEFINITIONMASTER where
INTHID='wt.doc.WTDocument|com.vmplm.testsoftdoctype' and
HIERARCHYDISPLAYNAMEKEY='testsoftdoctype';



(Note: the above deletes my example soft type - you'll have to switch out
the names, etc. to match your particular type)







Hope this helps many learn this and someone can post an improved query
joining all the table comuns and stuff. I typically just do it visually
through a UI tool and sort by the date I created it.





David DeMay





_____
ddemay
1-Newbie
(To:Mona)


That is your two cents. 🙂 I have never ever been able to delete a type
100% using the type manager in 8 or type and attribute manager in 9.

Also - not everyone can program. Sure, I could write something in code to do
it. I am an advocate of avoiding SQL, but in this case its faster this way.

I have done this many of times - even during upgrades and it has not
impacted the system negatively at all.


Of course, you should practice on a test box first.

If you read, they said the type is not in use and never was. If it was in
use, there would be more to clean up.





rey
1-Newbie
1-Newbie
(To:Mona)

It seems to happen only on 9.1. I've tried it on 9.0 and it let's me
delete it there.

Rey

YoonKim
5-Regular Member
(To:Mona)

I have a call opened to PTC which is the same issue here.
According to them, from 9.1, it is not possible to delete an attribute/IBA once it is linked to a type as a softtype.
This restriction takes effects in prior to new object creation with the IBA.

just my 2 cents:

doing things like this via sql delete is asking for heavy trouble.
you'll also have a good deal of orphaned other objects because no
listener is doing any cleanup.

why not just delete the typedefinition from the UI?

unless I tried invain to remove objects via api
(PersistenceHelper.manger.delete()) or a bit stronger with
PersistenceServerHelper.manger.remove()
or even stronger with PersistentObjectManager.getPom().remove() I'd
resist the sql approach - unless you are on a system that you don't need
at all.

martin


David DeMay wrote:
>
> Every time a type is created, an implicit value is added to tables
> where first attribute is defined.
>
> So:
>
> select ida2a2 from wttypedefinition where
> LOGICALIDENTIFIER='testsoftdoctype';
>
> delete from STRINGVALUE where ida3a4=<use ida2a2=" for=" wttypedefinition<br="/>> returned by select above>;
>
> Next, There is a table called StringDefinition – you’ll need to delete
> the string typed attributes out of here first. Knowing the information
> you used to create it is important here:
>
> delete from stringdefinition where name=’name used to create
> attribute’ and hierarchydisplayname=’heirarchy name used’
>
> (Note be careful to make sure you aren’t using in any other soft type
> since attributes can be shared)
>
> Now you need to delete the wttypedefintion and wttypedefinitionmaster.
> Yes,it is iterated since you can check it in and check it out.
>
> delete from WTTYPEDEFINITION where LOGICALIDENTIFIER='testsoftdoctype';
>
> (Should say at least 2 rows deleted – more if several iterations were
> created – these 2 rows are what keep the GUI from being able to delete)
>
> Now to delete the master for the definition:
>
> delete from WTTYPEDEFINITIONMASTER where
> INTHID='wt.doc.WTDocument|com.vmplm.testsoftdoctype' and
> HIERARCHYDISPLAYNAMEKEY='testsoftdoctype';
>
> (Note: the above deletes my example soft type – you’ll have to switch
> out the names, etc. to match your particular type)
>
> Hope this helps many learn this and someone can post an improved query
> joining all the table comuns and stuff. I typically just do it
> visually through a UI tool and sort by the date I created it.
>
> David DeMay
>
ddemay
1-Newbie
(To:Mona)

Yes, so you would have to use the SQL I provided to accomplish it.



_____
Mona
1-Newbie
(To:Mona)

Thanks Dave, the SQL Statements worked with no side effects yet! I don't see any other way. I have opened a case with PTC but theydidn't respond yet...

Top Tags