Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Kura » How to get AssetName by ChannelName (ChannelRecord)
How to get AssetName by ChannelName (ChannelRecord) [message #1832789] Fri, 25 September 2020 06:58 Go to next message
Martin Biskup is currently offline Martin BiskupFriend
Messages: 9
Registered: September 2020
Junior Member
Hi all,

I have created a bundle that iterates over all assets and channels using AssetService and starts the listeners for all channels. This bundle should handle all events of the channels.
When an event is triggered (onChannelEvent(ChannelEvenet event)), I only get the channel configuration from the ChannelRecord, but I also need information about the AssetName and DriverName. Does Kura offer a function to find out the AssetName based on the ChannelName?
Re: How to get AssetName by ChannelName (ChannelRecord) [message #1832792 is a reply to message #1832789] Fri, 25 September 2020 08:21 Go to previous messageGo to next message
Matteo Maiero is currently offline Matteo MaieroFriend
Messages: 423
Registered: July 2015
Location: Italy
Senior Member
Hi,
we don't have such feature at the moment. You have to track it when you proceed registering the listener.

Best regards
Re: How to get AssetName by ChannelName (ChannelRecord) [message #1832793 is a reply to message #1832792] Fri, 25 September 2020 08:51 Go to previous messageGo to next message
Martin Biskup is currently offline Martin BiskupFriend
Messages: 9
Registered: September 2020
Junior Member
Thanks for your reply. When i activate the listener for a channel in the Kura UI, and wire it with the H2DBStore, how does kura handle this? The assetName is stored in the database. Is it a internal function?
Re: How to get AssetName by ChannelName (ChannelRecord) [message #1832794 is a reply to message #1832793] Fri, 25 September 2020 08:55 Go to previous messageGo to next message
Matteo Maiero is currently offline Matteo MaieroFriend
Messages: 423
Registered: July 2015
Location: Italy
Senior Member
The message coming out of the asset contains also a reference to the name of the asset itself. That is the reason why you are seeing it in the downstream database
Re: How to get AssetName by ChannelName (ChannelRecord) [message #1832799 is a reply to message #1832794] Fri, 25 September 2020 10:28 Go to previous messageGo to next message
Martin Biskup is currently offline Martin BiskupFriend
Messages: 9
Registered: September 2020
Junior Member
Another idea: If I activate the listener via the Ui and connect the assets with the WireGraph to the MQTT-publisher, will there be any information about the asset?
Re: How to get AssetName by ChannelName (ChannelRecord) [message #1832800 is a reply to message #1832799] Fri, 25 September 2020 10:29 Go to previous messageGo to next message
Matteo Maiero is currently offline Matteo MaieroFriend
Messages: 423
Registered: July 2015
Location: Italy
Senior Member
The information will be in the message in the wires. Then it depends on the publisher that you'll use.
Re: How to get AssetName by ChannelName (ChannelRecord) [message #1833100 is a reply to message #1832800] Fri, 02 October 2020 09:00 Go to previous message
Martin Biskup is currently offline Martin BiskupFriend
Messages: 9
Registered: September 2020
Junior Member
The asset name is the same as kura.service.pid. So I used the method assetService.getAssetPid(Asset) and got the asset name! This was my solution to my question.
Previous Topic:WireAsset does not start reading
Next Topic:How to add new logging as a text file and not using kura.log
Goto Forum:
  


Current Time: Thu Apr 25 05:54:42 GMT 2024

Powered by FUDForum. Page generated in 0.03316 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top