Home Forums Business Model Rules How to use token in a sub-collection in Rules

Viewing 2 reply threads
  • Author
    • #16916

      I am trying to figure how to send notification related to SLM next touch date.

      I did try to create a new subject area based on EntityTouch for this requirement. Although it gives me all the token I need and I was able to create a rule for it. But the biggest issue is scheduling was not triggered whatever changes I made to either service model from Contact tab or Home->Service Level Management tab. I did some debugging and figured out the changes triggered on Contact level not on EntityTouch level.

      Due to this limitation, I have to give up the original design and I found in Contact subject area, we can use Contact > Touch Type to set both Criteria as well as Execution config (Time Based).thereĀ  The path is from Contact-> EntityTouchTypeDate by a collection attribute: actTouchTypeDates.

      This solves half of our issue. Now my question is how can we use token in the notification text? like this:

      You have a SLM touch that will expire in 2 days.
      For: ${fullName}.
      Touch Type: ${touchType caption}.
      Touch Status: ${touchStatusCaption}.
      Last Touch: ${lastTouchDateStr}.

      Here ${fullName} is entity full name which is ok from Contact subject area.

      The other two ${touchType caption} and ${lastTouchDateStr} are all under EntityTouchTypeDate which is a collection. In this case, is there a way to include them as tokens?

      The fourth one ${touchStatusCaption} will have to be pulled from another collection of the current Contact.

      My question is: is this even possible to use tokens this way? If yes, how do we reference tokens in this case?




      You must be logged in to view attached files.
    • #16941
      Shahzad Qureshishahzad.qureshi

      Summary: You need a string attribute that’s calculated and use that as the token.

      This could potentially be achieved via a new calculated attribute that returns the string that you want since it’s a collection. In calculated attribute’s logic, you will need to make sure that you are pulling the right touch object since it’s a collection.

      There is an existing calculated attribute “entityFullNames” and you could probably use the same pattern.

      Example: if you wanted a notification of a meeting to show all the participants in the for field, you would use the ${entityFullNames} token which is calculated to return the desired string, and not the association path of the collection ${entityParticipants entityFullName}

    • #16947

      Thanks Shahzad for the feedback.

      Looks like there is no easy way we can work with this issue besides adding calculated values to Entity (Contact) level.

      Another issue we have is we are seeding in rules instead of creating from Admin Console. There are quite a bit examples already using this approach in out application. But we will face the same issue as we use the sub collection attribute as tokens. We will have to see in the specific attribute from the collection and work from there, is that right?


Viewing 2 reply threads
  • You must be logged in to reply to this topic.