Skip to content

Instantly share code, notes, and snippets.

@alexed1
Created September 26, 2017 16:42
Show Gist options
  • Save alexed1/aea09a408b8408b854ad777316b2d805 to your computer and use it in GitHub Desktop.
Save alexed1/aea09a408b8408b854ad777316b2d805 to your computer and use it in GitHub Desktop.
Trigger Test 925
{
"fullName": "alexed925TriggerTest-2",
"actionCalls": [{
"name": "eventContextErrorEmail",
"label": "Context Error Email",
"locationX": "0",
"locationY": "0",
"actionName": "emailSimple",
"actionType": "emailSimple",
"inputParameters": [{
"name": "emailSubject",
"value": {
"stringValue": "Salesforce alexed925TriggerTest process didn't start: No matching records found"
}
}, {
"name": "emailBody",
"value": {
"elementReference": "noRecordsFoundTextTemplate"
}
}, {
"name": "emailAddresses",
"value": {
"stringValue": "aedelstein@salesforce.com"
}
}]
}, {
"name": "eventContextMoreEmail",
"label": "Context Error Email",
"locationX": "0",
"locationY": "0",
"actionName": "emailSimple",
"actionType": "emailSimple",
"inputParameters": [{
"name": "emailSubject",
"value": {
"stringValue": "Salesforce alexed925TriggerTest process didn't start: Multiple matching records found"
}
}, {
"name": "emailBody",
"value": {
"elementReference": "multipleRecordsFoundTextTemplate"
}
}, {
"name": "emailAddresses",
"value": {
"stringValue": "aedelstein@salesforce.com"
}
}]
}, {
"processMetadataValues": [{
"name": "postTarget",
"value": {
"stringValue": "group_edelstein"
}
}, {
"name": "textJson",
"value": {
"stringValue": "{\"mentions\":[],\"message\":\"Process Triggered\"}"
}
}],
"name": "myRule_1_A1",
"label": "Process Triggered",
"locationX": "100",
"locationY": "200",
"actionName": "chatterPost",
"actionType": "chatterPost",
"inputParameters": [{
"name": "text",
"value": {
"stringValue": "Process Triggered"
}
}, {
"name": "type",
"value": {
"stringValue": "GROUP"
}
}, {
"name": "subjectNameOrId",
"value": {
"stringValue": "0F9R00000000mt0KAA"
}
}]
}],
"assignments": {
"name": "RecordCountAssignment",
"label": "RecordCountAssignment",
"locationX": "0",
"locationY": "0",
"assignmentItems": [{
"assignToReference": "myVariable_event_record_count",
"operator": "Add",
"value": {
"numberValue": "1.0"
}
}, {
"assignToReference": "myVariable_event_context",
"operator": "Assign",
"value": {
"elementReference": "myVariable_event_current_record"
}
}],
"connector": {
"targetReference": "eventContextCheckLoop"
}
},
"decisions": [{
"name": "eventContextCheckDecision",
"label": "ContextCheckDecision",
"locationX": "0",
"locationY": "0",
"defaultConnector": {
"targetReference": "myDecision"
},
"defaultConnectorLabel": "default",
"rules": [{
"name": "eventContextCheckRule",
"conditionLogic": "and",
"conditions": {
"leftValueReference": "myVariable_event_record_count",
"operator": "EqualTo",
"rightValue": {
"numberValue": "0.0"
}
},
"connector": {
"targetReference": "eventContextErrorEmail"
},
"label": "Context Check Decision - Is Zero"
}, {
"name": "eventContextGtOneCheckRule",
"conditionLogic": "and",
"conditions": {
"leftValueReference": "myVariable_event_record_count",
"operator": "GreaterThan",
"rightValue": {
"numberValue": "1.0"
}
},
"connector": {
"targetReference": "eventContextMoreEmail"
},
"label": "Context Check Decision - Greater than One"
}]
}, {
"processMetadataValues": {
"name": "index",
"value": {
"numberValue": "0.0"
}
},
"name": "myDecision",
"label": "myDecision",
"locationX": "50",
"locationY": "0",
"defaultConnectorLabel": "default",
"rules": {
"name": "myRule_1",
"conditionLogic": "and",
"conditions": {
"leftValueReference": "formula_myRule_1",
"operator": "EqualTo",
"rightValue": {
"booleanValue": "true"
}
},
"connector": {
"targetReference": "myRule_1_A1"
},
"label": "pass through"
}
}],
"formulas": [{
"name": "formula_myRule_1",
"dataType": "Boolean",
"expression": "true"
}, {
"name": "OrganizationName",
"dataType": "String",
"expression": "{!$Organization.Name}"
}],
"interviewLabel": "alexed925TriggerTest-2_InterviewLabel",
"label": "alexed925TriggerTest",
"loops": {
"name": "eventContextCheckLoop",
"label": "ContextCheckLoop",
"locationX": "0",
"locationY": "0",
"assignNextValueToReference": "myVariable_event_current_record",
"collectionReference": "myVariable_event_context_collection",
"iterationOrder": "Asc",
"nextValueConnector": {
"targetReference": "RecordCountAssignment"
},
"noMoreValuesConnector": {
"targetReference": "eventContextCheckDecision"
}
},
"processMetadataValues": [{
"name": "EventType",
"value": {
"stringValue": "Recommendation_Request__e"
}
}, {
"name": "ObjectType",
"value": {
"stringValue": "Contact"
}
}],
"processType": "CustomEvent",
"recordLookups": {
"name": "myEventContextRecordLookup",
"label": "myEventContextRecordLookup",
"locationX": "0",
"locationY": "0",
"assignNullValuesIfNoRecordsFound": "false",
"connector": {
"targetReference": "eventContextCheckLoop"
},
"filters": {
"processMetadataValues": [{
"name": "implicit",
"value": {
"booleanValue": "false"
}
}, {
"name": "inputDataType",
"value": {
"stringValue": "String"
}
}, {
"name": "leftHandSideLabel",
"value": {
"stringValue": "Mailing Street"
}
}, {
"name": "leftHandSideReferenceTo",
"value": {
"stringValue": ""
}
}, {
"name": "leftHandSideType",
"value": {
"stringValue": "String"
}
}, {
"name": "operatorDataType",
"value": {
"stringValue": "String"
}
}, {
"name": "rightHandSideType",
"value": {
"stringValue": "Event"
}
}],
"field": "MailingStreet",
"operator": "EqualTo",
"value": {
"elementReference": "myVariable_myEvent.Status__c"
}
},
"object": "Contact",
"outputReference": "myVariable_event_context_collection"
},
"startElementReference": "myEventContextRecordLookup",
"textTemplates": [{
"description": "text template for when multiple records are records found",
"name": "multipleRecordsFoundTextTemplate",
"text": "Hello {!OrganizationName} Admin, \n\nThe alexed925TriggerTest process is configured to start when a RecommendationRequest platform event message occurs. A RecommendationRequest message occurred, but the process didn't start because multiple records in your org match the values specified in the process's Object node.\n\nHere are the values from the RecommendationRequest message.\nStatus: {!myVariable_myEvent.Status__c}\n\nTo fix this issue, adjust the matching filters in the process's Object node.\n\nThank you, \nSalesforce Process Automation"
}, {
"description": "text template for no records found",
"name": "noRecordsFoundTextTemplate",
"text": "Hello {!OrganizationName} Admin, \n\nThe alexed925TriggerTest process is configured to start when a RecommendationRequest platform event message occurs. A RecommendationRequest message occurred, but the process didn't start because no records in your org match the values specified in the process's Object node.\n\nHere are the values from the RecommendationRequest message.\nStatus: {!myVariable_myEvent.Status__c}\n\nTo fix this issue, adjust the matching filters in the process's Object node.\n\nThank you, \nSalesforce Process Automation"
}],
"variables": [{
"name": "myVariable_event_context",
"dataType": "SObject",
"isCollection": "false",
"isInput": "true",
"isOutput": "true",
"objectType": "Contact"
}, {
"name": "myVariable_event_context_collection",
"dataType": "SObject",
"isCollection": "true",
"isInput": "true",
"isOutput": "true",
"objectType": "Contact"
}, {
"name": "myVariable_event_current_record",
"dataType": "SObject",
"isCollection": "false",
"isInput": "true",
"isOutput": "true",
"objectType": "Contact"
}, {
"name": "myVariable_event_record_count",
"dataType": "Number",
"isCollection": "false",
"isInput": "true",
"isOutput": "true",
"scale": "2",
"value": {
"numberValue": "0.0"
}
}, {
"name": "myVariable_myEvent",
"dataType": "SObject",
"isCollection": "false",
"isInput": "true",
"isOutput": "false",
"objectType": "Recommendation_Request__e"
}]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment