Event properties

Hi,

we need to get the name of an event (using Analytics builder or EPL, it doesnt matter)

usually in the event documentation below, .source is the cumulocity internal ID of the device and not its name:

while in the web interface i can see the name of the device in the event details

so how can we retrieve this name via analytics builder (ex: using extract property) or via EPL? is it possible? and if yes, which property path name we should use?

An event does not have any name just text. Are you referring to the name of the device the event is created for?

If so I think you need to do a managed object query with the provided source ID to retrieve the device name.

Check out the example in the documentation:

Hi Stefan, yes I am referring to the name of the device as mentioned in my 1st post:

so I cannot extract it from the event in anyway using analytics builder extract property object, correct?

The event contains only the id of the device but not the name. Depending on your model you may be able to use the Managed Object Input block to get the name. Make sure to enable “Capture Start Value”. If you are only interested in the name you can configure the “Property Name” parameter to be name. Be aware that changes to the name might trigger the model and if you are using groups make sure you implement the intended triggering behavior.

Thanks Harald for the valuable tip, I tested “Capture start value” and it is working perfectly as intended. I would like to double-check one thing:

why this feature should not be turned on if input source is “All inputs”? just because of the potential resources needed when we turn on the model? or something else? if it is just related to resources needed when turning up the model we can do it in non-peak time its fine

additional challenge: after taking the name in the previous step, now we need dynamically insert it as “input source” or an event. We used templates before but templates need to be done statically while our aim is to have this insertion dynamically on value fetch or value change, is it feasible?

Actually the documentation says “must not” and not “should not”. So using “Capture Start Value” cannot be used when “All Inputs” is selected. I am not sure if there is a technical issue with this or it is just to avoid fetching all managed objects and instantiating Analytics Builder models for them.

You cannot dynamically select a device in an Analytics Builder model. For input blocks, if you have one input block for an event and another one for the managed object, selecting the same group as device will ensure that both will match. For output blocks you have to select “trigger device” which will also automatically match the devices.

If you are just interested in the ‘name’ of the device, this information is usually available in the parameters dictionary as ‘source.name’ or ‘source_name’.

Do note that it might not always be present, example: If a model is consuming data generated by another analytics builder model, then the notifications are routed internally, so some fields might be absent.

Thanks Harald, well noted for avoiding “Capture start value” probably it is resources intensive for all inputs, in the note nothing indicates not using it for a group of workers and all inputs is just the bigger group on the platform.

for the second part, the goal is to compare the worker loc event to his supervisor loc event to make sure that they are in the same area, thats why after getting the supervisor info from the worker’s device managed object I need to populate this supervisor info dynamically in event#2 (supervisor one) getting compared to event#1

Thanks Sandeep, I printed a sample of those events and it seems the params dictionary is empty
image

This is an example of ‘internally’ routed event where the ‘id’ field is also empty

perhaps you can filter on id not being empty?

I tested the following solution and it works: instead of getting the needed info from the event, in the same analytics builder model creating this event we are also storing the needed final param in a managed object. Later we are catching this managed object in an EPL

1 Like