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

Community Tip - You can subscribe to a forum, label or individual post and receive email notifications when someone posts a new topic or reply. Learn more! X

How to determine Object Type in a QueryResult? looking for a Java snippet for use in an Exp. Robot

kpritchard
12-Amethyst

How to determine Object Type in a QueryResult? looking for a Java snippet for use in an Exp. Robot

(preface: we use Change Management for Initial Release and Revisions for WTParts & WTDocuments, Promotion is used only for WTParts tomove from one"frozen/Released equivalent" State toanother)


So I'm trying to do a Workflow that will allow for a release at an advancedmaturity (State) for a limited kind (not Type or SoftType) of WTParts. I've pretty much got everythingexcepta logical test for "is the QueryResult element a WTPart" so I don't end up trying to set EPMDocuments &WTDocuments to States that are not in their Lifecycle. The idea here is toset the State onWTParts in the Resulting Objectsin preparation for the Change Transition when triggered. As an example, making something Obsolete is more closely related to aChange than a Promotion Notice so in this casewe'd set State to"Pending Obsolescence" which would have a change transition to "Obsolete".


Any guidance on how to test a mixed list of WTPart, WTDocument and EPMDocuments to diffentiate the WTParts?

1 REPLY 1
avillanueva
22-Sapphire II
(To:kpritchard)

if ( object instanceof WTPart)

{

WTPart part = (WTPart) object;

//WTPart code here



}

else if (object instanceof EPMDocument)

{

EPMDocument doc = (EPMDocument) object;

//EPMDoc code here



}

else if (object instanceof WTDocument)

{

WTDocument doc = (WTDocument) object;

//WTDoc code here

}


Announcements


Top Tags