Can anyone give some guides or use cases?


Stalski’s picture

Status: Active » Fixed

The user ID is always the actor, that you might have guessed. The user target ID is used when a message needs to be addressed to a user or when the message tells something about a relationship between the two users.
The enity ID should be an entity, but for now it's only nodes. The enity ID is used when a node is mentioned in the message. You can see this as contextual properties of a message. If you need another node, then use the entity target ID as well.
Examples beneath:

1) A user posts an activity Status message on the user profile page, where the User Activty stream is. Here heartbeat will use the "uid_target" property by default when a user posts such a message on the wall of someone else.

2) A user becomes friends with another user. Here the uid is the requester and the uid_target the requestee. Typically here you will log the message with the user-user Rules action. Internall heartbeat will log twice with the uid_target as requestee and the uid as requester as well. At display time this will be filtered out.

3) A person becomes member of a group: Here I keep the uid the actor and the entity ID the group node!

4) a person blogs in a OG group: Here the og post is the entity ID and the group node will be the entity target ID.

5) If you want to log a person commenting on a node you can do this conceptually different. You can go as far as
- user ID is actor
- the entity_id the node that was commented
- the user target ID the original author of the node (which could be notified on his personal stream this way)

I hope this was a good answer to your question. Maybe it helps others too.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

Jarode’s picture

Status: Closed (fixed) » Active

Is it possible to use target id as token in the same way we use "!username" in a heartbeat template ?


tjhart87’s picture

3) A person becomes member of a group: Here I keep the uid the actor and the entity ID the group node!

Stalski i've been struggling with getting this to work correctly. Would it be possible for you to show me your exact setup on the rule? Event, condition, Actions?

I've set it up multiple ways and have yet to be able to get it to print out a the group linked to the node.