Create and Activate a Service Process Definition
Learning Objectives
After completing this unit, you’ll be able to:
- Describe the basics of Service Process Studio.
- Assign permission sets to run Service Process Studio.
- Assign object permissions.
- Create a service process definition.
- Associate a request form to an Action Launcher Deployment.
Get Started with Service Process Definitions
Cumulus receives a multitude of requests from customers requesting checkbooks. It starts with verifying customer orders and collecting customer information. If all goes well, it’s time for fulfillment. The entire process is complicated and cumbersome. Moreover, it takes time.
Because of this, the bank worries about customer experience. Matt is on a team working to fix the problem, and decides to use Service Process Studio to create a service process that supports service reps with checkbook order requests.
Matt starts by exploring Service Process Studio. This screen shows an example service process definition.
Let’s explore the highlighted pieces.
Number |
Description |
---|---|
1 |
Name of the service process definition that’s being defined. |
2 |
A service process definition contains several sections. Expand each section and specify the details. |
3 |
After you specify the details for a service process definition and save it, view the definition summary for a quick overview. |
4 |
Activate the service process definition so that you can deploy it using Action Launcher. |
Create a Service Process Definition
Matt creates a service process definition in Service Process Studio so that service reps can launch the process and use it to fulfill the checkbook order requests for their customers. Next, Matt creates an Apex class that invokes the connect API by using the definition and its associated process attributes.
Create Data Attributes
First, he creates data attributes for the service process.
- From Setup, in the Quick Find box, enter
Service Process Studio
and select it.
- Click New Service Process.
- Click Create New.
- Enter a Process Name and API Name, and select Save & Launch.
- Click Details. The Process Name, API Name, and Short Description populate automatically. In this example, the Process Name is
Cheque Book Order
.
- Click Next. The Data Attributes page appears. Here, define the request attributes that are grouped into relevant sections. These sections display the data of the request in the dynamic case info widget when a case is created.
- An untitled section appears by default. To rename the Untitled Section as
Cheque Book Details
, click edit, enter the section name, and then click Enter.
- To add the Financial Account and Tracking Details sections, repeat the previous step.
- To add data attributes to the Cheque Book Details section, click New Data Attribute and complete the required fields.
- To create attributes for Financial Account, Tracking Details, No. of Booklets, Shipping method, and Shipping Address repeat the previous steps.
Create an Apex Class and Invoke the Connect API to Create Case/Service Request
- Click
and then Developer Console.
- Create an Apex class. In this example, the Apex class is
ChequeBookOrderHelper
. To learn about creating Apex classes, see the Resources section.
- Copy and paste the following code.
global with sharing class ChequeBookOrderHelper implements System.Callable { public Object call(String action, Map<String, Object> args) { Map<String, Object> inputMap = (Map<String, Object>)args.get('input'); Map<String, Object> outputMap = (Map<String, Object>)args.get('output'); Map<String, Object> options = (Map<String, Object>)args.get('options'); if(action == 'callCreateCaseApi') { // retrieve the attributes from the request payload String chequeBookType = (String) inputMap.get('ChequeBookType'); String shippingMethod = (String) inputMap.get('ShippingMethod'); String shippingAddress = (String)inputMap.get('ShippingAddress'); String checkingAccount = (String)inputMap.get('Account'); String svcCatalogItemDefApiName = (String)inputMap.get('SvcCatalogItemDefApiName'); String noOfBooklets = String.valueOf(inputMap.get('NoOfBooklets')); // Set the input rep ConnectApi.ServiceProcessRequestInputRepresentation input = new ConnectApi.ServiceProcessRequestInputRepresentation(); input.svcCatalogItemDefApiName = svcCatalogItemDefApiName; input.caseInfo = new Map<String, ConnectApi.GenericObject>(); input.attributes = new Map<String, ConnectApi.GenericObject>(); // set attributes ConnectApi.GenericObject chequeBookTypeObj = new ConnectApi.GenericObject(); chequeBookTypeObj.value = chequeBookType; input.attributes.put('Type_of_Cheque_Book', chequeBookTypeObj); ConnectApi.GenericObject noOfBookletsObj = new ConnectApi.GenericObject(); noOfBookletsObj.value = noOfBooklets; input.attributes.put('No_of_Booklets', noOfBookletsObj); ConnectApi.GenericObject shippingMethodObj = new ConnectApi.GenericObject(); shippingMethodObj.value = shippingMethod; input.attributes.put('Shipping_method', shippingMethodObj); ConnectApi.GenericObject shippingAddressObj = new ConnectApi.GenericObject(); shippingAddressObj.value = shippingAddress; input.attributes.put('Shipping_Address', shippingAddressObj); ConnectApi.GenericObject checkingAccountObj = new ConnectApi.GenericObject(); checkingAccountObj.value = checkingAccount; input.attributes.put('Checking_Account', checkingAccountObj); // Invoke API Map<String, String> responseMap = new Map<String, String>(); ConnectApi.ServiceProcessRepresentation output = ConnectApi.IServiceProcessConnectFamily.createCaseServiceProcess(input); responseMap.put('caseId', output.caseId); responseMap.put('caseNumber', output.caseNumber); responseMap.put('svcCatalogRequestId', output.svcCatalogRequestId); outputMap.put('apiResponse', responseMap); return outputMap; } return null; } }
The Apex class is invoked from the Omniscript that’s used to create the case. You can now invoke this Apex class from the Omniscript that'll be used to capture the request.
Create a Request Form With Omniscript
Matt now can create the Omniscript to build the experience for request intake. He can call the previous Apex from within the Omniscript to create the case.
- From the App Launcher (
), find and select Omniscripts.
- Click New.
- In the New Omniscript dialog, enter these details:
- Name:
Cheque Book Order
- Language:
English
- Type:
CumulusBank
- SubType:
ChequeBookOrder
- Description:
This is the intake Omniscript for the Cheque Book Order Service Process Definition
.
- Name:
- Save your work.
Now configure your new Omniscript.
- From the list of Omniscripts, select the Cheque Book Order Omniscript.
- Rename the default step as
Cheque Details
in the Properties section.
- Drag and drop the required elements to the Cheque Details step. In this example, add Type of Cheque Book, No of Booklets, Shipping Method, and Shipping Address.
- To add Financial Account Info as Step 2, repeat the previous steps.
- Drag the Account element to the Financial Account Info step.
- Drag the Remote Action element, and enter the basic details in the Properties section. In this example, Name is CallCreateCaseAPI, Field Label is Call Create Case API, Invoke Mode is Default. The Remote Action element invokes the Apex class that calls the Connect API to create the service process request for the Checkbook Order definition.
- For the Remote Action step, expand REMOTE PROPERTIES and specify these values.
- Remote Class:
ChequeBookOrderHelper
- Remote Method:
callCreatecaseApi
- Map the data collected through the Omniscript to the attributes defined in the service process definition. In the Remote Options section, select Add New Key/Value Pair to enter these items as keys and values:
- The elements added in Cheque Details and Financial Account Info.
-
SvcCatalogItemDefApiName
, which is the API name of the service process definition you created. The connect API uses this API name to create the request of the definition.
This example uses the following key-value pairs:Key
Value
ChequeBookType
%ChequeBookType%
NoOfBooklets
%NoOfBooklets%
ShippingMethod
%ShippingMethod%
ShippingAddress
%ShippingAddress%
Account
%Account%
SvcCatalogItemDefApiName
Cheque_Book_Order
- Select Send Only Extra Payload.
- Drag a step onto the canvas, and name it
Confirmation
. In this example, the Apex class called in the previous step returns the case number. The case number is shown on the Confirmation page.
- Add a text block to the Confirmation step with the following text:
Your request is taken. Please save the reference number for future communication %apiResponse.caseNumber%
.
- To view the Omniscript, click Preview.
- Activate the Omniscript.
The request intake form for the Cheque Book Order service process is activated. The next step is to define the automation required for fulfilling this request.
Create a Flow Orchestration
Matt creates a simple record-triggered flow orchestration that’s called after a case is created to initiate and automate the request fulfillment. For information on using flow orchestration, see the Resources section.
First, he creates a flow to associate it as an interactive step in the flow orchestration.
- From the App Launcher (
), find and select
Automation
.
- In the Flows list, click New.
- In the Frequently Used section, select Screen Flow.
- Configure your flow. We won’t go into detail here, but to learn more about creating a flow, check out the Build Flows with Flow Builder trail.
- Save and activate your flow.
Next, he creates a flow orchestration and associates the flow he created as an interactive step.
- From the App Launcher(
), find and select
Automation
.
- In the Flows list, click New.
- In the Search automations box, find and select for Record-Triggered Orchestration.
- Create the orchestration flow.
- Save and activate the flow.
Now associate the Flow Orchestration to the Service Process Definition.
- Navigate to the Cheque Book Order service definition and select Fulfillment Flow.
- Select Add Fulfillment Flow.
- Select the Cheque Book Order Orchestration, and select Add.
To learn more about creating flows and flow orchestration, see the Resources section.
Associate a Request Form to an Action Launcher Deployment
Now it’s time for Matt to link the request form associated with the activated service process definition to the Action Launcher component. Linking the request form enables reps to search for and launch the Omniscript using the Action Launcher component.
- From Setup, in the Quick Find box, enter
Action Launcher
and select it..
- Click New Deployment.
- In the New Deployment dialog box, click Next.
- Enter the high-level information for your deployment and select Omniscripts in the GUIDANCE TO SHOW section.
- Click Next. In this example screen, Label is Cheque Book Order and API Name is ChequeBookOrder.
- Select Account from the list of Available Objects, and click Next.
- Select the Cheque Book Order Omniscript from the list, and click Next.
- To add the Cheque Book Order Omniscript for display as an action button in the Action Launcher, click the plus icon.
- Save your work..
Assign Permission Sets
Matt starts by giving service reps access to run service processes built with Service Process Studio.
- From Setup, in the Quick Find box, enter
Users
, and then select Users.
- Click a user’s name.
- Under Permission Set Assignments, click Edit Assignments.
- Add the Industry Service Excellence permission set.
- Save your changes.
Assign Object Permissions
Matt assigns permissions for the Service Catalog Request and Service Catalog Request Extd Attr Val objects to enable service reps to run the checkbook order service processes.
- From Setup, in the Quick Find box, enter
Profiles
and select it.
- Select the profile that you’re editing.
- Select Edit.
- Under Standard Object Permissions, locate these objects and assign permissions:
- Service Catalog Request — Read, Create, Edit, and Delete
- Service Catalog Request Extd Attr Val — Read, Create, Edit, and Delete
- Save your changes.
With these permissions enabled, service reps have required access to run the Checkbook Order service process.
Add the Case Details Component to the Case Record Page
The last step is to add a component to the case page to view details.
- Navigate to the Case record page, and click Edit.
- Drag and drop the Case Details component on the page.
- Click Save.
The new process is ready for service reps. In the next unit, you will follow to see how Matt’s hard work pays off and delights customers and service reps, both.
Resources
- Salesforce Help: Service Process Studio
- Salesforce Help: Service Process Studio Basics
- Salesforce Help: Automate Tasks with Flows
- Salesforce Help: Build a Flow
- Salesforce Help: Automate Complex Processes with Orchestrations
- Salesforce Help: Build an Orchestration
- Salesforce Help: Create and Activate Service Process Definition
- Salesforce Help: Create an Action Launcher Deployment
- Salesforce Help: Add the Action Launcher Component to a Page