cancel
Showing results for 
Search instead for 
Did you mean: 

How to determine if a keyword is a multi-instance keyword

Tim_Sanders
Champ on-the-rise
Champ on-the-rise

Using the Java Unity API, If I have the name of a keyword, how do I determine if a keyword is a multi instance keyword?

I know that I can get a Record Type object from a KeywordRecordType,

but I'm not sure how to get that from a keyword by name.

Ideally I would like to get a KeywordType by name and then determine whether it is a multi-instance keyword or not.

I can get KeywordType like:

ktype = app.getCore().getKeywordTypes().Find(keywordName);

but unsure where to get the KeywordRecordType and then RecordType from this.

Thanks!

Tim


1 ACCEPTED ANSWER

Nevin_Steindam
Star Contributor
Star Contributor

A keyword type on its own is not automatically standalone or multi-instance. That depends on how it is used in a given document type. It's possible for a keyword type to be configured on one document type as a standalone keyword and on another document type as part of a keyword group.

So from the an instance of KeywordType or Keyword, you won't be able to tell what group(s) it is a part of - that question doesn't make sense in OnBase. You would normally get the KeywordRecordType when starting from a DocumentType.

If you want a complete list, you would need to iterate through all the configured keyword record types:

foreach(KeywordRecordType krt in app.Core.KeywordRecordTypes){     // ...}

While looking at the system's configuration, you can search for a specific keyword type, or put together your own data structure that tracks where each keyword type appears. Of course, to be REALLY thorough, you'd need to start from app.Core.DocumentTypes, so you could also find out which keyword types are used as standalone keywords sometimes.

View answer in original post

1 REPLY 1

Nevin_Steindam
Star Contributor
Star Contributor

A keyword type on its own is not automatically standalone or multi-instance. That depends on how it is used in a given document type. It's possible for a keyword type to be configured on one document type as a standalone keyword and on another document type as part of a keyword group.

So from the an instance of KeywordType or Keyword, you won't be able to tell what group(s) it is a part of - that question doesn't make sense in OnBase. You would normally get the KeywordRecordType when starting from a DocumentType.

If you want a complete list, you would need to iterate through all the configured keyword record types:

foreach(KeywordRecordType krt in app.Core.KeywordRecordTypes){     // ...}

While looking at the system's configuration, you can search for a specific keyword type, or put together your own data structure that tracks where each keyword type appears. Of course, to be REALLY thorough, you'd need to start from app.Core.DocumentTypes, so you could also find out which keyword types are used as standalone keywords sometimes.