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

Community Tip - Did you get an answer that solved your problem? Please mark it as an Accepted Solution so others with the same problem can find the answer easily. X

V2 equivalent of context.getDevice

ablyth
10-Marble

V2 equivalent of context.getDevice

Hi,

 

Is there a V2 equivalent of context.getDevice that will return an Asset instead of a V1 Device object? If not, what would be the recommended method for obtaining the Asset object when a Custom Object is triggered by an Expression Rule?

 

Thanks!

Alan

2 REPLIES 2
cdovholuk
12-Amethyst
(To:ablyth)

Unfortunately there is no way to get a v2 equivalent without fetching it back again as of the latest version of the Axeda Platform 6.8.

I would simply do:


import static com.axeda.sdk.v2.dsl.Bridges.*



Asset v2Asset = assetBridge.findById(context.getDevice().getId().toString())


//use the v2Asset


I recognize that's less than ideal but it'd work fine.

Cheers,

-Clint

ablyth
10-Marble
(To:ablyth)

Lovely one-liner,

Thanks Clint, i was hoping you'd be around and provide an excellent answer as always!

Alan,

Announcements


Top Tags