Create a Flow for Engagement Activities
Add Elements to the Flow
Linda must now create an accrual flow for engagement activities. Here’s a breakdown of the flow. The flow fetches transaction journals and checks for journal subtypes. Points are defined for the different activities. The flow checks the rules and credits points (qualifying and non-qualifying) to the members.
Linda selects the flow for engagement activities so she can modify it.
- Click , and select Setup.
- Enter
Flows
in the Quick Find box, and select Flows.
- Find and select the InnerCircleAccrualForEngagementActivities flow.
To this flow, Linda adds the Credit Points loyalty action.
- On the Elements tab, drag the Action element onto the canvas and provide the following details.
- Filter by: Loyalty
- Action: Credit Points
- Label:
CreditNonQualifyingPoints
- Program: Cloud Kicks Inner Circle
- Currency Type: Regular Points
- Recipient Member ID: Transaction Journal from GetTransactionJournals > MemberId
- Number of Points to Credit: PointsToCredit
- Journal ID: Transaction Journal from GetTransactionJournals > Id
- Click Done.
- Repeat steps 1 and 2 with the following values.
- Filter by: Loyalty
- Action: Credit Points
- Label:
CreditQualifyingPoints
- Program: Cloud Kicks Inner Circle
- Recipient Member ID: Transaction Journal from GetTransactionJournals > MemberId
- Currency Type: Tier Points
- Number of Points to Credit:
10
- Journal ID: Transaction Journal from GetTransactionJournals > Id
Linda must now connect all the elements using connectors to build the flow. This determines the order in which the flow is executed at run time.
- Connect the elements in the following sequence.
- The Start element to GetTransactionJournals (Get Records)
-
GetTransactionJournals (Get Records) to CheckJournalSubType (Decision)
-
CheckJournalSubType (Decision) to the three Assignment elements AssignmentForAppDownload, AssignmentForCustomerSurvey, and AssignmentForSocialMediaActivity, with outcome selections being App Download, Customer Survey, and Social Media Activity respectively
- All three Assignment elements to CreditNonQualifyingPoints (Action)
-
CreditNonQualifyingPoints (Action) to CreditQualifyingPoints (Action)
- Click Save.
- Click Activate.
This flow will check the engagement activity and credit qualifying and non-qualifying points. Since engagement-related transactions are loaded into the system every night, Linda needs to create a batch job to process them.
Create Accrual Batch
Linda creates a batch job to process transaction journal records in the pending state. Batch management creates smaller batches of the pending transactions and passes them through the flow. She then schedules the batch jobs to run as part of one scheduled flow. Let’s look at how she sets this up.
- Click , and select Setup.
- Enter
Batch
in the Quick Find box, and select Batch Management.
- Click New and provide the following details.
- Name:
InnerCircleAccrualBatch
- Process Type: Flow
- Group:
Loyalty
- Execution Process: InnerCircleAccrualForEngagementActivities
- Batch Size:
5
- Retry Count:
2
- Retry Interval:
1000
- Click Next and provide the following details.
- Flow Input Variable: JournalId
- Object: Transaction Journal
- Select Records When: Customize the Logic
- Custom Logic:
1 AND 2 AND 3 AND (4 OR 5 OR 6)
- Field: Loyalty Program ID
- Operator: Equals
- Type: Value
- Value: Cloud Kicks Inner Circle
- Click Add Condition and provide the following details.
Field
Operator
Type
Value
Status
Equals
Value
Pending
Journal Type ID
Equals
Value
Accrual
Journal SubType ID
Equals
Value
Social Media Activity
Journal SubType ID
Equals
Value
Customer Survey
Journal SubType ID
Equals
Value
App Download
- Click Save.
- Click Activate.
This batch job will filter transactions from the Transaction Journal object.
Resources