Loading
Feature degradation | Gmail Email delivery failureRead More
Visual Studio Code Based Modeler for Consumer Goods Cloud
Table of Contents
Select Filters

          No results
          No results
          Here are some search tips

          Check the spelling of your keywords.
          Use more general search terms.
          Select fewer filters to broaden your search.

          Search all of Salesforce Help
          Process Contract

          Process Contract

          A Process Contract defines the sequence of actions carried out during the execution of business processes such as orders, promotions, and visits. These actions can be user actions or system actions on the Offline mobile app or can be other actions carried out in the background. Each business process has a unique process contract in XML format. A Process Contract instantiates objects, processes, and events and controls the UI.

          Examples: The Visit_RetailStoreCockpit (Visit_RetailStoreCockpitProcess.processflow.xml) process contract defines the flow of actions during the visit execution process. The Order_CopyProcess process contract defines the flow of actions for the copy order functionality.

          Use a process contract when you want to:

          • Load data through business objects and list objects
          • Call business logic functions
          • Call other processes from other UI pages
          • Trigger validations
          • Store data in process variables

          A Process Contract can have multiple subprocesses that link several business processes. Example: A retail visit flow process contract has subprocess contracts that shows visit details, visit tasks such as start and end visits, or updating visit status. The relationship between these process contracts is hierarchical. A parent process contract usually represents a complete business process such as creating an order, creating a promotion, and a retail store overview.

          Structure of a Process Contract

          <Process name="MyApplication::OverviewProcess" defaultAction="ShowOverview" schemaVersion="1.0">
              <Entry>
                  <!-- Entry element definition -->
                  <ProcessContext />
                  <EntryActions />
              </Entry>
              <Body>
                  <!-- Body element definition -->
                  <Actions />
              </Body>
              <ExitHandlers>
                  <!-- ExitHandlers Element definition -->
              </ExitHandlers>
          </Process>
          

          Sample Process Contract

          Here’s a sample process contract that shows visit details in the Retail Store Cockpit.

          <Process name="Visit::DetailsProcess" defaultAction="showVisitDetails" schemaVersion="0.0.0.5">
              <Entry>
                  <ProcessContext>
                      <Declarations>
                          <Declaration name="RetailStoreDetail" type="BoRetailStore" />
                          <Declaration name="Account" type="BoAccount" />
                      </Declarations>
                      <Parameters>
                          <Input name="BoVisit" type="BoVisit" />
                      </Parameters>
                  </ProcessContext>
                  <EntryActions>
                      <Action actionType="LOAD" name="LoadRetailStore" type="BoRetailStore">
                          <Parameters>
                              <Input name="pKey" value="ProcessContext::BoVisit.StoreId" />
                          </Parameters>
                          <Return name="ProcessContext::RetailStoreDetail" />
                      </Action>
                      <Action actionType="LOAD" name="LoadAccount" type="BoAccount">
                          <Parameters>
                              <Input name="pKey" value="ProcessContext::BoVisit.AccountId" />
                          </Parameters>
                          <Return name="ProcessContext::Account" />
                      </Action>
                  </EntryActions>
              </Entry>
              <Body>
                  <Actions>
                      <Action actionType="View" name="showVisitDetails">
                          <UIDescription>Visit::DetailsUI</UIDescription>
                      </Action>
                      <Action actionType="View" name="ShowDetail">
                          <UIDescription>Visit::DetailsUI</UIDescription>
                          <Events>
                              <Event name="editVisit" action="showRetailOverview" />
                          </Events>
                      </Action>
                      <Action actionType="View" name="showRetailOverview">
                          <UIDescription>Visit::RetailStoreCockpitUI</UIDescription>
                      </Action>
                  </Actions>
              </Body>
              <ExitHandlers>
                  <ExitHandler handlerName="beforeExit1" type="Validate" name="ProcessContext::BoVisit">
                      <OnValidationError transitionTo="showVisitDetails" />
                  </ExitHandler>
              </ExitHandlers>
          </Process>
          
           
          Loading
          Salesforce Help | Article