Skip to content

Instantly share code, notes, and snippets.

@alexed1
Created September 30, 2017 00:33
Show Gist options
  • Save alexed1/857a6affe371d1f7afbb5da89ad99cfb to your computer and use it in GitHub Desktop.
Save alexed1/857a6affe371d1f7afbb5da89ad99cfb to your computer and use it in GitHub Desktop.
Order Checks Demo
{
"fullName": "Order_New_Checks-42",
"actionCalls": [{
"name": "Post_Order_to_Chatter",
"label": "Post Order to Chatter",
"locationX": "846",
"locationY": "400",
"actionName": "chatterPost",
"actionType": "chatterPost",
"connector": {
"targetReference": "Disney_Checks"
},
"inputParameters": [{
"name": "subjectNameOrId",
"value": {
"elementReference": "sObject_ContactRecord.AccountId"
}
}, {
"name": "text",
"value": {
"elementReference": "CreateChatterPost"
}
}],
"outputParameters": {
"assignToReference": "Chatter_FeedItemID",
"name": "feedItemId"
}
}, {
"name": "Send_Order_to_Vendor",
"label": "Send Order to Vendor",
"locationX": "1082",
"locationY": "675",
"actionName": "OrderChecks_OrderChecks__Service",
"actionType": "apex",
"connector": {
"targetReference": "Update_Status"
},
"inputParameters": [{
"name": "OrderChecks_input_orderId",
"value": {
"elementReference": "CheckOrderID"
}
}, {
"name": "OrderChecks_input_customerNumber",
"value": {
"elementReference": "sObject_ContactRecord.Id"
}
}, {
"name": "OrderChecks_input_checkStyle",
"value": {
"elementReference": "selectedCheckType"
}
}, {
"name": "OrderChecks_input_quantity",
"value": {
"elementReference": "Number_of_books"
}
}, {
"name": "OrderChecks_input_shippingSpeed",
"value": {
"elementReference": "Shipping_Options"
}
}],
"outputParameters": {
"assignToReference": "VendorResponseStatus",
"name": "status"
}
}],
"assignments": {
"name": "Update_Contact_Details",
"label": "Update Contact Details",
"locationX": "409",
"locationY": "272",
"assignmentItems": [{
"assignToReference": "sObject_ContactRecord.FirstName",
"operator": "Assign",
"value": {
"elementReference": "newFirstName"
}
}, {
"assignToReference": "sObject_ContactRecord.LastName",
"operator": "Assign",
"value": {
"elementReference": "newLastName"
}
}, {
"assignToReference": "sObject_ContactRecord.MailingStreet",
"operator": "Assign",
"value": {
"elementReference": "newStreetAddress"
}
}, {
"assignToReference": "sObject_ContactRecord.MailingCity",
"operator": "Assign",
"value": {
"elementReference": "newCity"
}
}, {
"assignToReference": "sObject_ContactRecord.MailingState",
"operator": "Assign",
"value": {
"elementReference": "newState"
}
}, {
"assignToReference": "sObject_ContactRecord.MailingPostalCode",
"operator": "Assign",
"value": {
"elementReference": "newZipCode"
}
}, {
"assignToReference": "sObject_ContactRecord.Id",
"operator": "Assign",
"value": {
"elementReference": "recordId"
}
}],
"connector": {
"targetReference": "Commit_Contact_Info_Change"
}
},
"choices": [{
"name": "Disney",
"choiceText": "Disney (featured)",
"dataType": "String",
"value": {
"stringValue": "Disney"
}
}, {
"name": "Ground_Shipping",
"choiceText": "Ground Shipping (free)",
"dataType": "String",
"value": {
"stringValue": "Ground"
}
}, {
"name": "No_Thank_you",
"choiceText": "No, Thank you.",
"dataType": "String",
"value": {
"stringValue": "No"
}
}, {
"name": "One_Book",
"choiceText": "1 Book",
"dataType": "String",
"value": {
"stringValue": "1"
}
}, {
"name": "Overnight",
"choiceText": "Overnight ($29.99)",
"dataType": "String",
"value": {
"stringValue": "Overnight"
}
}, {
"name": "Salesforce_Ohana",
"choiceText": "Salesforce Ohana",
"dataType": "String",
"value": {
"stringValue": "Salesforce Ohana"
}
}, {
"name": "San_Francisco_Scenic",
"choiceText": "San Francisco Scenic",
"dataType": "String",
"value": {
"stringValue": "San Francisco Scenic"
}
}, {
"name": "X10_Books",
"choiceText": "10 Books ($159.95)",
"dataType": "String",
"value": {
"stringValue": "10"
}
}, {
"name": "X1_Book",
"choiceText": "1 Book ($19.99)",
"dataType": "String",
"value": {
"stringValue": "1"
}
}, {
"name": "X2_Business_Day_Shipping",
"choiceText": "2-Business Day Shipping ($9.99)",
"dataType": "String",
"value": {
"stringValue": "2-day"
}
}, {
"name": "X5_Books",
"choiceText": "5 Books ($79.95)",
"dataType": "String",
"value": {
"stringValue": "5"
}
}, {
"name": "Yes",
"choiceText": "Yes, Please!",
"dataType": "String",
"value": {
"stringValue": "Yes"
}
}, {
"name": "Yosemite",
"choiceText": "Yosemite",
"dataType": "String",
"value": {
"stringValue": "Yosemite"
}
}],
"constants": {
"description": "Disney Check Constant",
"name": "DisneyCheck2",
"dataType": "String",
"value": {
"stringValue": "<img src='http://projectbpm-developer-edition.creid-wsm1.t.force.com:6109/resource/DisneyCheck' />"
}
},
"decisions": [{
"name": "Commit_Contact_Info_Change",
"label": "Commit Contact Info Change?",
"locationX": "407",
"locationY": "402",
"defaultConnector": {
"targetReference": "Create_Check_Order"
},
"defaultConnectorLabel": "[Default Outcome]",
"rules": {
"name": "Commit_Change",
"conditionLogic": "and",
"conditions": {
"leftValueReference": "newAddress",
"operator": "EqualTo",
"rightValue": {
"booleanValue": "true"
}
},
"connector": {
"targetReference": "Update_Mailing_Address"
},
"label": "Commit Change"
}
}, {
"name": "Disney_Checks",
"label": "Disney Checks?",
"locationX": "844",
"locationY": "515",
"defaultConnector": {
"targetReference": "Confirm_Order"
},
"defaultConnectorLabel": "[Default Outcome]",
"rules": {
"name": "Disney_Selected",
"conditionLogic": "and",
"conditions": {
"leftValueReference": "selectedCheckType",
"operator": "EqualTo",
"rightValue": {
"stringValue": "Disney"
}
},
"connector": {
"targetReference": "SpecialOffer"
},
"label": "Disney Selected"
}
}, {
"name": "Wants_Disney_Credit_Card",
"label": "Wants Disney Credit Card?",
"locationX": "1274",
"locationY": "534",
"defaultConnector": {
"targetReference": "Thank_you"
},
"defaultConnectorLabel": "[Default Outcome]",
"rules": {
"name": "Yes_Outcome",
"conditionLogic": "and",
"conditions": {
"leftValueReference": "offerAnswer",
"operator": "EqualTo",
"rightValue": {
"stringValue": "Yes"
}
},
"connector": {
"targetReference": "Disney_CC_Offer_V2"
},
"label": "Yes"
}
}],
"formulas": [{
"name": "CreateChatterPost",
"dataType": "String",
"expression": "\"New checks ordered for .\""
}, {
"name": "CreateCheckOrderName",
"dataType": "String",
"expression": "{!newLastName} & \"_\" & {!selectedCheckType} & \"_\" & {!Number_of_books} & \"_\" & TEXT(TODAY())"
}, {
"name": "CreateName",
"dataType": "String",
"expression": "{!newFirstName} & \" \" & {!newLastName}"
}],
"interviewLabel": "Order New Checks {!$Flow.CurrentDateTime}",
"label": "Order New Checks_alexed",
"processType": "Flow",
"recordCreates": {
"name": "Create_Check_Order",
"label": "Create Check Order",
"locationX": "674",
"locationY": "400",
"assignRecordIdToReference": "CheckOrderID",
"connector": {
"targetReference": "Post_Order_to_Chatter"
},
"inputAssignments": [{
"field": "Account__c",
"value": {
"elementReference": "sObject_ContactRecord.AccountId"
}
}, {
"field": "Check_City__c",
"value": {
"elementReference": "newCity"
}
}, {
"field": "Check_Name__c",
"value": {
"elementReference": "CreateName"
}
}, {
"field": "Check_State__c",
"value": {
"elementReference": "newState"
}
}, {
"field": "Check_Street_Address__c",
"value": {
"elementReference": "newStreetAddress"
}
}, {
"field": "Check_Style__c",
"value": {
"elementReference": "selectedCheckType"
}
}, {
"field": "Check_Zip__c",
"value": {
"elementReference": "newZipCode"
}
}, {
"field": "Checkbook_Count__c",
"value": {
"elementReference": "Number_of_books"
}
}, {
"field": "Contact__c",
"value": {
"elementReference": "sObject_ContactRecord.Id"
}
}, {
"field": "Name",
"value": {
"elementReference": "CreateCheckOrderName"
}
}, {
"field": "Shipping_Method__c",
"value": {
"elementReference": "Shipping_Options"
}
}, {
"field": "Vendor_Order_Status__c",
"value": {
"stringValue": "Order Created"
}
}],
"object": "Check_Order__c"
},
"recordLookups": {
"name": "Get_Contact_Record",
"label": "Get Contact Record",
"locationX": "89",
"locationY": "46",
"assignNullValuesIfNoRecordsFound": "true",
"connector": {
"targetReference": "Select_Check_Theme_v2"
},
"filters": {
"field": "Id",
"operator": "EqualTo",
"value": {
"elementReference": "recordId"
}
},
"object": "Contact",
"outputReference": "sObject_ContactRecord",
"queriedFields": ["FirstName", "LastName", "MailingStreet", "MailingCity", "MailingState", "MailingPostalCode", "AccountId", "Id"]
},
"recordUpdates": [{
"name": "Update_Mailing_Address",
"label": "Update Mailing Address",
"locationX": "408",
"locationY": "527",
"connector": {
"targetReference": "Create_Check_Order"
},
"inputReference": "sObject_ContactRecord"
}, {
"name": "Update_Status",
"label": "Update Status",
"locationX": "1270",
"locationY": "678",
"connector": {
"targetReference": "Wants_Disney_Credit_Card"
},
"filters": {
"field": "Id",
"operator": "EqualTo",
"value": {
"elementReference": "CheckOrderID"
}
},
"inputAssignments": [{
"field": "Fulfillment_Vendor__c",
"value": {
"stringValue": "Midwest Financial Printing"
}
}, {
"field": "Vendor_Order_Status__c",
"value": {
"elementReference": "VendorResponseStatus"
}
}],
"object": "Check_Order__c"
}],
"screens": [{
"name": "Confirm_Order",
"label": "Confirm Order",
"locationX": "1083",
"locationY": "515",
"allowBack": "true",
"allowFinish": "true",
"allowPause": "true",
"connector": {
"targetReference": "Send_Order_to_Vendor"
},
"fields": {
"name": "txt_Confirm",
"fieldText": "Your order is almost complete. Please click next below to confirm your order.",
"fieldType": "DisplayText",
"isVisible": "true"
}
}, {
"name": "Confrim_Contact_Information_V2",
"label": "Confrim Contact Information V2",
"locationX": "238",
"locationY": "168",
"allowBack": "true",
"allowFinish": "true",
"allowPause": "true",
"connector": {
"targetReference": "Get_Quantity_and_Shipping"
},
"fields": {
"name": "ContactInfoLC",
"fieldType": "ComponentInstance",
"isRequired": "true",
"isVisible": "true"
}
}, {
"name": "Get_Quantity_and_Shipping",
"label": "Get Quantity and Shipping",
"locationX": "408",
"locationY": "169",
"allowBack": "true",
"allowFinish": "true",
"allowPause": "false",
"connector": {
"targetReference": "Update_Contact_Details"
},
"fields": [{
"name": "textTitleQuantity",
"fieldText": "How many books of checks would you like to order?",
"fieldType": "DisplayText",
"isVisible": "true"
}, {
"name": "Number_of_books",
"choiceReferences": ["X1_Book", "X5_Books", "X10_Books"],
"dataType": "String",
"fieldText": "Number of books",
"fieldType": "RadioButtons",
"isRequired": "false",
"isVisible": "true"
}, {
"name": "textSpacer1QuantShipping",
"fieldText": "&nbsp;",
"fieldType": "DisplayText",
"isVisible": "true"
}, {
"name": "textTitleShipping",
"fieldText": "How fast would you like to receive your checks?",
"fieldType": "DisplayText",
"isVisible": "true"
}, {
"name": "Shipping_Options",
"choiceReferences": ["Ground_Shipping", "X2_Business_Day_Shipping", "Overnight"],
"dataType": "String",
"fieldText": "Shipping Options",
"fieldType": "RadioButtons",
"isRequired": "false",
"isVisible": "true"
}]
}, {
"name": "Select_Check_Theme_v2",
"label": "Select Check Theme v2",
"locationX": "88",
"locationY": "170",
"allowBack": "true",
"allowFinish": "true",
"allowPause": "true",
"connector": {
"targetReference": "Confrim_Contact_Information_V2"
},
"fields": [{
"name": "textTitleV2",
"fieldText": "What style of checks would you like?",
"fieldType": "DisplayText",
"isVisible": "true"
}, {
"name": "LC",
"fieldType": "ComponentInstance",
"isRequired": "true",
"isVisible": "true"
}]
}, {
"name": "SpecialOffer",
"label": "A Special Offer!",
"locationX": "845",
"locationY": "675",
"allowBack": "true",
"allowFinish": "true",
"allowPause": "false",
"connector": {
"targetReference": "Send_Order_to_Vendor"
},
"fields": [{
"name": "textTitleConfirmed",
"fieldText": "Make Disney a part of your every day spending by adding a Disney Credit Card to your Disney checks. \n\nWe would like to offer you a 0% interest (for 12 months)Disney Signature VISA card for being a valued customer of Ally Bank.",
"fieldType": "DisplayText",
"isVisible": "true"
}, {
"name": "DisneyOfferLC",
"fieldType": "ComponentInstance",
"isRequired": "true",
"isVisible": "true"
}]
}, {
"name": "Thank_you",
"label": "Thank you",
"locationX": "1366",
"locationY": "413",
"allowBack": "true",
"allowFinish": "true",
"allowPause": "true",
"fields": [{
"name": "Text_2",
"fieldText": "Your check order is complete. We will send an email when they ship that will let you know when to expect their arriva.",
"fieldType": "DisplayText",
"isVisible": "true"
}, {
"name": "dsplytxt_CCOffer",
"fieldText": "And we are glad you took advantage of the special offer for a matching Disney Credit Card!",
"fieldType": "DisplayText",
"isVisible": "false"
}],
"rules": {
"conditionLogic": "and",
"conditions": [{
"leftValueReference": "offerAnswer",
"operator": "EqualTo",
"rightValue": {
"stringValue": "Yes"
}
}, {
"leftValueReference": "DisneyOfferAccepted",
"operator": "EqualTo",
"rightValue": {
"stringValue": "true"
}
}],
"label": "ThankCCOffer",
"ruleActions": {
"attribute": "isVisible",
"fieldReference": "dsplytxt_CCOffer",
"value": {
"booleanValue": "true"
}
}
}
}],
"startElementReference": "Get_Contact_Record",
"subflows": {
"name": "Disney_CC_Offer_V2",
"label": "Disney CC Offer V2",
"locationX": "1443",
"locationY": "540",
"connector": {
"targetReference": "Thank_you"
},
"flowName": "NewDisneyCCFlow",
"inputAssignments": {
"name": "recordId",
"value": {
"elementReference": "sObject_ContactRecord.Id"
}
},
"outputAssignments": {
"assignToReference": "DisneyOfferAccepted",
"name": "outputOfferAccepted"
}
},
"variables": [{
"name": "Chatter_FeedItemID",
"dataType": "String",
"isCollection": "false",
"isInput": "false",
"isOutput": "false"
}, {
"name": "CheckOrderID",
"dataType": "String",
"isCollection": "false",
"isInput": "false",
"isOutput": "true"
}, {
"name": "DisneyOfferAccepted",
"dataType": "String",
"isCollection": "false",
"isInput": "false",
"isOutput": "false"
}, {
"name": "newAddress",
"dataType": "Boolean",
"isCollection": "false",
"isInput": "false",
"isOutput": "false"
}, {
"name": "newCity",
"dataType": "String",
"isCollection": "false",
"isInput": "false",
"isOutput": "false"
}, {
"name": "newFirstName",
"dataType": "String",
"isCollection": "false",
"isInput": "false",
"isOutput": "false"
}, {
"name": "newLastName",
"dataType": "String",
"isCollection": "false",
"isInput": "false",
"isOutput": "false"
}, {
"name": "newState",
"dataType": "String",
"isCollection": "false",
"isInput": "false",
"isOutput": "false"
}, {
"name": "newStreetAddress",
"dataType": "String",
"isCollection": "false",
"isInput": "false",
"isOutput": "false"
}, {
"name": "newZipCode",
"dataType": "String",
"isCollection": "false",
"isInput": "false",
"isOutput": "false"
}, {
"name": "offerAnswer",
"dataType": "String",
"isCollection": "false",
"isInput": "false",
"isOutput": "false"
}, {
"name": "recordId",
"dataType": "String",
"isCollection": "false",
"isInput": "true",
"isOutput": "false",
"value": {
"stringValue": "003B0000008xFobIAE"
}
}, {
"name": "saveNewAddress",
"dataType": "String",
"isCollection": "false",
"isInput": "false",
"isOutput": "false"
}, {
"name": "selectedCheckType",
"dataType": "String",
"isCollection": "false",
"isInput": "false",
"isOutput": "false"
}, {
"name": "sObject_ContactRecord",
"dataType": "SObject",
"isCollection": "false",
"isInput": "false",
"isOutput": "false",
"objectType": "Contact"
}, {
"name": "VendorResponseStatus",
"dataType": "String",
"isCollection": "false",
"isInput": "false",
"isOutput": "false"
}]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment