Skip to main content

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.

Annotated screen capture of the main Service Process Studio features.

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

  1. From Setup, in the Quick Find box, enter Service Process Studio, and then select Service Process Studio.
  2. Click New Service Process.
  3. Click Create New.
  4. Enter the Process Name, and click Save & Launch.
    Screen capture of the New Service Process window and Create New tab with the Process Name and API Name fields populated.
  5. Click Details. The Process Name, API Name, and Short Description auto populate. In this example, Process Name is Cheque Book Order.
  6. 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.
  1. To add data attributes to the Cheque Book Details section, click New Data Attribute.
    Screen capture of New Data Attribute window with Attribute Name, API name, Attribute Type, and Data Type fields populated.
  2. To create attributes for Financial Account and Tracking Details, repeat step 8.Screen capture of the Check Book Details, Financial Account, and Tracking Details sections with data attributes.
  3. 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

  1. Click Setup and then Developer Console.
  2. Create an Apex class. In this example, the Apex class is ChequeBookOrderHelper. To learn about creating Apex classes, see Resources.
  3. 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.

  1. From the App Launcher, search for OmniScripts, and then select OmniScripts.
  2. Click New.
  3. 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.
  1. From the list of OmniScripts, select the Cheque Book Order OmniScript.
    Screen capture that shows the selection of the Cheque Book Order OmniScript from the list of OmniScripts.
  2. Rename the default step as Cheque Details in the Properties section.
  3. 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.Dragging the required elements for the Cheque Details step.
  4. To add Financial Account Info as Step 2, repeat the previous steps.
  5. Drag the Account element to the Financial Account Info step.Screen that shows the Cheque Details and Financial Account Info steps.
  6. 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.
    Screen that shows Remote action properties.
  7. 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.
  1. 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.
      Screen capture that shows the keys and values added for this example.
  1. 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.
  2. 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%.Screen that shows the Confirmation step and the text added to it.
  3. To view the OmniScript, click Preview.
  4. Click Activate.Activating 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 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.    

  1. From Setup, in the Quick Find box, enter Flows, and then select Flows.
  2. Click New Flow.
  3. Make sure Start from Scratch is selected, and click Next.
  4. Select Screen Flow and click Create.
  5. 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.
    Cheque Book Order Definition Flow.

Next, he creates a flow orchestrator and associates the flow he created as an interactive step.

  1. From Setup, in the Quick Find box, enter Flows, and then select Flows.
  2. Click New Flow.
  3. Make sure Start from Scratch is selected, and click Next.
  4. Select Record-Triggered Orchestration and click Create.
  5. 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.
    Cheque Book Order Definition Flow Orchestrator.

Associate the flow orchestrator to the Service Process definition

  1. Navigate to the Cheque Book Order service definition and select Fulfillment Flow.
  2. Click Add Fulfillment Flow.
  3. Select the Cheque Book Order Orchestration, and click Add.

Add a fulfillment flow.

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

  1. From Setup, in the Quick Find box, enter Action Launcher, and then select Action Launcher.Selecting Action Launcher from the Setup.
  2. Click New Deployment. 
  3. In the New Deployment dialog box, click Next.
  4. Enter the high-level information for your deployment and select OmniScripts in the GUIDANCE TO SHOW section.
  5. Click Next. In this example screen, Label is Cheque Book Order and API Name is ChequeBookOrder.Entering the information in the New Deployment window.
  6. Select Account from the list of Available Objects, and click Next.Selecting Account object in the New Deployment window.
  7. Select the Cheque Book Order OmniScript from the list, and click Next.Selecting the Cheque Book Order OmniScript.
  8. To add the Cheque Book Order OmniScript for display as an action button in the Action Launcher, click the plus icon.Adding the Cheque Book Order OmniScript as an action button.The Cheque Book Order OmniScript is added as an action button.Screen that shows Cheque Book Order OmniScript added as an action button.
  9. Click Save.

Assign Permission Sets

Matt starts by giving service agents access to run service processes built with Service Process Studio.

  1. From Setup, in the Quick Find box, enter Users, and then select Users.
  2. Click a user’s name.
  3. Under Permission Set Assignments, click Edit Assignments.
  4. Add the Industry Service Excellence permission set.
  5. 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.

  1. From Setup, in the Quick Find box, enter Profiles, and then select Profiles.
  2. Click the profile that you’re editing.
  3. Click Edit.
  4. 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
  1. 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

  1. Navigate to the Case record page, and click Edit.
  2. Drag and drop the Case Details component on the page.
  3. Click Save.

What’s Next?

After learning about Service Process Studio, the service agent is thrilled with the possibilities. 

Resources

Share your Trailhead feedback over on Salesforce Help.

We'd love to hear about your experience with Trailhead - you can now access the new feedback form anytime from the Salesforce Help site.

Learn More Continue to Share Feedback