Create and Activate a Service Process Definition
Learning Objectives
After completing this unit, you’ll be able to:
- Understand 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, Matt worries about customer experience. So, he decides to use Service Process Studio to create a service process that supports service agents with checkbook order requests.
Matt starts by exploring Service Process Studio. This screen shows an example service process definition.
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 agents 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 above definition and its associated process attributes.
Create Data Attributes
- From Setup, in the Quick Find box, enter
Service Process Studio
, and then select Service Process Studio.
- Click New Service Process.
- Click Create New.
- Enter the Process Name, and click Save & Launch.
- Click Details. The Process Name, API Name, and Short Description auto populate. In this example, Process Name is Cheque Book Order.
- Click Next. The Data Attributes page appears. Here, Matt defines 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 the edit icon, enter the section name, and then press Enter.
- To add the Financial Account and Tracking Details sections, repeat the previous bullet.
- To add data attributes to the Cheque Book Details section, click New Data Attribute.
- To create attributes for Financial Account and Tracking Details, repeat step 8.
- Repeat the previous steps to add No. of Booklets, Shipping method, and Shipping Address attributes.
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 Resources.
- 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 will be used to capture the request.
Create a Request Form (OmniScript)
Now let us create the Omniscript to build the experience for capturing the request intake and call the above apex from within the Omniscript to create the case.
- From the App Launcher, search for OmniScripts, and then select OmniScripts.
- Click New.
- In the New OmniScript dialog, enter the following details:
- In the Name field, enter
Cheque Book Order
.
- In the Language field, enter
English
.
- In the Type field, enter
CumulusBank
.
- In the SubType field, enter
ChequeBookOrder
.
- In the Description field, enter
This is the intake OmniScript for the Cheque Book Order Service Process Definition
.
- Click Save.
- 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 take these steps:
- In the Remote Class field, enter
ChequeBookOrderHelper
.
- In the Remote Method, enter
callCreatecaseApi
.
- Map the data collected through the Omniscript to the attributes defined in the service process definition. In the Remote Options section, click 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 and drop a step, and name it
Confirmation
. In this example, the Apex class called in the previous step returns the case number. The case number is shown in 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.
- Click Activate.
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 Orchestrator
Matt creates a simple record triggered flow orchestrator that’s called after a case is created to initiate and automate the request fulfillment. For information on using a flow orchestrator, see Resources.
First, he creates a flow to associate it as an interactive step in the flow orchestrator.
- From Setup, in the Quick Find box, enter
Flows
, and then select Flows.
- Click New Flow.
- Make sure Start from Scratch is selected, and click Next.
- Select Screen Flow and click Create.
- After creating your flow, save and activate the flow. In this example, the screen flow is created and activated. To learn about creating a flow, see Resources.
Next, he creates a flow orchestrator and associates the flow he created as an interactive step.
- From Setup, in the Quick Find box, enter
Flows
, and then select Flows.
- Click New Flow.
- Make sure Start from Scratch is selected, and click Next.
- Select Record-Triggered Orchestration and click Create.
- After creating your flow, save and activate the flow orchestrator. In this example, the flow is created and activated. To learn about creating a flow, see Resources.
Associate the flow orchestrator to the Service Process definition
- Navigate to the Cheque Book Order service definition and select Fulfillment Flow.
- Click Add Fulfillment Flow.
- Select the Cheque Book Order Orchestration, and click Add.
To learn more about creating flows and flow orchestration, see Resources.
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 agents to search for and launch the OmniScript using the Action Launcher component.
Matt creates the Checkbook Order deployment and adds it to the Action Launcher component.
Create the Checkbook Order Deployment
- From Setup, in the Quick Find box, enter
Action Launcher
, and then select Action Launcher.
- 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.The Cheque Book Order OmniScript is added as an action button.
- Click Save.
Assign Permission Sets
Matt starts by giving service agents 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 agents to run the checkbook order service processes.
- From Setup, in the Quick Find box, enter
Profiles
, and then select Profiles.
- Click the profile that you’re editing.
- Click 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 agents have required access to run the Checkbook Order service process.
Add Case Details component to the Case Record Page
- Navigate to the Case record page, and click Edit.
- Drag and drop the Case Details component on the page.
- Click Save.
What’s Next?
After learning about Service Process Studio, the service agent is thrilled with the possibilities.
Resources
-
Salesforce Help: Service Process Studio
-
Salesforce Help: Service Process Studio Basics
-
Salesforce Help: Flow Builder
-
Salesforce Help: Build a Flow
-
Salesforce Help: Flow Orchestration
-
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