Enabling Users to Observe a Business Scenario

2015-09-11
Enabling Users to Observe a Business
Scenario
Content
1
Overview. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
2
Getting Started. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
2.1
Updating SAP HANA Studio with SAP Operational Process Intelligence Add-Ons. . . . . . . . . . . . . . . . . . 6
2.2
Configuring SAP HANA Studio with the Destination Systems. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
2.3
Configuring the SAP LT Replication Server. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
3
Modeling a Business Scenario. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
3.1
Creating a Business Scenario Project. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .12
3.2
Creating a Business Scenario. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
3.3
Migrating a Business Scenario from an SAP HANA Repository. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
3.4
Sharing a Business Scenario Project. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
3.5
Adding Participants from SAP Systems. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
3.6
Adding Participants from Third-Party Systems. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
Adding Observed Processes. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
Adding Operational Data Stores. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
3.7
Defining the Start and End of a Business Scenario. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
3.8
Defining the Business Scenario Properties. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
3.9
Defining the Business Scenario Goal. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
3.10
Correlating Participants to a Business Scenario. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
3.11
Configuring the Details of the Participant Context. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .28
3.12
Enriching a Participant Context with Additional Data. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .29
3.13
Enhancing the Business Scenario Context. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
Aggregating Process Context in Business Scenario Context. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
3.14
Adding Attributes to a Business Scenario. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .32
3.15
Creating Phases. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
Configuring Milestones. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
3.16
Measures. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
Creating a Count Measure. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
Creating a Duration Measure. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
Creating Context-Based or SAP HANA-Based Measures. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
3.17
Indicators. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
Creating Indicators. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
3.18
Actions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
Defining Actions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
3.19
Checklists. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .46
Creating a Checklist. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
2
© 2015 SAP SE or an SAP affiliate company. All rights reserved.
Enabling Users to Observe a Business Scenario
Content
3.20
Business Situations. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
Developing a Detection Procedure. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
Defining Business Situations. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
3.21
Data Model for Business Scenario Data. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
Enabling Users to Enter Data for a Business Scenario. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
Changing Data Model Tables. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
4
Generating a Business Scenario. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
4.1
Business Scenario Artifacts. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
4.2
Phase Artifacts. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
4.3
My Requests Artifacts. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
4.4
Measures and Indicators Artifacts. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
4.5
Predefined Measures and Indicators Artifacts. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
4.6
Translation Artifacts. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
5
Authorizations and Roles. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
5.1
Assigning Roles to SAP Operational Process Intelligence Users. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
6
Releasing the Scenario Lock. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
7
Translating Scenario Custom Texts. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .67
8
Transporting Business Scenario Project. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
9
HANA Workflow. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .70
9.1
Integration in Business Scenarios. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
9.2
Using the BPMN Standard. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
Events. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
Gateways. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .73
Tasks. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74
Sequence Flow. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
Data Context and Data Flow. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .75
Mapping. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76
9.3
HANA Workflow APIs. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
XSJS-Based APIs. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
SQL-Based APIs. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .80
9.4
Creating HANA Workflows. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
Creating a Project. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .83
Creating a HANA Workflow File. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84
Modeling a HANA Workflow. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
Accelerated Modeling with Speed Buttons. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86
Modeling the Sequence Flow. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
Modeling Service Tasks. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .88
Modeling User Tasks. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .89
Enabling Users to Observe a Business Scenario
Content
© 2015 SAP SE or an SAP affiliate company. All rights reserved.
3
Modeling Gateways. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
Modeling the Data Flow. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92
Activating the HANA Workflow. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .95
Generating the HANA Workflow Artifacts. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96
Configuring the Generated XS Job. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97
9.5
Building Custom Task UIs. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98
9.6
Task Management REST APIs. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .99
Retrieve Task Details. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
Complete a Task. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101
Complete a Task with Decision. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102
9.7
Lifecycle of a HANA Workflow. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103
Patching a HANA Workflow. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105
9.8
4
Configuring the Developer Mode for HANA Workflows. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .106
© 2015 SAP SE or an SAP affiliate company. All rights reserved.
Enabling Users to Observe a Business Scenario
Content
1
Overview
SAP Operational Process Intelligence powered by SAP HANA is a platform that enables you to create smart
process applications comprising business scenarios, workflows, rules, and tasks. These smart process
applications enable business users to ensure the smooth running of the business processes and take necessary
action to resolve any bottlenecks.
SAP Operational Process Intelligence consists of the following:
● Environment to model business scenarios, workflows, and rules
● Workspace called space.me where business users can ensure the smooth running of the business processes
You can define measures that provide a number or quantity to record a directly observable value of the scenario
performance. For each measure, you can define an indicator (target and threshold values) showing whether
performance is on track. Based on the observed values, business users can take appropriate action to improve
performance.
Activities
1. Configure SAP HANA studio with SAP Operational Process Intelligence plugins.
For more information, see the SAP Operational Process Intelligence Installation and Upgrade Guide at http://
help.sap.com/hana-opint.
2. To browse process definitions from provider systems, configure your SAP HANA system with the provider
systems, or with the gateway systems that connect to the provider systems.
For more information, see Configuring SAP HANA Studio with the Destination System [page 7].
3. Specify the tables that you want to replicate from the provider systems.
For more information, see the Configuring the SAP LT Replication Server topic in the SAP Operational
Process Intelligence Installation and Upgrade Guide at http://help.sap.com/hana-opint.
4. To model your business scenario, create a business scenario and then use the Search Console view to choose
the process definitions you want to correlate.
For more information, see Modeling a Business Scenario [page 12].
5. Save, validate, and generate your scenario and all relevant artifacts.
For more information, see the Generating a Business Scenario topic in the SAP Operational Process
Intelligence Installation and Upgrade Guide at http://help.sap.com/hana-opint.
6. (Optional) Translate the custom texts to languages other than English.
For more information, see Translating Scenario Custom Texts [page 67].
7. Assign appropriate roles to the business users so that they can track, monitor, and analyze the business
scenario.
For more information, see Assigning Roles to SAP OPInt Users [page 64].
8. Transport the business scenario to the required systems.
For more information, see Transporting Business Scenario Project [page 69].
Result
In space.me - the SAP Operational Process Intelligence workspace - the business users can choose between
different views and different methods for viewing the business scenario-related information.
For more information, see Working with space.me.
Enabling Users to Observe a Business Scenario
Overview
© 2015 SAP SE or an SAP affiliate company. All rights reserved.
5
2
Getting Started
2.1
Updating SAP HANA Studio with SAP Operational
Process Intelligence Add-Ons
You update your SAP HANA studio with SAP Operational Process Intelligence add-ons, that is the design time, so
that the system can provide the required functions for modeling business scenarios and HANA workflows, and for
importing existing business scenarios from other systems.
Context
There are two ways to update your SAP HANA studio: via an update site archive (OPIDESIGNTIME09.ZIP)
provided by your administrator, which contains the SAP Operational Process Intelligence 1.0 SP09 SAP HANA
studio plugins, or by directly referencing the SAP Operational Process Intelligence 1.0 SP09 SAP HANA studio
plugins from the SAP HANA system.
Procedure
1. Choose
Help
Install New Software .
2. Choose Add.
3. In the Add Repository window, perform the following substeps:
a. In the Name field, enter a name, for example, SAP Operational Process Intelligence_<Version>.
b. In the Location field, do one of the following:
○ Enter the update site URL: http://<host>:80<instance_number>/sap/opi/updatesite.
○ Choose Archive and point to the update site archive file (OPIDESIGNTIME09.ZIP) provided by your
administrator.
c. Choose OK.
d. Enter the credentials.
e. Choose OK.
4. Select the Group items by category checkbox.
5. Select the high-level node from the list.
6. Choose Next.
Note
Make sure that the Contact all update sites during install to find required software checkbox is not selected.
6
© 2015 SAP SE or an SAP affiliate company. All rights reserved.
Enabling Users to Observe a Business Scenario
Getting Started
7. Accept the license terms and choose Finish.
8. For the update to take effect, choose Restart Now.
2.2
Configuring SAP HANA Studio with the Destination
Systems
You configure SAP HANA studio with various systems (called destination systems) that contain the process and
message flow definitions required to model your business scenarios.
Prerequisites
● For connection to the SAP BPM system, ensure that the SAP_BPM_EXPORT_MODEL action is assigned to the
BPM user in the SAP Business Process Management (BPM) system.
● The ERP system needs to have the software component SAP_BS_FND with the minimum support package
level for the release, as listed below:
○ 731: support package level 5
○ 730: support package level 4
○ 702: support package level 10
○ 701: support package level 12
.
Context
You can connect to the following SAP systems:
● SAP Business Process Management (SAP BPM)
● SAP Business Suite (Process Observer and Business Workflow)
● SAP Process Integration (SAP PI)
● SAP gateway (which has connections to SAP BPM, SAP PI, or SAP Business Suite systems)
Procedure
1. Launch SAP HANA studio.
2. Choose
Window
Preferences .
3. Choose Search Destination.
4. In the Search Destinations dialog box, choose the required option:
Enabling Users to Observe a Business Scenario
Getting Started
© 2015 SAP SE or an SAP affiliate company. All rights reserved.
7
○ Gateway Systems – To access processes from various systems.
○ SAP BPM – To access processes from a BPM system.
○ SAP Business Suite – To access processes from Process Observer or Business Workflow systems.
○ SAP Process Integration - To access message flow definitions from Process Integration (PI) systems.
Note
You can also add destinations by choosing Manage Destinations in the Search Console view. To open the
Search Console view, choose
Window
Show View
Other
Search Console , and then choose OK.
5. Choose Add.
6. In the dialog box that appears, enter the details of the system you want to connect to.
Note
No client is available for connection to the Java system on SAP Business Process Management. Therefore,
no client information is needed.
7. Choose OK.
8. To test the connection to an SAP Business Suite or SAP BPM destination system, select the system and
choose Test.
2.3
Configuring the SAP LT Replication Server
The SAP LT Replication Server enables you to replicate process data from a provider system to the SAP HANA
system. The configuration itself consists of defining the following in the SAP LT Replication Server system:
● One or more source systems:
○ ERP system (containing data for Process Observer or Business Workflow)
○ SAP Business Process Management system
○ SAP Process Integration system
○ Third-party systems
● Target SAP HANA system where the data is replicated
For more information about configuring the SAP LT Replication Server, see SAP Note 1709225
.
Once this configuration is complete, you can replicate all required tables in the SAP HANA system.
The table below lists the tables you need to replicate for various systems in order to generate scenarios with
process definitions from the respective provider systems.
8
© 2015 SAP SE or an SAP affiliate company. All rights reserved.
Enabling Users to Observe a Business Scenario
Getting Started
Table 1:
Provider System
Tables
Process Observer
POC_D_PRC_BIND
POC_D_PRC_IN
POC_D_PRC_STP_IN
POC_C_PROC_STEP
POC_C_PS_EXT
POC_C_PS_BND
POC_D_BA_LOG
ADRP
USR21
Business Workflow
SWF_PF_REL_EVT
SWWLOGHIST
SWWWIHEAD
SWW_WI2OBJ
ADRP
USR21
SAP Business Process Management
BC_BPEM_EL_ENTRY
BC_BPEM_EL_EVT_MAP
BC_BPEM_EL_RDS
BC_BPEM_UM_MAP
Enabling Users to Observe a Business Scenario
Getting Started
© 2015 SAP SE or an SAP affiliate company. All rights reserved.
9
Provider System
Tables
SAP Process Integration
NIMM Model tables
●
BC_IV_E2E_MSG_FLOW
●
BC_IV_MESSAGE_FLOW
●
BC_IV_MSG_FLW_STEP
●
BC_IV_SERVICE
●
BC_IV_DISC_CONFIG
JAVA DC tables
●
BC_IV_DC_EVNT
●
BC_IV_DC_EVNT_ACK
ABAP DC tables
Third-party system
●
/SDF/IVISEVTMAIN
●
/SDF/IVISEVTPATR
●
/SDF/IVISEVTFLOW
●
/SDF/IVISEVTPRED
●
/SDF/IVISEVTSUCC
●
/SDF/IVISEVTREL
●
/SDF/IVISEVTALT
Appropriate event log table
To ensure successful generation when using SAP Business Process Management on MsSQL, you have to create
three additional SAP LT Replication Server transformations. You do this because the timestamp format of the
Microsoft SQL DB Server needs to be changed to work properly with SAP Operational Process Intelligence.
These three transformations need to be created for the following tables or columns:
● BC_BPEM_EL_ENTRY and EVENT_TIMESTAMP
*&---------------------------------------------------------------------*
*& Include
ZIUUC_POC_TIMESTAMP_TRANS
*&---------------------------------------------------------------------*
data result type string.
result = i_event_timestamp_1.
replace all occurrences of '-' in result with ''.
replace all occurrences of ':' in result with ''.
replace all occurrences of '.' in result with ''.
condense result no-gaps.
concatenate result '000' into result.
e_event_timestamp = result.
● BC_BPEM_EL_RDS and DATA_VAL_DATETIME
*&---------------------------------------------------------------------*
*& Include
ZIUUC_POC_TIMESTAMP_TRANS
*&---------------------------------------------------------------------*
data result type string.
IF NOT i_data_val_datetim_1 IS INITIAL.
result = i_data_val_datetim_1.
replace all occurrences of '-' in result with ''.
replace all occurrences of ':' in result with ''.
replace all occurrences of '.' in result with ''.
condense result no-gaps.
concatenate result '000' into result.
e_data_val_datetime = result.
ELSE.
10
© 2015 SAP SE or an SAP affiliate company. All rights reserved.
Enabling Users to Observe a Business Scenario
Getting Started
e_data_val_datetime = i_data_val_datetim_1.
ENDIF.
● BC_BPEM_EL_RDS and DATA_VAL_TIME
*&---------------------------------------------------------------------*
*& Include
ZIUUC_POC_TIMESTAMP_TRANS
*&---------------------------------------------------------------------*
data result type string.
IF NOT i_data_val_time_1 IS INITIAL.
result = i_data_val_time_1.
result = result+11(8).
replace all occurrences of ':' in result with ''.
e_data_val_time = result.
ELSE.
e_data_val_time = i_data_val_time_1.
ENDIF.
Enabling Users to Observe a Business Scenario
Getting Started
© 2015 SAP SE or an SAP affiliate company. All rights reserved.
11
3
Modeling a Business Scenario
A business scenario represents an end-to-end business process that organizations require to achieve their highlevel goal or task. The processes that you need to include as part of the business scenario can reside in different
systems.
Context
SAP Operational Process Intelligence allows you to model the business scenario by retrieving and using
participants from the following systems:
Table 2:
System
Participant Type
SAP Business Process Management (SAP BPM)
Processes
SAP Process Integration (SAP PI)
Message flows
SAP Business Suite (Process Observer and Business Work­
flow)
Processes
Gateway systems (which in turn have connections to SAP
BPM, SAP PI, PO, and BWF systems)
●
Processes
●
Message flows
Third-party systems
●
Observed processes
●
Operational data stores
You can define goals for each of the business scenarios to give business users more insight into the purpose of the
scenarios. You can divide the end-to-end process steps of a business scenario into logical stages called phases,
and each phase can contain various milestones. Therefore, at any point in time, a business user can get a clear
picture of the business-scenario goal, the current phase, and the milestones achieved within that phase.
3.1
Creating a Business Scenario Project
You use this procedure to create a project, which allows you to group all the artifacts related to your business
scenarios. If required, you can share this project with other users, and allow them to view or work with the project
files.
Procedure
1. Launch SAP HANA studio.
12
© 2015 SAP SE or an SAP affiliate company. All rights reserved.
Enabling Users to Observe a Business Scenario
Modeling a Business Scenario
2. From the File menu, choose
3. Select
New
Project .
SAP Operational Process Intelligence
Business Scenario Project .
4. Choose Next.
5. In the Project name field, enter a name for your project.
6. If you want to allow other users to view or work on your project files, perform the following substeps:
a. Select the Share Project checkbox.
b. Choose Next.
c. Select the repository workspace and package where the system must store the project.
Restriction
You cannot create a business scenario project under another business scenario project or any other
project.
Note
We recommend that you use the default workspace.
If you do not have an existing repository workspace, you need to create one. For more information, see
the SAP HANA Developer Guide, at section Create a Repository Workspace.
7. Choose Finish.
3.2
Creating a Business Scenario
You use this procedure to create a business scenario, which allows users to track performance of end-to-end
processes.
Procedure
1. Launch SAP HANA studio.
2. Choose the SAP HANA Development perspective.
3. From the Project Explorer view, select the required project.
Note
You can create your business scenario directly under the project or under a folder within the project.
4. From the context menu of the project or the required folder, choose
5. In the wizard that appears, choose
New
SAP Operational Process Intelligence
Other .
Business Scenario .
6. Choose Next.
7. Enter a name and description for your business scenario.
Enabling Users to Observe a Business Scenario
Modeling a Business Scenario
© 2015 SAP SE or an SAP affiliate company. All rights reserved.
13
Note
The description that you enter here appears as the business-scenario label in space.me.
8. Choose Finish.
Note
You must activate the .xsapp file that appears under the project folder. To activate this file, right-click
the .xsapp and choose
Team
Activate .
These are the supported artifacts and their file extensions:
○ Business scenario: .hprbusinessscenario
○ SAP HANA workflow: .hprworkflow
○ SAP HANA rules framework: .hprrule, .hprvocabulary
Note
The file extension .hprbusinessscenario used to be .pvscenario. It has been replaced in order to align with
HANA workflow and HANA rules framework artifacts. Nevertheless, all previously created business
scenarios will continue to work as they are.
3.3
Migrating a Business Scenario from an SAP HANA
Repository
You use this procedure to reuse a business scenario from a repository workspace instead of creating a new one.
Procedure
1. Launch SAP HANA studio.
2. Open the SAP HANA Development perspective.
3. From the Repositories view, select the package that contains the scenario.
4. From the context menu of the package, choose Check Out.
5. Navigate to the file location of your workspace and open the checked-out package.
6. If the checked-out package does not contain a .project file, create the file in SAP HANA studio with the
following content:
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>BUSINESS_SCENARIO_NAME</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
</buildSpec>
14
© 2015 SAP SE or an SAP affiliate company. All rights reserved.
Enabling Users to Observe a Business Scenario
Modeling a Business Scenario
<natures>
<nature>com.sap.ndb.studio.view.ui.modelerNature</nature>
<nature>com.sap.pv.opm.bsp.business.scenario.project</nature>
<nature>com.sap.ndb.studio.dwb.tools.core.hanaNature</nature>
<nature>com.sap.ndb.studio.xse.editor.xsjsNature</nature>
</natures>
</projectDescription>
Note
If the checked-out package has more than one .project file, delete the .project file(s) of the subsequent
child packages.
7. In the Repositories view, right-click the .project file and choose Activate.
8. In the Repositories view, select the package that you checked out.
9. From the context menu of the package, choose Check Out and Import Projects.
10. Choose Next.
11. Choose Finish.
3.4
Sharing a Business Scenario Project
Sharing a project establishes a link between project-specific files in your development workspace and the SAP
HANA repository. Sharing a project ensures that changes you make to project-related files in your development
workspace are synchronized with the SAP HANA repository and, as a result, are visible to other team members.
Shared projects are available for import by other members of the application development team.
Procedure
1. Launch SAP HANA studio.
2. In the Project Explorer workspace, select the required project.
3. From the context menu of the project, choose
Team
Share Project .
4. In the Repository Workspaces field, select the workspace with which you want to share your Business
Scenario project.
Note
We recommend that you use the default workspace.
If you cannot find a workspace, choose Add Workspace, enter the system details, and add the system.
5. In the Repository Package field, select the package where you want to store your business scenario.
Note
If you do not select a repository package, the system creates a new package under the root Content folder
and stores the business scenario in this folder.
Enabling Users to Observe a Business Scenario
Modeling a Business Scenario
© 2015 SAP SE or an SAP affiliate company. All rights reserved.
15
6. Choose Finish.
7. To move the models of your project into the SAP HANA system, choose
context menu of the project.
8. To allow other users to consume your models, choose
project.
Team
Activate
Team
Commit
from the
from the context menu of the
Related Information
Share an SAP HANA XS Project
3.5
Adding Participants from SAP Systems
You can add participants from SAP systems to a business scenario for analysis purposes.
Context
You can use participants from the following SAP systems:
● SAP Business Process Management (SAP BPM)
● SAP Business Suite (Process Observer and Business Workflow)
● SAP Process Integration (SAP PI)
● SAP gateway (with connections to SAP BPM, SAP PI, or SAP Business Suite systems)
Procedure
1. Launch SAP HANA studio.
2. Open the required business scenario.
3. To open the Search Console view, choose
choose OK.
Window
Show View
Other
Search Console , and then
4. In the Search for field, select one of the following options:
○ Business Process - to search for process definitions from SAP BPM, POB, or BWF systems
○ Message Flows - to search for message flows from SAP PI systems
5. In the Search in field, select the required system.
6. In the Find field, enter the name or ID of the required process definition or message flow. If you do not know
these details, enter an asterisk (*) to retrieve all processes or message flows from the selected system.
16
© 2015 SAP SE or an SAP affiliate company. All rights reserved.
Enabling Users to Observe a Business Scenario
Modeling a Business Scenario
Note
For an SAP Business Suite system, you must provide the exact process ID for the ID-based search.
7. If you selected Business Process in step 2, choose the icon next to the Find field, and select the required
process type.
8. For more search options, choose Advanced options and, depending on whether you are searching for process
definitions or message flows, you can do the following:
○ Process definitions
In the Find by field, select the option Name or ID on which the system must base the search for the text
entered in the Find field.
○ Message flows
You can narrow down the search by entering the sender name and interface and receiver name and
interface.
9. Choose Search.
10. From the Results list in the Search Console view, drag the required participants to the business scenario
canvas and, in the case of message flow participants, select the sender and receiver participants.
The system displays the participants on the business scenario canvas. If a process consists of any referenced
subprocesses, these are shown as grayed-out steps.
Note
○ By default, referenced subprocesses are not part of your business scenario. The system displays them
on the business scenario canvas (as grayed-out steps) for documentation purposes only. If you need
to include them in the business scenario, you must search for and add them manually.
○ The system displays the process definitions that you added vertically or horizontally, based on the
settings in the Preferences section. If you want to change this alignment, choose
Window
Preferences BPMN2 , and select the required option in the Horizontal layout of Pools, Lanes and
diagram elements field.
11. Choose the participant related process tables.
a. Select the required process or message flow participant in the business scenario editor.
b. Perform one of the following substeps as appropriate:
1. For a message flow participant, choose the Process Integration Systems tab page and choose the edit
icon in the table entry.
2. For a process participant, choose the Properties tab page, and choose Browse next to the Source
field.
c. In the Choose Schema window, browse to and select the required schema.
d. (Optional) If there are any errors with the tables or if a table name is not the same as the default one,
rectify the error by browsing the correct table that has all the required columns.
Note
The source of a process participant in a business scenario can be based on a design time table. This
allows you to package the process tables of the business scenario within the delivery unit of the
business scenario project.
e. Choose OK.
Enabling Users to Observe a Business Scenario
Modeling a Business Scenario
© 2015 SAP SE or an SAP affiliate company. All rights reserved.
17
12. To arrange the participants, right-click the business scenario canvas (in empty space only), and choose
Format Diagram.
3.6
Adding Participants from Third-Party Systems
SAP Operational Process Intelligence enables you to use operational data from third-party backend systems from
observed processes and Operational Data Stores (ODS).
3.6.1
Adding Observed Processes
SAP Operational Process Intelligence enables you to use operational data from third-party back-end systems
(non-SAP systems) to model your business scenario. It is not necessary that these back-end systems have
process definitions or even a “process” as a building block of the data flow. You have to extract, replicate, and
manually transform this operational data into a Process Event Log format, so that SAP Operational Process
Intelligence can consume the operational data in your business scenario.
Context
You can use any replication tool to replicate the back-end system data, for example, SAP LT Replication Server.
You need to create a new schema and table in the schema in the SAP HANA catalog. The table needs to be in the
Process Events format. Next, you configure your replicator to replicate data in the Process Event Log format.
The Process Event Log format contains the following fields:
Table 3:
Field Name
DB Type
Description
EVENT_ID
NVARCHAR(75)
NOT NULL, UNIQUE
Used to uniquely identify an
event in the Process Event
Log table. EVENT_ID needs to
be unique across all events
that are replicated from a
back-end system into this ta­
ble. Should two systems repli­
cate data into a single table,
the same constraint is still
valid and these systems or
the replication process should
ensure that the requirement
is met.
18
© 2015 SAP SE or an SAP affiliate company. All rights reserved.
Constraints
Enabling Users to Observe a Business Scenario
Modeling a Business Scenario
Field Name
DB Type
Description
Constraints
PROCESS_DEFINITION_ID
NVARCHAR(64)
Defines the modeled process
for which the given event is of
value.
NOT NULL
PROCESS_VERSION_ID
NVARCHAR(32)
Defines the modeled process
for which the given event is of
value.
NOT NULL
PROCESS_INSTANCE_ID
NVARCHAR(64)
Used at runtime to determine
the process instance to which
the specific event refers.
NOT NULL
ACTIVITY_DEFINITION_ID
NVARCHAR(64)
Determines the flow node of
the event.
NOT NULL
ACTIVITY_INSTANCE_ID
NVARCHAR(32)
Used at runtime to determine NOT NULL
the unique execution of a spe­
cific flow node (activity). An
execution instance ID needs
to be unique within the source
system.
TIMESTAMP
TIMESTAMP
Determines the moment of
occurrence of the event.
USER_ID
NVARCHAR(255)
A key that identifies the user
responsible for triggering the
event.
USER_DISPLAY_NAME
NVARCHAR(1000)
The name of the user, to be
used for viewing purposes.
EVENT_NAME
NVARCHAR(100)
NOT NULL
A specific flow node can trig­
ger different types of events
(for example, Started,
Completed, Updated) and this
field is used to convey that in­
formation.
NOT NULL
Since this operational data is not encapsulated in a process definition, you need to create a new business scenario
with a process definition to encapsulate third-party data. The model of the process definition contains Start and
End flow nodes, tasks, and gateways. For each flow node, you define a matching ACTIVITY_ID. Each flow node is
associated with certain events. The ID and the events should match specific fields in the Process Event Log table
with replicated data.
To add context information to your process definition, you can also use a data object to encapsulate process
context data. You can add only one data object to the process definition. The data object is associated with a
process context table (or view) of your choice, from where the process context is directly consumed.
Note
The context table needs to be located in the same schema as the event table that is used for the generation of
the scenario.
The context table needs to be in the Process Event Log format, where the first four fields are mandatory:
Enabling Users to Observe a Business Scenario
Modeling a Business Scenario
© 2015 SAP SE or an SAP affiliate company. All rights reserved.
19
Table 4:
Field Name
DB Type
Description
Constraints
PROCESS_DEFINITION_ID
NVARCHAR(64)
NOT NULL
PROCESS_VERSION_ID
NVARCHAR(32)
Defines which process defini­
tion the context table data is
associated with.
PROCESS_INSTANCE_ID
NVARCHAR(64)
Defines which process in­
stance the context record is
associated with.
NOT NULL
FIELD1
<TYPE1>
Custom context fields.
FIELD2
<TYPE2>
...
...
FIELDn
<TYPEn>
NOT NULL
As a result, events from this process definition and its flow nodes can be observed, consumed, and correlated to a
business scenario.
You create the process definition in BPMN 2.0 format. For more information, see BPMN 2.0 specifications.
Procedure
1. Launch SAP HANA studio.
2. Open the required business scenario.
3. From the palette, drag and drop an empty pool onto the canvas.
4. In the Properties view, enter the following:
○ ID - should match the PROCESS_DEFINITION_ID column in the Process Event Log table
○ Name - a valid name for the pool (process)
○ Version - should match the PROCESS_VERSION_ID column in the Process Event Log table
○ System ID - maps the system to the replicated schema
○ Source - Process Event Log table
5. Drag and drop Start and Event events in your pool. Add any additional required flow nodes to your pool, for
example, Gateway or Task.
6. In the Properties view of each flow node (except for gateways), define the following:
○ Name – a valid name for the flow node
○ ID – a unique identifier of the flow that needs to match the ACTIVITY_DEFINITION_ID in the Process Event
Log table with replicated data
○ Events – add as many events as required that are to be associated with this flow node
These events need to match specific events from the Process Event Log table with replicated data.
Note
Start and End flow nodes must have at least one event associated with them.
7. To add context data, drag and drop a Data Object in your pool. The Properties view of the data object displays
the following:
20
© 2015 SAP SE or an SAP affiliate company. All rights reserved.
Enabling Users to Observe a Business Scenario
Modeling a Business Scenario
○ Name – the name of the data object that is displayed in the scenario editor
○ Source – the table or view from which process context data is obtained. To choose another table, choose
Browse.
Note
The Data Structure table is a read-only table listing the context data that you can access when
consuming the context data in the context data foundation calculation view.
3.6.2
Adding Operational Data Stores
In cases where business operations maintain their state details in transactional tables and do not generate events,
you use Operational Data Stores (ODS) to enable users to track the business operations.
Context
You define events, which are conditions, for the various states of the business operation. When a condition is true,
the system generates the corresponding event to capture the state details. These ODS events are similar to the
events of other participants such as SAP BPM and SAP PI systems, and you can use them to define a milestone
within a phase, start step, or end step of the business scenario.
Example
Consider an order-fulfillment business scenario, which consists of a series of operations from order creation to
order delivery. The system creates a record in the operational data store when a user creates an order. As the
business operation progresses and changes its state, the system updates the record accordingly. The table
below lists the different states of a particular order (Order_ID 13151) at various points in time:
State
Time
Status
Activity
1
14 October 2014, 09:00 UTC New
User places an order
2
14 October 2014, 13:00 UTC
In Process
Sales clerk processes the
order
3
15 October 2014, 10:00 UTC
Pick and Pack
Warehouse employee picks
and packs the product for
shipment
4
16 October 2014, 12:00 UTC
Shipped
Shipping clerk ships the
product
5
17 October 2014, 15:00 UTC
Delivered
Product is delivered to the
customer
To enable users to track the progress of the order, you add an operational data store to your business scenario
and define the following events:
Enabling Users to Observe a Business Scenario
Modeling a Business Scenario
© 2015 SAP SE or an SAP affiliate company. All rights reserved.
21
Event Name
Event Condition
Order_Created_Event
Order_ID != null
Order_Process_Event
Status = 'In Process'
Pick_and_Pack_Event
Status = 'Pick and Pack'
Order_Shipped_Event
Status = 'Shipped'
Order_Delivered_Event
Status = 'Delivered'
You can specify Order_Created_Event as the start step and Order_Delivered_Event as the end step of the
business scenario.
Note
To capture the state changes, insert and update triggers are created in the tables used as Operational Data
Stores (ODS) with user authorizations. These triggers are owned by the user. Therefore, deletion of the user
results in deletion of the triggers, and the system cannot capture the state changes. In such cases, you must
create the triggers again by regenerating the business scenario.
Procedure
1. Launch SAP HANA studio.
2. Open the required business scenario.
3. From the Palette frame, drag the data store to the business scenario canvas.
4. Select the data store on the business scenario canvas.
5. In the Properties view, choose the General tab page.
6. In the Source field, browse to and select the required table.
7. Choose Add.
8. In the Add New Event window, enter the following details:
a. In the Name field, enter a name for the event.
b. In the Condition field, enter the condition based on which you want to analyze the data.
Note
○ Condition must be a Boolean expression
○ Condition can have the following operators: =, !=, and, or, ( and )
○ Right-hand side of the condition must be a constant
○ Left-hand side of the condition must be a field from the data source
c. To check whether the condition you have added is syntactically correct, choose Validate.
Note
The time stamp and date/time values appear only if they are available in the source system. Otherwise,
the system displays the value None.
22
© 2015 SAP SE or an SAP affiliate company. All rights reserved.
Enabling Users to Observe a Business Scenario
Modeling a Business Scenario
d. In the Time section, select the required time stamp or date/time attribute.
e. In the Processor field, select the required processor.
f. Choose Finish.
3.7
Defining the Start and End of a Business Scenario
Once you have modeled your business scenario by adding the necessary participants, you need to specify the
start and end events for the business scenario.
Context
Note
By default, all start and end events of the included processes appear as the start and end of the business
scenario, respectively. You need to check and update this, as required.
Procedure
1. Launch SAP HANA studio.
2. Open the required business scenario.
3. To mark an event as the start of the business scenario, perform the following substeps:
a. Select the required event of the business scenario.
b. From the context menu of the event, choose Select/Deselect As Business Scenario Start.
c. In the Select/Deselect window, select the required events that can trigger the start.
d. Choose OK.
4. To mark an event as the end of the business scenario, perform the following substeps:
a. Select the required event of the business scenario.
b. From the context menu of the event, choose Select/Deselect As Business Scenario End.
c. In the Select/Deselect window, select the required events that can trigger the end.
d. Choose OK.
Note
You can also configure the start and end of a business scenario by using the properties on the Configure
tab page of the business scenario.
Enabling Users to Observe a Business Scenario
Modeling a Business Scenario
© 2015 SAP SE or an SAP affiliate company. All rights reserved.
23
3.8
Defining the Business Scenario Properties
Procedure
1. Launch SAP HANA studio.
2. Open the required business scenario.
3. Click in an empty space on the business scenario canvas.
4. In the Properties view, go to the General tab.
5. In the Time Zone field, select the required time zone of the source of data.
If you select a timezone for your business scenario, you can expect all the events coming from participants in
the business scenario to be in that timezone format. By default, the timezone of a business scenario is UTC.
6. In the Operational day field, enter the start time of the business user's operational day.
The operational day represents a 24-hour period of your business operations. The operational day maps to a
calendar day from 00:00 to 24:00. However, in some cases an operational day spans two calendar days. For
example, if the operational day of a business user starts at 17:00 UTC, the system collects and reports the
details of measures and indicators from 17:00 UTC on a particular day to 17:00 UTC the following day. Hence,
the operational day is used to determine the day to report your operations and transactions.
Example
Table 5:
Operational Day
05:00 to 05:00 (next day)
Today
22-04-2014, 04:30
Date in SAP Operational Process Intelligence
21-04-2014, 23:30 (uses the operational day to determine
the reporting date)
Table 6:
Business Operation
Time (when this business operation
occurred)
SAP Operational Process Intelli­
gence Reporting Day (which uses
the Operational Day)
Order Created
21-04-2014, 03:00
20-04-2014
Order Confirmed
21-04-2104, 20:00
21-04-2014
Order Picked and Packed
22-04-2014, 04:00
21-04-2014
Order Delivered
22-04-2014, 04:30
21-04-2014
7. Go to the Target tab, and proceed with one of the following:
24
© 2015 SAP SE or an SAP affiliate company. All rights reserved.
Enabling Users to Observe a Business Scenario
Modeling a Business Scenario
Option
Description
Constant
To define a constant value as the expected time by when the scenario execution must be completed, select
Constant and enter the days, hours, and minutes.
Timestamp To define the scenario execution time (target) based on the context data of the timestamp data type, select
Timestamp and select the required attribute.
Date/Time
To define the scenario execution time (target) based on the context data of the date/time data type, select
Date/Time and select the required attribute.
Breakdown To define the scenario execution time based on categories, perform the following substeps:
1. Select Breakdown.
2. Choose Browse and select the required category.
3. Choose OK.
4. Choose Add and enter the days, hours, and minutes.
5. Choose OK.
6. In the Default Target field, enter a default value for other category types.
8. In the Threshold field, enter the execution percentage which, when reached, triggers the system to send an
alert to the business user.
9. Go to the Authorization tab.
10. Choose Add.
11. In the Role Name field, enter a name for the role you want to create.
12. To add an attribute to the role, in the Source section, choose Add and select the required attribute.
13. To assign a value to the attribute added to the role, in the Value section, choose Add and enter the required
value.
14. Choose OK.
15. Save the changes.
3.9
Defining the Business Scenario Goal
You define a goal for a business scenario to give users more insight into the purpose of the business scenario and
enable them to make better decisions. You identify obstacles for achieving the goal and classify them based on
the current event, scenario cycle time, and desired phase. These user-defined classifications are known as
substatuses.
Procedure
1. Launch SAP HANA studio.
2. Open the required business scenario.
3. In the right pane of the business scenario editor, select the Goal node.
By default, the goal description is Complete instance by <cycle time>, for example, Complete order by
31/01/2014 5:00 AM.
4. On the General tab page, in the Goal field, maintain the goal description.
Enabling Users to Observe a Business Scenario
Modeling a Business Scenario
© 2015 SAP SE or an SAP affiliate company. All rights reserved.
25
5. In the Status field, choose the status, for example, Critical or At Risk.
6. Choose Add.
7. In the Add Sub-Status dialog box, enter the reason in the Label field.
8. Choose Browse to select the event.
9. Choose OK.
3.10 Correlating Participants to a Business Scenario
You need to correlate the participants that you have added to the business scenario so that they are part of and
mapped to the same scenario instance. You correlate scenario participants by using a unique attribute in their
business context data.
Prerequisites
You have added two or more participants to your business scenario.
Context
Once you have added the required participants in the business scenario editor, you can create a number of
correlation conditions that define how participants are correlated to the scenario instance and by which context
attribute. A correlation condition is defined with at least two scenario participants and with specific context
attributes from the participant or attributes that are a result of enriching the business context of a participant.
Furthermore, you configure the event that defines when the correlation procedure evaluates the context attribute
value.
You can add and remove as many correlation conditions as your business scenario requires.
Scenario participants that contain events marked as scenario-starting events are referred to as scenario-starting
participants.
There are a few guidelines you need to follow when creating and defining correlation conditions:
● Each scenario participant is part of the definition of at least one correlation condition.
● A participant with a specific attribute can be part of the definition of only one correlation condition.
● A scenario participant can be part of the definition of a specific correlation condition only once. That is, you
cannot use the same participant in the same condition definition twice, even if you use a different participant
attribute, for example.
● Once a definition of a correlation condition contains a specific combination of participants, for example P1,
P2, and P3, this combination cannot be part of another condition definition.
● There can be only one possible correlation condition from each scenario-starting participant to any other
scenario participant.
26
© 2015 SAP SE or an SAP affiliate company. All rights reserved.
Enabling Users to Observe a Business Scenario
Modeling a Business Scenario
A scenario participant is correlated if the correlation procedure tries to map scenario instances for the participant
using a correlation condition. Below is a summary of the logic behind the processing of correlation conditions:
1. The conditions defined with scenario-starting participants are processed before the other conditions.
2. Next, the correlation conditions that are defined with participants that are already processed (that is,
participants of already processed correlation conditions) are processed.
3. Finally, all other correlation conditions are processed.
Procedure
1. Launch SAP HANA studio.
2. Open the required business scenario.
3. In the business scenario editor, click anywhere on the scenario canvas.
4. Right-click and select Properties.
5. In the Correlation Scheduling Interval field, specify the time interval, that is, the frequency at which the system
needs to retrieve the process events from the replicated tables.
Recommendation
The value for the correlation scheduling interval of the respective Business Senario in SAP HANA studio
should match the interval of the scheduled correlation XS job. By default, the interval of the correlation XS
job is scheduled every five minutes. If you choose a smaller value for the correlation scheduling interval of
the business scenario, its configuration has no impact. For more information about changing the interval of
the correlation XS job, see the Modelling a Business Scenario Changing the Schedule of the Job
section in the SAP Operational Process Intelligence Installation and Upgrade Guide.
6. In the Correlate Events Since field, specify the date from which the system should retrieve the events from the
replicated tables.
7. To add a correlation condition, choose Add Condition.
Note
The Add Condition button is active only when there are two or more participants in the business scenario
editor.
8. To add participants to a condition, choose Add Participant.
You can add as many participants as there are in the scenario. If you add all participants to a single condition,
you cannot add any more correlation conditions.
9. In the Attribute column, click the … icon and select an attribute from the list.
10. In the Correlate column, click the … icon to select a specific step and step event with which this participant’s
defined attribute is correlated to the whole scenario. This is an optional configuration step and is used only if
the attributes used in the correlation condition are not available from the source system until the specific
configured event is observed by the runtime.
Enabling Users to Observe a Business Scenario
Modeling a Business Scenario
© 2015 SAP SE or an SAP affiliate company. All rights reserved.
27
Results
When the business scenario is generated, a correlation procedure is generated that processes the correlation
conditions.
Related Information
Enriching a Participant Context with Additional Data [page 29]
3.11
Configuring the Details of the Participant Context
You use this procedure to define the details of the participant context. In your business scenario, you can define
the details of the process context structure after adding and determining the process definition as a scenario
participant.
Prerequisites
You know the data hierarchy of your process context in the source system.
Context
You perform this function for the hierarchical data structure from your source system. For example, you can
enable a process to have one header with multiple sub-items. This is necessary to ensure that there is no
overwriting of context data in a particular process instance.
Procedure
1. Launch SAP HANA studio.
2. Open the required business scenario.
3. In the business scenario editor, select the data object pictogram of the participant whose details you want to
define.
4. In the Properties view, choose the General tab page.
5. In the Data Structure table, select the Key column of the attributes to define the primary keys of process
context table.
28
© 2015 SAP SE or an SAP affiliate company. All rights reserved.
Enabling Users to Observe a Business Scenario
Modeling a Business Scenario
Note
The primary keys that you define should match the data hierarchy of your process context in the source
system.
Note
This feature is supported for third-party and ODS platforms.
For more information, see Aggregating Process Context in Business Scenario Context [page 31]
3.12 Enriching a Participant Context with Additional Data
Correlation relies on context data that is unique for a participant but is common to all participants, for example,
material ID. However, if a common attribute does not exist for a participant, you need to enrich its process
definition context with additional data to facilitate correlation.
Prerequisites
You have created a business scenario and added one or more participants to it.
Context
Once you have discovered and added process definitions as scenario participants in your business scenario, you
need to correlate the scenario participants.
Note
You need to perform this step if you have more than one participant and the correlation condition is not part of
the participant context.
Procedure
Enrich Participant’s Context
1. Launch SAP HANA studio.
2. Open the required business scenario.
3. In the business scenario editor, select the data object pictogram of the participant whose context you want to
enrich.
Enabling Users to Observe a Business Scenario
Modeling a Business Scenario
© 2015 SAP SE or an SAP affiliate company. All rights reserved.
29
4. In the Properties view, open the General tab page and then expand the Context Enrichment section.
5. Choose Enrich Context.
A dedicated calculation view is created in your scenario package. The naming pattern for this calculation view
is: SPVR_ENRICH_<ScenarioName>_<ParticipantFamilyId>_CTX. Once the calculation view is created,
the calculation view editor automatically opens the view. Initially, the calculation view contains just the
context attributes of the participant. You can edit the calculation view to insert additional tables and views,
create new attributes, or transform existing ones.
Note
○ The output of the enrichment calculation view must contain the SCENARIO_INSTANCE_ID and
PROCESS_INSTANCE_ID attributes because they are required by the correlation procedure.
○ If after enrichment new attributes appear in the enrichment calculation view output, they will not be
automatically propagated to the context data foundation calculation view output. You need to do this
manually.
○ A plus icon appears on the participant's data source pictogram to denote that the context is enriched.
Remove Context Enrichment for Participant
6. In the Properties view, open the General tab page and expand the Context Enrichment section.
7. Choose Remove Enrichment.
Note
○ The plus sign icon disappears from the participant’s data source. The enrichment calculation view is
not immediately deleted, this happens your scenario is generated.
○ The context data foundation calculation view is automatically updated – the enrichment calculation
view is replaced with the original context table for the participant.
○ If an enriched context attribute is used for correlation of a participant, removing enrichment for that
participant leaves the scenario in an invalid state and you need to select another context attribute for
correlation of that participant.
8. Generate your scenario.
This action deletes the enrichment calculation view.
3.13 Enhancing the Business Scenario Context
After you model your business scenario and save it, you can enhance the business scenario with additional
context information by customizing the context calculation view of the scenario so that you can identify the
business scenario instance. You can add your custom tables and views using the SAP HANA calculation view
editor, and join the tables to the scenario context view using any table attribute. In case you edit your scenario at a
later point in time by adding or removing participants to the scenario, the context calculation view is automatically
updated to reflect the changes. At the same time, your previous enhancements to the scenario context are
preserved.
The business context of a scenario consists of a set of tables and a calculation view. The tables hold the context
data of the process definitions - one table for each process definition in the scenario. They are generated in the
30
© 2015 SAP SE or an SAP affiliate company. All rights reserved.
Enabling Users to Observe a Business Scenario
Modeling a Business Scenario
SYS_PROCESS_VISIBILITY schema and named after the pattern
<scenario_package_name/>
SPVR_<scenario_name>_<process_family_name>_CTX .
On rare occasions, after you enhance the scenario context, automatic update may not be possible. These
occasions are:
● Your custom table is joined to a context table using an attribute other than SCENARIO_INSTANCE_ID and the
participant corresponding to this context table is deleted. In such cases, the context calculation view is
incomplete and is not validated, so you need to correct it manually.
Note
SCENARIO_INSTANCE_ID must be an attribute but not a measure.
● If you delete all context tables from the context calculation view, when the view is saved, it is regenerated in its
original form and any custom enhancements are lost.
Note
● The context calculation view is located in the root package of the scenario and is named
SPVR_<scenario_name>_CONTEXT. This calculation view joins together the context tables for the
scenario on their SCENARIO_INSTANCE_ID attribute. You can edit it to enrich the business scenario
context.
● It is important that the SCENARIO_INSTANCE_ID attribute is always present in the output of the context
calculation view. Even if you manually remove the attribute, the system will attempt to expose it again the
next time it is saved in the business scenario editor.
Caution
The generation of business scenario fails if context-calculation view contains hidden attributes that are used in
other attributes. Therefore, you must avoid the use of hidden attributes.
3.13.1
Aggregating Process Context in Business Scenario
Context
You use this procedure to aggregate the process context in a business scenario context.
Prerequisites
● You have defined the primary key(s) in the participants data object property.
For more information, see Configuring the Details of the Participant Context [page 31].
● You have marked the details of the process context in the data object property.
● You have used an aggregated view of the process context table in the calculation view of the business
scenario context.
Enabling Users to Observe a Business Scenario
Modeling a Business Scenario
© 2015 SAP SE or an SAP affiliate company. All rights reserved.
31
Procedure
1. Switch from aggregation to projection in the process context node that has primary keys.
2. Identify the header-level attributes and child-level attributes of this process context.
3. You can create measures by using aggregated functions like SUM, MIN, MAX, or AVG on child-level numeric
attributes.
Note
Non-numeric child-level attributes should be hidden in the semantic node of the Calculation Views.
Example: In the Sales Order business scenario, for each item that you order, there are different attributes
such as quotation_id, status, quantity, delivery_date. In the aggregated view, you can view only the numeric
attributes like quantity and delivery_date. The aggregation is based on the functions (SUM, MIN, MAX, AVG)
used. The non-numeric attributes like quotation_id and status are hidden.
4. To activate the calculation view, choose the Activate icon.
3.14 Adding Attributes to a Business Scenario
You use this procedure to specify the attributes for your business scenario.
Context
The attributes enables business users to do the following:
● Identify their scenario instance from a group of scenario instances in space.me
● View details about the scenario instance in space.me
● Navigate to the source system to view the full details of the attribute
● Specify the sequence in which these attributes must appear in space.me
● Filter, cluster, and slice and dice attributes that are strings and are part of the scenario instances table
Procedure
1. Launch SAP HANA studio.
2. Open the required business scenario.
3. From the right pane, select Attributes.
4. From the context menu for Attributes, select Add/Remove.
5. In the Add/Remove Attributes window, select the required attributes.
6. Choose OK.
32
© 2015 SAP SE or an SAP affiliate company. All rights reserved.
Enabling Users to Observe a Business Scenario
Modeling a Business Scenario
Note
To remove the attributes that are no longer part of a business scenario context, you can use the Update
option from the context menu.
The context attributes that you have added appear in the Attributes folder in the right pane.
7. To define the properties of an attribute, perform the following substeps:
a. Select the attribute.
b. On the Properties tab, specify the name and label.
c. If you want the context details to appear in the instance table in space.me to enable business users to
identify their scenario instance, in the Display field, select Overview.
d. In the Navigation Link field, enter the source system URL corresponding to the attribute that enables
business users to navigate to the source system and find more information.
Note
The URL can contain constant and dynamic values. You assign values to the constants directly in the
URL; for the dynamics, you assign the attributes. For example, in the URL http://
<host>:<port>/sap/bc/gui/sap/its/webgui/?sap-client=123&~transaction=VA03&VBAKVBELN=<DOCUMENT_NO>&sap-config-mode=true&~OKCODE=SUCH, sap-client parameter has a
constant value and the VBAK-VBELN parameter has a variable DOCUMENT_NO, which is an attribute
of the business scenario.
3.15 Creating Phases
Phases are a sequence of process steps that are part of your business scenario, and they are necessary in case
the business user needs to track and analyze a specific stage or part of a business scenario.
Context
You use this procedure to model phases for a business scenario:
Procedure
1. Launch SAP HANA studio.
2. Select the required business scenario.
3. Choose the Phases tab page.
4. From the Palette frame, drag the Phase element to the canvas.
5. Connect the Start, Phase, and End elements using the Sequence Flow connector.
Enabling Users to Observe a Business Scenario
Modeling a Business Scenario
© 2015 SAP SE or an SAP affiliate company. All rights reserved.
33
6. On the Phases tab page, select the Phase element.
7. On the General tab page of the Properties view, perform the following substeps:
a. In the Name field, enter a name for the phase.
b. In the Responsible field, select the name of the person who can provide more details about the state of a
phase.
8. To define the cycle time for the phase, proceed as follows:
a. Choose the Target tab page.
Note
The system sets the same target option (Constant or Breakdown) for the phases as that of the
business scenario. However, if you have specified Timestamp or Date/Time as the target option for the
business scenario, you can choose Constant, Timestamp, Percentage, or Date/Time as the target
option for phases.
b. In the Target Value section, proceed with one of the following options as appropriate:
Option
Description
Constant
If you want to define a constant value as the expected
time by when the phase execution must be completed,
select Constant and enter the days, hours, and minutes.
Timestamp
If you want to define the phase execution time (target)
based on the context data of the timestamp data type,
select Timestamp, and select the required attribute.
Date/Time
If you want to define the phase execution time (target)
based on the context data of the date/time data type,
select Date/Time, and select the required attribute.
Breakdown
If you want to define different values (based on
categories) as the expected time by when the phase
execution must be completed, perform the following
substeps:
1.
2.
3.
4.
5.
6.
Percentage
Select Breakdown.
Choose Select and select the required category.
Choose OK.
Choose Add and enter the days, hours, and minutes.
Choose OK.
In the Default Target field, enter a default value for
other category types.
If you want to define the phase execution time based on
the percentage of the scenario execution, select
Percentage and enter the required value.
Note
The sum of percentages of all phases in a scenario
must be less than or equal to 100%.
c. In the Threshold field, enter the percentage which, when reached, triggers the system to send an alert to
the business user.
34
© 2015 SAP SE or an SAP affiliate company. All rights reserved.
Enabling Users to Observe a Business Scenario
Modeling a Business Scenario
d. Save the changes.
3.15.1
Configuring Milestones
Milestones represent subgoals that are achieved in the course of a process, and they indicate the progress made
within the process. By default, a phase has two milestones - the start and end of the phase. You can add more
milestones to enhance process visibility.
Procedure
1. Choose the Milestones tab.
2. Choose Add.
3. In the Milestone field, enter a name for the milestone of the phase.
4. Choose the Add button, next to the Events field.
5. Select the required event or checklist that indicates the completion of the milestone, and choose OK.
Note
If an event or a checklist is already used in another milestone, you cannot use it in this milestone.
There is one exception: You can assign an event or checklist to the end of a phase and to the start of the
next phase. Thus, once the event occurs or the checklist is completed, the milestone is reached and the
corresponding phase ends. At the same time, the next phase starts.
If you select an event or checklist that is already used in another milestone, you will get a message
explaining the situation.
6. Choose OK.
7. To add more milestones (end of the phase and other milestones), repeat steps 2 to 6.
8. (Optional) For milestones other than start and end, you can specify the target value as one of the following:
Option
Description
Constant
If you want to define a constant value as the expected time
by when the milestone must be reached, select Target and
enter the days, hours, and minutes.
Timestamp
If you want to define the milestone execution time (target)
based on the context data of the timestamp data type,
select Timestamp and select the required attribute.
Date/Time
If you want to define the milestone execution time (target)
based on the context data of the date/time data type,
select Date/Time and select the required attribute.
Enabling Users to Observe a Business Scenario
Modeling a Business Scenario
© 2015 SAP SE or an SAP affiliate company. All rights reserved.
35
Option
Description
Breakdown
If you want to define different values (based on categories)
as the expected time by when the milestone must be
reached, perform the following substeps:
1.
2.
3.
4.
5.
6.
Percentage
Select Breakdown.
Choose Select and select the required category.
Choose OK.
Choose Add and enter the days, hours, and minutes.
Choose OK.
In the Default Target field, enter a default value for
other category types.
If you want to define the milestone execution time based
on the percentage of the phase execution, select
Percentage and enter the required value.
9. (Optional) To edit a milestone, for example, you want to change the conditions for the achievement of a
milestone by adding events or assigning a checklist, select the milestone on the Milestone tab and choose
Edit.
Related Information
Checklists [page 46]
Creating a Checklist [page 47]
3.16 Measures
Measures enable business users to understand and analyze the performance of a business scenario. Based on
their observations, they can take corrective action, if necessary.
You create measures for your business users. These measures are based on SAP HANA analytic and calculation
views.
For example, in an Order Fulfillment business scenario, you can create the following measures:
● Number of Orders Rejected
● Delivery Cycle Time
● Revenue
For every measure that you create, you specify the following properties:
● Reporting period: This signifies the time period based on which business users can analyze the measure. It
can be daily, weekly, monthly, quarterly, or yearly.
● Aggregation type: This signifies how you want to calculate the measure. It can be SUM, AVG, MIN, or MAX.
36
© 2015 SAP SE or an SAP affiliate company. All rights reserved.
Enabling Users to Observe a Business Scenario
Modeling a Business Scenario
Types of Measures
You can create the following types of measures:
● Predefined measures
● Custom measures
○ Count measures
○ Duration measures
○ Context-based measures
○ SAP HANA-based measures
Predefined Measures
The following predefined measures are provided for your business scenario:
● Completed on Time: This provides the number of scenario instances completed within the target cycle time.
● Completed with Violation: This provides the number of scenario instances completed but not within the
target cycle time.
Custom Measures
You can create specific measures for your business scenario, known as custom measures.
Count Measures
Count measures enable business users to analyze the number of times a specific event occurs in a business
scenario. The default aggregation type is SUM, but you can change it to AVERAGE, if necessary.
Example
● Number of Orders Rejected – This measure counts the number of times the ‘Rejected’ event occurs. The
aggregation type is SUM and it is assumed that the ‘Rejected’ event occurs only once for each scenario
instance.
● Average Number of Times an Order Is Modified – This measure provides the average number of times the
‘Modified’ event occurs in a scenario instance. The aggregation type is AVERAGE and it is assumed that the
‘Modified’ event can occur multiple times for a scenario instance.
Enabling Users to Observe a Business Scenario
Modeling a Business Scenario
© 2015 SAP SE or an SAP affiliate company. All rights reserved.
37
Duration Measures
Duration measures enable business users to analyze the time period between two events - the start and end
event. The aggregation type is AVERAGE.
The start and end events can occur multiple times for a scenario instance. If the events occur in a sequence (for
example, start-event1 > end-event1 > start-event2 > end-event2), the duration is the sum of duration between
start and end events. Otherwise, the duration is the period between the first occurrence of the start event and the
last occurence of the end event.
Example
● Cycle Time – This measure provides the average duration between the start and the end period of a
business scenario.
● Delivery Cycle Time – This measure provides the average time taken to deliver an order, that is, the
duration between ‘Delivery Initiated’ event and ‘Delivery Completed’ event.
Context-Based Measures
Context-based measures enable business users to analyze measures that are part of the business-scenario
context.
The aggregation type of the context-based measure is the same as that of the measure in the calculation view. If it
contains a formula, you can specify how the system must aggregate the value (SUM, MIN, MAX, or AVERAGE).
Example
● Revenue Loss – This measure provides the loss in revenue due to rejected orders.
● Revenue – This measure provides the total value of all the orders delivered.
● Average Order Value – This measure provides the average value of the orders processed. It is analyzed
when the order is approved, that is, when the 'Approval' event occurs.
SAP HANA-Based Measures
SAP HANA-based measures enable business users to analyze business-relevant measures, which are not a direct
outcome of the business scenario but are related to the business scenario. For example, measures such as
Inventory, Forecast Bias, and Receivables are related to the Order Fulfillment business scenario, but they are
not part of the business-scenario context.
The aggregation type of the SAP HANA-based measure is the same as that of the measure in the calculation view.
If it contains a formula, you can specify how the system must aggregate the value (SUM, MIN, MAX, or AVERAGE).
38
© 2015 SAP SE or an SAP affiliate company. All rights reserved.
Enabling Users to Observe a Business Scenario
Modeling a Business Scenario
Related Information
Creating a Count Measure [page 39]
Creating a Duration Measure [page 40]
Creating Context-Based or SAP HANA-Based Measures [page 40]
3.16.1
Creating a Count Measure
You use this procedure to create count measures, which enable business users to analyze the number of times a
specific event occurs in a business scenario.
Procedure
1. In the right pane of business scenario editor, select the Measures node.
2. From the context menu of the Measures node, choose
New
Count Measure .
3. In the New Measure wizard, enter a name and description.
4. In the Reporting Period field, select the time period based on which business users can analyze the measure.
5. If you want to enable business users to analyze the average number of times a specific event occurs, select
AVERAGE in the Aggregation Type field.
6. In the Event field, select the event that you want to count.
7. Choose OK.
8. Choose Next.
9. (Optional) To define a filter condition for the count measure based on a context attribute, perform the
following substeps:
a. Choose Add.
b. In the Attribute field, choose ....
c. In the Select Attribute window, select the required context attribute.
d. In the Value field, enter the desired value for the attribute.
10. Choose Finish.
Note
If required, you can edit the measure by selecting it in the Measures node and modifying the details in the
Properties view.
Enabling Users to Observe a Business Scenario
Modeling a Business Scenario
© 2015 SAP SE or an SAP affiliate company. All rights reserved.
39
3.16.2 Creating a Duration Measure
You use this procedure to create duration measures, which enable business users to analyze the time period
between two events - the start and end event.
Procedure
1. In the right pane of business scenario editor, select the Measures node.
2. From the context menu of the Measures node, choose
New
Duration Measure .
3. In the New Measure wizard, enter a name and description.
4. In the Reporting Period field, select the time period based on which business users can analyze the measure.
5. In the Start Event field, select the event based on which you want to start tracking.
6. In the End Event field, select the event based on which you want to stop tracking.
7. In the Calculation field, select the required option.
8. Choose Next.
9. (Optional) To define a filter condition for the duration measure based on a context attribute, perform the
following substeps:
a. Choose Add.
b. In the Attribute field, choose ....
c. In the Select Attribute window, select the required context attribute.
d. In the Value field, enter the desired value for the attribute.
10. Choose Finish.
Note
If required, you can edit the measure by selecting it in the Measures node and modifying the details in the
Properties view.
3.16.3 Creating Context-Based or SAP HANA-Based Measures
You use this procedure to create context-based and SAP HANA-based measures. The context-based measures
enable business users to analyze measures that are part of the business-scenario context, and SAP HANA-based
measures enable business users to analyze business-relevant measures that are not a direct outcome of the
business scenario but are related to the business scenario.
Procedure
1. In the right pane of business scenario editor, open the context menu of the Measures node, and select Add.
40
© 2015 SAP SE or an SAP affiliate company. All rights reserved.
Enabling Users to Observe a Business Scenario
Modeling a Business Scenario
2. In the Add Measure wizard, enter a name and description for the measure.
3. In the Reporting Period field, select the time period based on which business users can analyze the measure.
4. In the Source field, select one of the following types of view as appropriate:
○ Context calculation view of the scenario: If you need to create a context-based measure
○ SAP HANA calculation or analytical view: If you need to create an SAP HANA-based measure
○ You can view the details of a HANA based measure using the table view or cluster view. All the attributes,
of type string except SCENARIO_INSTANCE_ID, is available as part of the output of HANA based
calculation view and the attributes appear in table view.
Note
○ To enable business users navigate to the scenario-instance details, the HANA-based measure
must have the SCENARIO_INSTANCE_ID as part of the output.
○ The business user must have the analytical privilege that grants access to the source of the HANAbased measure.
○ It is possible to filter, cluster, and slice and dice the HANA-based measures or indicators on
attributes that are part of the business scenario only.
5. In the Measure field, select the required measure of the calculation or analytical view.
6. In the Analyze On field, select one of the following options based on which business users can analyze the
data:
○ For context-based measure, you can select business scenario start or end, business scenario context
(time-based attribute), or business scenario event.
○ For SAP HANA-based measure, you can select a time-based attribute of the view.
Note
If the measure you have selected does not contain timestamp attributes, the system does not show any
options in this field.
7. Choose OK.
Note
If required, you can edit the measure by selecting it in the Measures node and modifying the details in the
Properties view.
3.17 Indicators
Indicators help business users to understand the performance of a business scenario by comparing it with the
required target. For every measure, you can define an indicator and specify a target, threshold, and the required
trend.
Enabling Users to Observe a Business Scenario
Modeling a Business Scenario
© 2015 SAP SE or an SAP affiliate company. All rights reserved.
41
Types of Indicators
You have the following types of indicators: Predefined and Custom.
Predefined Indicators
The following predefined indicators are provided for your business scenario:
● % Completed on Time: This provides the percentage of scenario instances completed within the target cycle
time.
● Cycle Time: This provides the average time taken to complete a scenario instance.
Custom Indicators
You can create specific indicators for your business scenario, known as custom indicators.
Target Options
The target options for an indicator are as follows:
● Constant target: Target is a constant value, for example, target for profitability is 25%.
● Attribute as target: Target is based on a context attribute, for example, target for Cycle Time is based on the
Targeted Delivery Date context attribute. This is applicable to indicators based on duration measures only.
● Breakdown as target: Target is based on a context attribute, and it varies for different values of the context
attribute. For example, the target for Cycle Time is based on the Category attribute. The target for Cycle Time
is 6 days for customers in the Gold category, 4 days for the Platinum category, and 8 days for Others.
Target Value
The target value of an indicator is based on the aggregation type of the related measure.
● Sum: If the aggregation type is Sum, the target value is analyzed on a daily basis. For example, if the target for
the Revenue measure is 6000 EUR for a day, then the target for a week is 42,000 EUR, and for a year it is
2,190,000 EUR.
● Average, Max, Min: Target is not based on time and is constant over time. For example, if the target for
profitability is 25%, the target for the week, month, quarter, and year is 25%.
42
© 2015 SAP SE or an SAP affiliate company. All rights reserved.
Enabling Users to Observe a Business Scenario
Modeling a Business Scenario
Indicator Status
The status of the indicator is based on the calculation between the actual value, target value, threshold, and the
desired trend.
Example
Cycle Time
● Aggregation Type: Average
● Target: 5 Days
● Required Trend: Below Target
● Threshold: 80%
● Threshold Value: Threshold * Target = 5 * 80 % = 4 Days
Status
Description
Details
Green
Cycle Time is less than 4 days
Actual value is below the threshold
value. Therefore, the performance is
good.
Yellow
Cycle Time is between 4 days and 5
days
Actual value is between the threshold
and the target values. Therefore, the
performance is acceptable.
Red
Cycle Time is greater than 5 days
Actual value is greater than the target
value. Therefore, the performance is
poor and the involved business user
must take immediate action.
Example
Profitability
● Aggregation Type: Average
● Target: 25%
● Required Trend: Above Target
● Threshold: 20%
● Threshold Value: Target + Threshold * Target = 25 + 25 * 20 % = 25 + 5 = 30 %
Status
Description
Details
Red
Profitability is below 25%
Actual value is below the threshold
value. Therefore, the performance is
poor and the involved business user
must take immediate action.
Yellow
Profitability is between 25% and 30%
Actual value is between the target and
threshold values. Therefore, the
performance is acceptable.
Green
Profitability is greater than 30%
Actual value is greater than the target
value. Therefore, the performance is
good.
Enabling Users to Observe a Business Scenario
Modeling a Business Scenario
© 2015 SAP SE or an SAP affiliate company. All rights reserved.
43
3.17.1
Creating Indicators
You use procedure to create indicators, which help business users to understand the performance of a business
scenario by comparing it with the required target value.
Procedure
1. In the right pane of the business scenario editor, select the Indicators node.
2. From the Indicators node, choose New Indicator.
3. Enter a name and description for the indicator.
4. To select the measure to which the indicator applies, perform the following substeps:
a. Choose Browse.
b. Select the required measure from the list of available measures.
c. Choose OK.
5. Choose the Target tab page.
6. In the Target Value section, specify the type of the target value you want to set, and specify the details.
Note
If you have selected a duration measure, you can use the context data (timestamp or date/time attribute)
as the target value.
7. If you have selected the Breakdown option in the Target Value field, perform the following substeps:
a. Choose Browse and select a context attribute from the list.
b. Choose Add, and in the Value field, enter the value for the category.
c. In the Target field, enter the desired target value.
Note
The type of target value depends on the measure for which you are creating the indicator. For a count
measure, you need to set an integer in the Target field. For a duration measure, choose ... and set the
target in the new dialog.
8. In the Required Trend field, select the desired performance direction for the target value.
9. In the Threshold field, enter the percentage difference from the target value that defines whether
performance is good, acceptable, or poor.
Results
Once you save and generate the scenario, the indicator values are visible in the space.me workspace.
44
© 2015 SAP SE or an SAP affiliate company. All rights reserved.
Enabling Users to Observe a Business Scenario
Modeling a Business Scenario
3.18 Actions
You can define actions for a business scenario that can be easily and quickly performed by business users on
space.me.
These actions support business users in handling the business scenario and reaching its goal. Recurring tasks can
be easily accessed and executed using these actions. This kind of action is also called a navigation action.
Actions are defined on a business scenario level and therefore are available for all instances of the business
scenario.
By generating the business scenario, an entry is written for each navigation action in the NAVIGATION_ACTIONS
database table.
You define the following attributes for the action:
● Label
Name of the action, for example Call the embassy.
● Target
Target URL of the action, for example, a telephone number (tel://0049123456789) or an e-mail address
(mailto:mail@address.com). You can enter any valid URI.
Note
You can use variables of the context data foundation (CDF) as parameters in the attributes of an action. When
using parameters, enter them in angle brackets: <PARAMETER_NAME>. The action is only displayed if values
for the parameters are available. For example, you enter as action name (Label) Call <colleague>, and as
target the URI tel://<Telephone>. If the parameters can be resolved during runtime, the action is displayed
as follows: Call Paul Smith (Target: tel://012345678).
3.18.1
Defining Actions
Actions are bound to business scenarios. Therefore, you define actions in the business scenario.
Procedure
1. In the right pane of the business scenario editor, select the Actions node.
2. From the context menu of the Actions node, choose New Navigation Action.
3. In the New Navigation Action wizard, in the Label field, enter a name for the action, for example, Download
Visa Application Form .
Enter an angle bracket (<) to display all valid parameters in a list. By selecting the parameters from the list,
you assure that the parameters are correctly written and valid.
4. In the Target URI field, enter a valid URI, for example the Web address of the Visa application form (http://
my.gov/visa_application.pdf).
Enabling Users to Observe a Business Scenario
Modeling a Business Scenario
© 2015 SAP SE or an SAP affiliate company. All rights reserved.
45
Here, you can also use parameters.
5. Choose Finish.
Results
By generating the business scenario, a row is generated for each navigation action in the NAVIGATION_ACTIONS
database table. Changes to navigation actions are immediately reflected in all instances of the business scenario.
3.19 Checklists
A checklist contains important tasks that need to be performed to reach a milestone. Therefore, checklists
support business users in handling and executing the tasks that are necessary to quickly reach a specific goal.
You can define several checklists for one business scenario. For each checklist template you define, a checklist in
SAP HANA studio is generated for each business scenario instance. If you have assigned the checklist to a
milestones, it is displayed for each instance of the business scenario on space.me next to the respective
milestone. The process operator can easily see, what needs to be done to reach the milestone.
Note
If you do not assign the checklist to a milestone, it is not displayed in space.me.
When a checklist is completed by the process operator in space.me, the corresponding complete event will be
triggered and the milestone to which the checklist is assigned will be reached. For more information, see
Configuring Milestones [page 35].
During runtime, the checklist can be enhanced according to the needs of specific situations. Operators working on
an instance can add ad hoc tasks to the checklist, mark tasks of the checklist as completed, and also collaborate
with colleagues on particular tasks in the checklist.
Note
The checklist is not automatically completed after all tasks have been completed and vice versa. It is possible
that in a specific situation an additional task is needed to reach the milestone. Or the other way round, the
milestone can be reached without completing a task in the checklist that is necessary in 90% of the cases but
not in this specific one.
For more information about working on business scenarios in space.me and about integrated task management,
see http://help.sap.com/hana-opint Application Help SAP Library Working with space.me guide, in
particular the Using Checklists and Tasks to Achieve Specific Goals section.
46
© 2015 SAP SE or an SAP affiliate company. All rights reserved.
Enabling Users to Observe a Business Scenario
Modeling a Business Scenario
Related Information
Configuring Milestones [page 35]
3.19.1
Creating a Checklist
You create a checklist and add tasks to the checklist in the business scenario editor. You can then attach this
checklist as event to a milestone. Every checklist you have defined is generated for each business scenario
instance.
Procedure
1. In the right pane of the business scenario editor, select the Checklists node.
2. From the context menu of the Checklists node, choose New.
3. In the New Checklist wizard, enter a subject.
4. If you want to create an empty checklist for now and add tasks later, choose Finish.
5. To add tasks to the checklist, choose Add.
6. In the New Task wizard, enter a subject and a description for the task and choose Finish.
The task is added to the checklist and displayed in the New Checklist wizard.
7. To add more tasks to the checklist, repeat steps 5 to 6.
8. Choose Finish to save the checklist.
The checklist is now displayed in the right pane of the business scenario editor, under the Checklists node.
9. You can now add the checklist as event to a milestone.
You can assign a checklist to only one milestone with one exception: you can assign a checklist to the end of a
phase and in addition to the start of the next phase. That means, once the checklist is completed, the
milestone is reached and the corresponding phase ends. At the same time, the next phase starts. For more
information, see Configuring Milestones [page 35]
10. To edit the checklist, for example, to add or delete tasks, open the checklist by double-clicking the checklist
name.
11. On the Properties tab, you can edit the name of the checklist and of the tasks and you can add and remove
tasks.
12. To delete the checklist, select the checklist under the Checklists node, and from the context menu, choose
Delete.
Related Information
Configuring Milestones [page 35]
Enabling Users to Observe a Business Scenario
Modeling a Business Scenario
© 2015 SAP SE or an SAP affiliate company. All rights reserved.
47
3.20 Business Situations
By defining business situations, you enable threats and opportunities to be quickly detected and reported. You
can also define actions for business situations to help business users handle the situations quickly and efficiently,
for example, mitigating the threat or taking/rejecting the opportunity.
What Is a Business Situation?
A business situation is a specific situation that occurs in the context of a business scenario. It provides actions to
mitigate the risk or take/reject the opportunity.
Example: A company is mass-manufacturing laptops with just-in-time ordering of the components required for
assembly. The warehouse space available for storing the components is a critical factor. The manufacturer wants
to order the components when prices are low, but cannot order too many because the warehouse will fill and there
will not be enough space for the other components needed to assemble the laptops. For this business scenario,
the following business situations are defined:
Table 7:
Business Situation Type
Condition
Action
Threat
The storage warehouse for inbound
components is reaching capacity.
Restrict component-ordering to a trickle
until danger is over and search for a new
temporary storage location.
Opportunity
A new storage warehouse becomes tem­ Buyers can decide which parts to buy in
porarily available due to a production
bulk at reduced prices.
halt on another product.
Business situations are bound to business scenarios. Therefore, they are triggered by the correlation procedure of
the respective business scenario, which runs by default every five minutes. However, this is configurable. For
more information, see the Changing the Schedule of the Job section in the SAP Operational Process Intelligence
Installation and Upgrade Guide.
Business situations are not linked to a business scenario instance because business situations are typically
defined on a broader scope, for example, aggregating data of the process context foundation or considering
additional data sources not directly related to a business scenario instance.
A business situation is triggered based on the evaluation of a procedure. For more information about detection
procedures, see Developing a Detection Procedure [page 49].
Instances of business situations are visible to all users that have the corresponding operator role for the scenario.
Table 8:
Required Role
<package_name>.gen_<scenario_name>::<custom_role_nam
e>_OPERATOR
Description
●
Access to the specific scenarios and the restricted data in
space.me
For more information about roles, see Authorizations and Roles [page 59].
Solution experts express complex business logic in the form of business conditions and results using SAP HANA
rules framework, which is a component available as part of SAP Operational Process Intelligence. For more
48
© 2015 SAP SE or an SAP affiliate company. All rights reserved.
Enabling Users to Observe a Business Scenario
Modeling a Business Scenario
information, see the SAP HANA Rules Framework 1.0 SPS04 Modeling Guide on SAP Service Marketplace at SAP
HANA Rules Framework .
Business Situation Attributes
A business situation has the following attributes:
● Detection procedure (mandatory)
A mechanism that detects the particular business situation. There are some requirements for the business
situation detection mechanism that must be fulfilled by the procedure. For more information, see Developing
a Detection Procedure [page 49].
● Subject (mandatory)
Meaningful name for the business situation. You can use all output variables coming from the detection
procedure as parameters. You can display all valid parameters by entering an angle bracket (<).
● Description (optional)
More details on the business situation. Here, you can also use output variables as parameters.
● Action name (mandatory)
A meaningful name for the action that needs to be performed by the process operator on space.me when a
business situation is detected and displayed. Here, you can also use output variables as parameters.
● Action URI (mandatory)
A valid URI as the target URL of the action. Here, you can also use output variables as parameters. You can
include a HANA workflow as an action. A HANA workflow can comprise of several steps and can call several
rules.
Related Information
Developing a Detection Procedure [page 49]
Defining Business Situations [page 51]
Integration in Business Scenarios [page 71]
3.20.1 Developing a Detection Procedure
A business situation is triggered based on the evaluation of a procedure. This procedure is an SQL procedure that
implements a rule to detect business situations.
The SQL procedure implementing a detection rule must have a signature containing no input parameter and
exactly one output parameter, which must be of table type (scalar parameters are not allowed). This table type
can consist of any number of columns. Currently, the following simple data types are supported for the columns:
● Integer types (INTEGER, BIGINT, TINYINT, SMALLINT)
● String types (NVARCHAR, VARCHAR)
● Timestamp (TIMESTAMP)
In this table, each row refers to a business situation instance. This instance is uniquely identified by the values of
all columns in that row. All these values are stored as parameters in the business situation instance and are
Enabling Users to Observe a Business Scenario
Modeling a Business Scenario
© 2015 SAP SE or an SAP affiliate company. All rights reserved.
49
checked to determine whether an instance already exists. If there is a business situation in the database with the
same key identifiers as in a line of the results of this procedure, no new business situation instance is created for
the corresponding line.
Example
DEMO.schema
schemaname=DEMO
Example
FLIGHT.hdbdd
namespace demo;
@Schema:'DEMO'
type FLIGHT {
FLIGHT_ID : String(20); //ID of the flight
DATE : UTCTimestamp; // Date of the flight
};
Example
LATE_FLIGHTS.hdbtable
table.schemaName = "DEMO";
table.tableType = COLUMNSTORE;
table.columns = [
{ name = "FLIGHT_ID"; sqlType = NVARCHAR; nullable = false; length = 20; },
{ name = "DATE"; sqlType = DATE; nullable = false; }
];
Example
GET_LATE_FLIGHTS.hdbprocedure
PROCEDURE "DEMO"."demo::GET_LATE_FLIGHTS" (OUT result "DEMO"."demo::FLIGHT")
LANGUAGE SQLSCRIPT
SQL SECURITY INVOKER
READS SQL DATA AS
BEGIN
result = SELECT "FLIGHT_ID", TO_TIMESTAMP("DATE") AS "DATE" FROM
"DEMO"."demo::LATE_FLIGHTS";
END;
For more information about procedures, see the Developing Procedures section in the http://help.sap.com/
hana/SAP_HANA_Developer_Guide_en.pdf.
50
© 2015 SAP SE or an SAP affiliate company. All rights reserved.
Enabling Users to Observe a Business Scenario
Modeling a Business Scenario
3.20.2 Defining Business Situations
Business situations are bound to business scenarios. Therefore, you define business situations in the business
scenario.
Prerequisites
● Business scenario is available.
● Detection procedure is available.
Context
Note
You can use all output variables from the detection procedure as parameters in the attributes of a business
situation. When using parameters, enter them in angle brackets: <PARAMETER_NAME>. Spaces before and
after a parameter are not mandatory. The parameters are resolved when the business situations are retrieved
and are displayed directly in each business situation instance to the operators in space.me.
You can also use parameters that are not associated with the business scenario. This means that actions used
in business situations, unlike those assigned to the scenario directly, can use any data in SAP HANA, provided
that this is returned as output from the detection procedure.
Procedure
1. In SAP HANA studio, open the business scenario for which you want to define a business situation.
2. In the right pane of the business scenario editor, select the Business Situations node.
3. From the context menu of the Business Situations node, choose New.
4. In the New Business Situation wizard, choose Search Procedures to select the detection mechanism for the
business situation. For more information about detection procedures, see Developing a Detection Procedure
[page 49].
If you enter two adjacent letters of the procedure you want to select, a list of all possible procedures with
these two letters in their name is displayed.
5. In the Subject field, enter a descriptive name for the business situation. You can use all output variables from
the detection procedure as parameters. When using parameters, enter them in angle brackets:
<PARAMETER_NAME>.
Enter an angle bracket (<) to display all valid parameters in a list. By selecting the parameters from the list,
you ensure that the parameters are correctly written and valid.
6. Optional: You can add a description of the business situation. In the description, you can again use all output
variables as parameters.
Enabling Users to Observe a Business Scenario
Modeling a Business Scenario
© 2015 SAP SE or an SAP affiliate company. All rights reserved.
51
7. In the Action Name field, enter a label for the action that the operator needs to perform to handle the business
situation. In the action name, you can again use all output variables as parameters.
8. Enter a target URL for the action. You can enter any valid URI. Here again, you can use all output variables as
parameters.
After replacing all parameters, the URI is encoded using the JavaScript standard encoding behavior. This does
not include protocol-specific encoding, for example, HTML. Usually, this is done by the browser. However, if
parameters contain irregular special characters, it cannot be guaranteed that all the applications you are
using, working with all kinds of URIs, will comply with this behavior.
Example: The system assumes that the "<" and ">" characters are used to delimit a parameter, and that the
parameter exists. A text of the form "net weight < total weight > packaging weight" will not be accepted
because the system interprets "total weight" as a parameter, but this parameter does not exist. Therefore, we
recommend that you do not use "<" and ">" in the text, even though it usually does not lead to problems.
9. Choose Finish.
Note
If required, you can edit the business situation by selecting it in the right pane of the business scenario
editor under the Business Situations node, and modifying the details in the Properties view.
Note
SAP HANA Rules Framework enables you to use SAP HANA rules to express your business constraints and
generate an SQL procedure containing your business logic. You can link to this SQL procedure to detect
your business situation. For more information, see the latest SAP HANA Rules Framework Modeling Guide
on SAP Service Marketplace at SAP HANA Rules Framework .
Related Information
Developing a Detection Procedure [page 49]
Business Situations [page 48]
Integration in Business Scenarios [page 71]
3.21 Data Model for Business Scenario Data
With a data model, you can define a structure for entering data for the business scenario during runtime, thus
enabling business users to read, edit, and add business scenario instance-relevant data.
The data model holds the business scenario instance context data. The data of the data model is stored in an SAP
HANA table and is available to the user in the scenario instance view of space.me on the DETAILS tab for create,
read, and update operations.
You can define events on a data model. During runtime, the events that are defined on a data model are generated
in real time.
52
© 2015 SAP SE or an SAP affiliate company. All rights reserved.
Enabling Users to Observe a Business Scenario
Modeling a Business Scenario
Mapping tables are generated containing the SCENARIO_INSTANCE_ID column and all primary key fields.
Boundary Conditions and Requirements
● Several root data model tables can be used for one scenario instance.
● A primary key is defined for the table.
● All data for a scenario instance is shown in the instance view for the data model. There are no restriction on
specific columns or attributes.
3.21.1
Enabling Users to Enter Data for a Business Scenario
To enable business users to enter, change, and store data for a business scenario instance, you create a data
model in the business scenario editor.
Procedure
1. In the right pane of the business scenario editor, select the Data Model node.
2. From the context menu of the Data Model node, choose Add.
3. In the New Data Model wizard, enter a name for the data model.
4. Enter the database table that is used as a context table for the data model. To do this, choose Browse and
select a table.
A primary key must be defined for the table.
If the criteria are not met, you will see an error message and marker at the bottom of the wizard.
For more information, see Data Model for Business Scenario Data [page 52], section Boundary Conditions and
Requirements.
The business users need authorization for the database tables to write and update the business scenario
context data on space.me.
5. Confirm your selection with OK.
6. In the New Data Model wizard, select the Maximum Occurence.
○ Once: only one entity can be added to a scenario instance at runtime
○ Unbounded: several entities can be added to a scenario instance at runtime
For example, in a relocation scenario, the dependents of the relocated employee.
7. In the New Data Model wizard, choose Finish.
8. In the context menu of the data model, choose Properties and then Label. Enter labels to display on space.me
instead of the technical labels. The labels that you enter next to the technical labels can be translated.
9. Optional: You can define events for the data model.
a. In the Properties of the data model, choose General.
Enabling Users to Observe a Business Scenario
Modeling a Business Scenario
© 2015 SAP SE or an SAP affiliate company. All rights reserved.
53
b. Next to Event, choose Add.
c. In the Add New Event wizard, enter a name for the event, for example, Visa Granted.
d. Enter a condition for the event, for example, "STATUS"='Visa Granted'.
e. Select a processor who triggers the event.
f. Choose Finish.
g. To add more events to the data model, repeat steps a to f.
The events you have defined for the data model can be assigned to milestones of a phase. For more
information on how to assign an event to a milestone, see Configuring Milestones [page 35].
3.21.2 Changing Data Model Tables
When changing data model tables, you need to consider certain aspects.
Recommendations and Hints
● To add a column in the middle of the data model table, remove the subsequent columns, add the new column,
and then add the removed columns again after the new column.
Removing columns executes an alter statement, which deletes data.
● Adding a column at the end keeps the existing data.
● To apply the data table changes in the data model, perform the following steps:
1. In the business scenario editor, open the respective data model by double-clicking its name.
2. On the Properties tab, go to General and select another Source via Browse.
3. Reselect the original data table and choose OK.
● Modeled events are retained even though the underlying table has been changed.
● Adding a column always leads to an incompatible change:
○ It deletes LEVEL0 (L0) event data.
○ Manual recorrelation is necessary.
○ The scenario data is removed with the next (scheduled) correlation run.
54
© 2015 SAP SE or an SAP affiliate company. All rights reserved.
Enabling Users to Observe a Business Scenario
Modeling a Business Scenario
4
Generating a Business Scenario
You use this procedure to generate appropriate artifacts that can be used to track, monitor, and analyze a
business scenario.
Procedure
1. Open the SAP HANA Development perspective.
2. From the context menu of the business scenario project in the project explorer view, choose
Scenario
Business
Generate .
Results
The system generates scenario-related tables and correlation-related artifacts in the SYS_PROCESS_VISIBILITY
schema.
The system generates the following artifacts in the gen_<scenario_name> package:
● Business Scenario Artifacts [page 55]
● Phase Artifacts [page 56]
● My Requests Artifacts [page 56]
● Measures and Indicators Artifacts [page 57]
● Predefined Measures and Indicators Artifacts [page 57]
● Translation Artifacts [page 58]
4.1
Business Scenario Artifacts
The table below provides details of the calculation views that are generated. In addition to this, the system also
generates other artifacts such as OData services and DB views.
Table 9: Business Scenario Artifacts
Artifact Name
Artifact Type
Purpose
PR_VIEW <scenario name>:Process
View
Calculation view
This view provides basic details of the in­
stances that are in the in-process state.
Enabling Users to Observe a Business Scenario
Generating a Business Scenario
© 2015 SAP SE or an SAP affiliate company. All rights reserved.
55
Artifact Name
Artifact Type
Purpose
SC_INS_DETAILS <scenario
name>:Business Scenario Details of an
instance
Calculation view
This view provides details of a specific
instance.
SC_INS_DETAILS_REQ <scenario
name>:Business Scenario Details of an
instance
Calculation view
This view provides details of a specific
instance for the requester.
In addition, a context calculation view for a business scenario is generated in the package where the business
scenario is located. The reason for this is that this context calculation view has a different lifecycle than the
generated artifacts in the gen_<scenario name> package. For more information, see Enhancing the Business
Scenario Context [page 30].
4.2
Phase Artifacts
The table below provides details of the calculation views that are generated. In addition to this, the system also
generates other artifacts such as OData services and DB views.
Table 10: Phase Artifacts
Artifact Name
Artifact Type
Purpose
PH_VIEW <scenarioname>:Phase View
Calculation view
This view provides phase status and ba­
sic details of the instances that are in the
in-process state.
SC_INS_PH_DETAILS
<scenarioname>: phase details for an
instance
Calculation View
This view provides phase details of a
specific instance.
SC_INS_PH_DETAILS_REQ
<scenarioname>: phase details for an
instance
Calculation View
This view provides phase details of a
specific instance for the requester.
4.3
My Requests Artifacts
The table below provides details of the calculation view that is generated. In addition to this, the system also
generates other artifacts such as OData services and DB views.
Table 11: My Requests Artifacts
Artifact Name
Artifact Type
Purpose
MY_REQUESTS_VIEW
Calculation view
This view allows you to retrieve the sce­
nario status of the requests that are in
the in-process state for a logged in user.
56
© 2015 SAP SE or an SAP affiliate company. All rights reserved.
Enabling Users to Observe a Business Scenario
Generating a Business Scenario
4.4
Measures and Indicators Artifacts
For each measure or indicator, a calculation view is generated that exposes the calculated value of the measure or
indicator. The calculation view name consists of:
● Count measure: CNT_<measure_name>
● Duration measure: DUR_<measure_name>
● Indicator: IND_<indicator_name>
If the name of the measure or indicator that you set is longer than 15 characters, then you will see only the first 3
consonants of each word in the calculation view name. For example, if the name of your measure is Target Cycle
Time, the name of the measure calculation view is DUR_TRG_CYC_TM.
Each measure calculation view has a measure MEASURE in its output that returns the calculated value of the
measure.
4.5
Predefined Measures and Indicators Artifacts
For each scenario, there are some predefined measures and indicators. They evaluate certain scenario metrics
related to scenario and phase completion time.
Table 12: Predefined Measures and Indicators Artifacts
Artifact Name
Artifact Type
Purpose
INS_COMP_ON_TIME
Calculation view
This view calculates the number of sce­
nario instances completed on time.
INS_COMP_OVER_TIME
Calculation view
This view calculates the number of in­
stances completed for more time than
targeted.
PERCENT_COMPLETED_ON_TIME
Calculation view
This view calculates the percentage of
scenario instances completed on time
and evaluates the predefined maximiz­
ing indicator for this measure.
SC_CYCLE_TIME
Calculation view
This view calculates the average sce­
nario cycle time and evaluates the pre­
defined minimizing indicator for this
measure.
SCENARIO_PHASE_DURATION
Calculation view
This view provides the average phase
duration for completed scenario instan­
ces.
Enabling Users to Observe a Business Scenario
Generating a Business Scenario
© 2015 SAP SE or an SAP affiliate company. All rights reserved.
57
4.6
Translation Artifacts
When you generate the business scenario for the first time, a custom_messages.hdbtextbundle file is created in
the gen_<scenario_name> folder. This file contains translatable texts for objects such as measures, indicators,
attributes, and navigation action labels in the business scenario in the following format: <object type>.<object
id>.<property name> = <human readable texts>.
Note
If you detect incompatible changes in the business scenario context, delete the incompatible context tables in
the destination system before transport. For more information about transporting business scenarios, see
Transporting Business Scenarios [page 69].
For more information about the translation of custom scenario texts from English to other languages, see
Translating Scenario Custom Texts [page 67].
58
© 2015 SAP SE or an SAP affiliate company. All rights reserved.
Enabling Users to Observe a Business Scenario
Generating a Business Scenario
5
Authorizations and Roles
Authorizations and roles define the objects that users can access and the actions they can perform. In SAP
Operational Process Intelligence, there are several roles that need to be assigned to users to enable them to
perform operations, for example, on business scenarios, tasks, workflows, and rules.
The following sections describe the typical user assignments and the technical role assignments that are needed
for the activities.
Operator or line-of-business user (with full access)
The operator is responsible for ensuring the smooth running of the business process and takes necessary action
to resolve any bottlenecks and move the process forward.
Table 13:
Required Roles
Description
sap.opi.pv.roles::OPINTUSER
Access to tasks; enables task management in space.me.
<package_name>.gen_<scenario_name>::<scenario_name>_
OPERATOR
Access to the specific scenarios and all relevant data in
space.me.
<package_name>.<technical_name>.v1.security::Start
Allows the user to process workflows of the specific workflow
template.
sap.bc.hwf.security::HWFEndUser
Allows the user to complete workflow tasks.
sap.bc.pv.roles:OPINTADMINVIEWER
Required if the operator is a power user who needs to inspect
the administration status.
Note
The user requires an analytical privilege that grants access to the source of the SAP HANA-based measure.
Operator or line-of-business user (with restricted access)
The operator is responsible for ensuring the smooth running of the business process and takes necessary action
to resolve any bottlenecks and move the process forward.
Table 14:
Required Roles
Description
sap.opi.pv.roles::OPINTUSER
Access to tasks; enables task management in space.me.
Enabling Users to Observe a Business Scenario
Authorizations and Roles
© 2015 SAP SE or an SAP affiliate company. All rights reserved.
59
Required Roles
Description
<package_name>.gen_<scenario_name>::<custom_role_nam
e>_OPERATOR
Access to the specific scenarios and the restricted data in
space.me.
sap.bc.hwf.security::HWFEndUser
Allows the user to complete workflow tasks.
sap.bc.pv.roles:OPINTADMINVIEWER
Required if the operator is a power user who needs to inspect
the administration status.
Note
The user requires an analytical privilege that grants access to the source of the SAP HANA-based measure.
Requestor
Table 15:
Required Roles
Description
sap.opi.pv.roles::OPINTUSER
Access to space.me, which is the workspace for SAP Opera­
tional Process Intelligence.
<package_name>.gen_<scenario_name>::<scenario_name>_
REQUESTOR
Access to the specific scenarios in space.me as a requestor.
Solution Expert
Table 16:
Required Roles
Description
sap.opi.pv.roles::OPINTDEVELOPER
Access for modeling business scenarios.
60
© 2015 SAP SE or an SAP affiliate company. All rights reserved.
Enabling Users to Observe a Business Scenario
Authorizations and Roles
Required Roles
Description
MODELING
Access for working with SAP HANA studio, creating pack­
ages/calculation views/attribute views and other HANA arti­
facts. This role is required by SAP Operational Process Intelli­
gence to create or generate a business scenario.
The MODELING role grants permissions for the root package
and also grants the _SYS_BI_CP_ALL analytic privilege, which
is surplus to requirements.
Tip
We recommend that you modify the content of your cus­
tom roles by changing the package privileges. Below are
the basic privileges that need to be provided:
●
Package Privileges
○
sap.opi and sap.bc.taskmgt - Rights for the pack­
ages: REPO.READ
○
Package rights for imported objects REPO.EDIT_IMPORTED_OBJECTS, REPO.ACTI­
VATE_IMPORTED_OBJECTS, and REPO.MAIN­
TAIN_IMPORTED_PACKAGES
○
Package where you want to create objects REPO.READ, REPO.EDIT_NATIVE_OBJECTS,
REPO.ACTIVATE_NATIVE_OBJECTS, and
REPO.MAINTAIN_NATIVE_PACKAGES
●
Object Privileges
○
●
_SYS_BI with SELECT
System Privileges
○
CREATE SCENARIO
○
CREATE STRUCTURED PRIVILEGE
○
STRUCTUREDPRIVILEGE ADMIN (Optional - If
you want the solution expert to provide access to
the business scenario).
●
Analytical Privileges (Optional)
○
_SYS_BI_CP_ALL - If you want the solution expert
to view data and test the calculation views.
Enabling Users to Observe a Business Scenario
Authorizations and Roles
© 2015 SAP SE or an SAP affiliate company. All rights reserved.
61
Required Roles
Description
Grant select, execute, trigger for schema <schema_name> to
<user_name or role_name>
Grant select, execute, and trigger authorizations for the
schema where the source of your event/process context and
operational data exists. This is needed to access data from
source systems and to generate your business scenario suc­
cessfully.
Note
System creates insert and update triggers for the tables
used as operational data stores (ODS), to monitor the
state change of the table columns. Therefore, for ODS sce­
narios, the solution expert needs to have the trigger au­
thorization.
sap.hrf.role.model::HrfRuleConsumer
sap.bc.hwf.security::HWFDeveloper
Permits assigned users to run determination services based
on the rules and rule services created in the system. To enable
a user based on this role, you must grant permission for the
application schema to the user. The consumption of determi­
nation services can be done in one of the following ways:
●
REST API rule service execution
●
Simulation rule service execution
●
ODBC consumption, by running the service procedure di­
rectly.
Allows the user to model and generate workflows.
Administrator
Table 17:
Required Role
Description
sap.bc.hwf.security::HWFSuperAdmin
Grants read access to the following artifacts without restric­
tion to specific workflow templates:
●
Workflow instances
●
Workflow templates
Allows the user to set workflow templates to active or inactive,
if developer mode is disabled.
Allows the user to enable and disable the developer mode.
sap.opi.pv.roles::OPINTADMIN
62
© 2015 SAP SE or an SAP affiliate company. All rights reserved.
This includes the authorizations necessary to administrate ba­
sic SAP Operational Process Intelligence capabilities including
job scheduling and SMTP configuration.
Enabling Users to Observe a Business Scenario
Authorizations and Roles
HANA Workflow Administrator with Restricted Access
Table 18:
Required Role
Description
sap.bc.hwf.security::HWFAdmin
Allows the user to set workflows to active or inactive, if devel­
oper mode is disabled.
<package_name>.<technical_name>.v1.security::Read (gener­ Grants read access to the following artifacts restricted to the
ated role)
specific workflow template:
●
Workflow instances
●
Workflow templates
●
Workflow context
HANA Workflow Administrator with Full Access
Table 19:
Required Role
Description
sap.bc.hwf.security::HWFSuperAdmin
Grants read access to the following artifacts without restric­
tion to specific workflow templates:
●
Workflow instances
●
Workflow templates
Allows the user to set workflow templates to active or inactive,
if developer mode is disabled.
Allows the user to enable and disable the developer mode.
<package_name>.<technical_name>.v1.security::Read (gener­ Grants read access to the following artifacts restricted to the
ated role)
specific workflow template:
●
Workflow instances
●
Workflow templates
●
Workflow context
Technical User
_SYS_REPO
_SYS_REPO is a technical database user and does not correspond to a real person.
Enabling Users to Observe a Business Scenario
Authorizations and Roles
© 2015 SAP SE or an SAP affiliate company. All rights reserved.
63
Table 20:
Required Roles
Description
Grant select for schema <schema_name> to _SYS_REPO
WITH GRANT OPTION
Grant select and create any authorizations for the schema
(used by SAP Operational Process Intelligence) where the
source of your event/process context and operational data
exists. This is needed to access data from source systems and
to generate your business scenario successfully.
Note
<schema_name> is a source system schema.
Service User
Table 21:
Required Roles
Description
sap.opi.pv.roles::OPINTSERVICE
Allows the user to schedule jobs for correlation and notifica­
tions in SAP Operational Process Intelligence.
<package_name>.<technical_name>.v1.security::Job
Allows the user to schedule XS jobs for processing the started
instances of the specific workflow template. Needs to be used
to configure the generated XS job. It must be entered as a pa­
rameter during the configuration of the generated XS job.
sap.bc.taskmgt.roles::TASKMGT_SERVICE_CONNECTION
Allows the user to execute tasks.
Grant select, execute for schema <schema_name> to
<user_name or role_name>
Grant select and execute authorizations for the schema where
the source of your event/process context and operational
data exists. This is needed to access data from source sys­
tems and to execute correlation and notification jobs.
5.1
Assigning Roles to SAP Operational Process Intelligence
Users
Follow these steps to assign the necessary roles to the SAP Operational Process Intelligence users.
Prerequisites
Users are created. For more information on creating users, see the SAP HANA Administration Guide, topic
Managing SAP HANA Users.
64
© 2015 SAP SE or an SAP affiliate company. All rights reserved.
Enabling Users to Observe a Business Scenario
Authorizations and Roles
Procedure
1. In the SAP HANA Systems view, select the required system.
2. Under the system, choose Security/Users.
3. Select the user ID to which you want to assign a role.
4. From the context menu of the selected user ID, choose Open.
5. On the Granted Roles tab, choose the + icon.
6. Select the required role.
7. Choose OK.
8. Repeat steps 5 through 7 to add more roles.
Note
For service users and users running background jobs, the password expires according to the specified
expiration date. When this happens, jobs will fail. To avoid this situation, disable the password lifetime by
using the command, ALTER USER <user_name> DISABLE PASSWORD LIFETIME.
Enabling Users to Observe a Business Scenario
Authorizations and Roles
© 2015 SAP SE or an SAP affiliate company. All rights reserved.
65
6
Releasing the Scenario Lock
You use this procedure to unlock a scenario manually when system locks the scenario due to errors.
Context
The system locks the scenario during generation if one of the following occurs:
● Multiple users try to generate the scenario at the same time
● Background job for correlation is running
In general, the system releases the lock automatically after some time. However, you can unlock it manually, if
required.
Procedure
1. Launch the SAP HANA studio.
2. Open the SQL editor that is connected to the server where the scenario exists.
3. Run the following script.
deletefrom "SYS_PROCESS_VISIBILITY" . "sap.opi.pv::SPVR_SCENARIO_DEFINITION_LOCK"where
"SCENARIO_DEFINITION_ID"in (
select "SCENARIO_DEF_ID"from "SYS_PROCESS_VISIBILITY" . "sap.opi.pv::SPVD_SCENARIO_METADATA"
t1 join "SYS_PROCESS_VISIBILITY" . "sap.opi.pv::SPVR_SCENARIO_DEFINITION_LOCK" t2 on
t1.SCENARIO_DEF_ID = t2.SCENARIO_DEFINITION_ID
where t1. "SCENARIO_NAME" = '<package name.scenario name>'groupby "SCENARIO_DEF_ID" )
66
© 2015 SAP SE or an SAP affiliate company. All rights reserved.
Enabling Users to Observe a Business Scenario
Releasing the Scenario Lock
7
Translating Scenario Custom Texts
SAP Operational Process Intelligence enables you to translate the custom texts you add to your scenario, so that
business users can see the texts in their required language in space.me. Custom texts are the texts that you add
explicitly, for example, measure names or descriptions of indicators. Task templates, checklists, and notifications
can also be translated.
Context
When you generate the business scenario for the first time, a custom_messages.hdbtextbundle file is created in
the gen_<scenario_name> folder. This file contains translatable texts for objects such as measures, indicators,
attributes, navigation action labels, and so on in the business scenario in the following format: <object
type>.<object id>.<property name> = <human readable texts>. Here are some examples:
● BusinessScenario.SCNf45c7ad3d42a4d1b936e200e2a5185a6.name=Order Fulfillment
● TaskTemplate.11bfb5b74697491092afd975acad3c6a.Subject=Verify Shipping Address
All texts and messages that you have created are stored in this file. To translate these texts, proceed as follows:
Procedure
1. Navigate to the location where you have installed HDB client.
2. Open the <hdb client path>/rtt/rtt.properties file and enter the necessary details of the SAP
HANA system and the ABAP translation system.
3. Open the command prompt.
4. Execute the command hdbuserstore SET <KEY> <HOST>:3<INSTANCE NUMBER>15 USER PASSWORD.
○ KEY is a unique three-letter word to identify the server.
○ HOST is the IP address of the server.
○ INSTANCE NUMBER is the instance number of the HANA server.
○ USER / PASSWORD are server credentials.
5. Create a regi workspace for the HANA server by using the command regi create workspace
<workspace name> --key= <KEY>.
6. Change the directory to the new created workspace.
7. Execute the command regi track <package name>.gen_<scenario name>.
8. Execute the command regi checkout.
9. Upload the file to the translation system by using the command rtt –e -p <package
name>.<gen_<scenario name>>*.
The system translates the file and creates an XLIFF file.
10. Download the translated file to the SAP HANA system by using the command rtt –i -p <package
name>.<gen_<scenario name>>*.
Enabling Users to Observe a Business Scenario
Translating Scenario Custom Texts
© 2015 SAP SE or an SAP affiliate company. All rights reserved.
67
The system imports the translated content into the _SYS_REPO.ACTIVE_CONTENT_TEXT_CONTENT table.
Note
To have all space.me texts translated into the required language, you have to also translate the static user
interface space.me texts (labels, titles, tooltips, and so on). These are stored in
sap.opi.pv.workspace.i18n
68
SAP HANA Repository
messages.hdbtextbundle .
© 2015 SAP SE or an SAP affiliate company. All rights reserved.
Enabling Users to Observe a Business Scenario
Translating Scenario Custom Texts
8
Transporting Business Scenario Project
You use this procedure to transport business scenario project from one system (source) to another system
(target).
Prerequisites
You have dropped the context tables in the target system (in case of retransport) if the latest generation of the
business scenario resulted in incompatible context tables.
Procedure
1. Log on to the source system.
2. Perform the following substeps in the source system:
a. a. Create a delivery unit for the package that contains the business scenario project.
For more information, see the Creating a Delivery Unit topic on SAP Help Portal at
help.sap.com/hana_appliance
http://
SAP HANA Developer Guide .
b. Export the delivery unit to the local file system.
For more information, see the Exporting a Delivery Unit topic on SAP Help Portal at
help.sap.com/hana_appliance
http://
SAP HANA Developer Guide .
3. Log on to the target system.
4. Perform the following substeps in the target system:
a. Map the authoring schema to the SAP Landscape Transformation (SLT)-replicated physical schema.
For more information, see the Mapping the Authoring Schema to the Physical Schema topic on SAP Help
Portal at
http://help.sap.com/hana_appliance
SAP HANA Modeling Guide .
b. Import the delivery unit from the local file system.
For more information, see the Importing a Delivery Unit topic on SAP Help Portal at
help.sap.com/hana_appliance
http://
SAP HANA Modeling Guide .
c. For each of the scenarios in the business scenario project, execute the SPVR_<SCENARIO NAME>_META
procedure that is in the gen package of the scenario.
d. For POB and BWF systems, update the client of the target back-end system used in the
SPVD_SYSTEM_REFERENCE table under the gen package of the scenario.
Enabling Users to Observe a Business Scenario
Transporting Business Scenario Project
© 2015 SAP SE or an SAP affiliate company. All rights reserved.
69
9
HANA Workflow
HANA workflow is a component of SAP Operational Process Intelligence. It is a workflow solution for SAP HANAnative applications and is seamlessly integrated into the SAP HANA development model.
HANA workflow transforms a workflow definition into appropriate SAP HANA artifacts leveraging the existing set
of available engines in SAP HANA. For modeling workflows in the SAP HANA studio, a subset of BPMN (Business
Process Modeling and Notation) artifacts is provided.
Related Information
Using the BPMN Standard [page 71]
Creating HANA Workflows [page 82]
70
© 2015 SAP SE or an SAP affiliate company. All rights reserved.
Enabling Users to Observe a Business Scenario
HANA Workflow
9.1
Integration in Business Scenarios
HANA workflows can be executed as appropriate actions in business situations or to handle business scenario
instances.
For example, you can use HANA workflows to describe solutions for critical situations. You can also describe
steps that often need to be performed at instance level, for example, a specific approval. To integrate the defined
HANA workflow into the business scenario, you enter a URI that starts the HANA workflow as an action URI for a
business situation or as a target URI for a navigation action.
For more information on how to integrate a HANA workflow and its functions in your application coding, see HANA
Workflow APIs [page 79].
Related Information
Actions [page 45]
Business Situations [page 48]
9.2
Using the BPMN Standard
SAP HANA studio provides BPMN (Business Process Modeling Notation)-based modeling capabilities for creating
workflows.
BPMN is a standardized graphical notation for drawing the steps of a workflow. It is based on the specification
adopted by OMG (Object Management Group) and has become more and more established for modeling
processes. This notation allows easy and intuitive workflow modeling. For more information about BPMN, see
http://www.bpmn.org .
The following subset of BPMN artifacts is provided for modeling HANA workflows:
● Events [page 72] (start and end event)
● Gateways [page 73] (exclusive and parallel gateway)
● Tasks [page 74] (service and user task)
● Sequence Flow [page 75]
● Data Context and Data Flow [page 75] (data input, data output, data object)
● Mapping [page 76] (input and output mapping)
Enabling Users to Observe a Business Scenario
HANA Workflow
© 2015 SAP SE or an SAP affiliate company. All rights reserved.
71
9.2.1
Events
An event is a flow object that indicates that something happens in the course of the workflow. It affects the
workflow and has a cause or an impact.
Overview
Depending on their place in the workflow, the event types available in SAP HANA studio are one of the following:
● Start event
● End event
Start Event
You use start events to indicate where a workflow starts. Start events do not have any incoming sequence flows.
Each HANA workflow has one start event.
End Event
You use end events to indicate where the workflow ends. End events do not have any outgoing sequence flows.
Generated Artifacts
For start and end events, several artifacts (public as well as internal) are generated, such as JavaScript and SQL
artifacts. Do not change these generated artifacts because all changes will be lost when the workflow is generated.
Related Information
Modeling the Sequence Flow [page 87]
72
© 2015 SAP SE or an SAP affiliate company. All rights reserved.
Enabling Users to Observe a Business Scenario
HANA Workflow
9.2.2
Gateways
You can create two different kinds of gateways within a HANA workflow.
Exclusive Gateway
You can use an exclusive gateway to create alternative paths within a workflow. The exclusive choice gateway
controls the sequence flow between tasks. It is comparable to asking a question at that particular point of the
workflow. The question has a defined set of alternative answers, the gates. You define a condition for each gate,
based on a Boolean expression. The expressions use the values of the workflow context data to determine which
path has to be taken. Each gate has an outgoing sequence flow.
If the expression of a gate is verified, the corresponding outgoing sequence flow will be executed. You must define
one default gate. Its outgoing sequence flow will be executed if the verification of all other gates fails.
Parallel Gateway
You can use a parallel gateway to represent two concurrent paths within a workflow. You can split a path into
parallel paths and join parallel paths. A parallel gateway makes it possible to perform multiple activities
simultaneously. The sequence flow splits into two parallel paths. The split gateway explicitly states that all paths
must be followed and a join gateway explicitly requires that all paths are completed before the process can
continue. A parallel gateway creates parallel paths without checking any conditions. If there are multiple incoming
flows, the parallel gateway waits for all incoming flows before triggering the flow through its outgoing sequence
flows. If there is just one incoming sequence flow, it is executed immediately.
Note
Parallel gateways can be combined with exclusive gateways, but this can lead to logical deadlocks. For
example, see the deadlock in the figure below, where the workflow instance will never reach the end event:
Therefore, the parallel gateway should be used carefully. We generally recommend using parallel gateways in
pairs: a splitting parallel gateway and a joining parallel gateway.
Enabling Users to Observe a Business Scenario
HANA Workflow
© 2015 SAP SE or an SAP affiliate company. All rights reserved.
73
Generated Artifacts
An SQL procedure is generated for gateways. Do not change these generated artifacts, since all changes will be
lost when the workflow is generated.
Related Information
Modeling the Sequence Flow [page 87]
Modeling Gateways [page 91]
9.2.3
Tasks
A task is an activity within a HANA workflow.
HANA workflow provides two types of tasks:
● Service tasks
● User tasks
Service Tasks
A service task is a task that uses a service to execute the business logic automatically, without any user
interaction. In HANA workflow, the business logic a service task needs to execute is encapsulated in HANA
procedures.
Note
Scalar and table types are allowed as types of parameters for tasks. You can select the scalar types that are
supported from a dropdown list. The allowed table types are validated while you are selecting them.
Note
An incompatible change to the procedure or a change of the type can cause activation issues and could break
the workflow.
User Tasks
A user task is a task that is performed by a human. In HANA workflow, HANA task management is integrated. For
more information about HANA task management, see the Working with space.me guide at section Using
Checklists and Tasks to Achieve Specific Goals.
74
© 2015 SAP SE or an SAP affiliate company. All rights reserved.
Enabling Users to Observe a Business Scenario
HANA Workflow
Related Information
Mapping [page 76]
Modeling Service Tasks [page 88]
Modeling User Tasks [page 89]
Modeling the Sequence Flow [page 87]
9.2.4
Sequence Flow
A sequence flow connects flow objects such as events, tasks, and gateways. It defines the order in which the flow
objects are performed in the workflow.
Each sequence flow connection has only one source and only one target. Depending on its source object, a
sequence flow can have a conditional expression attribute. The conditions are associated with an exclusive choice
gateway. The condition expression must be evaluated before the next flow object can be executed.
Related Information
Modeling the Sequence Flow [page 87]
Gateways [page 73]
Events [page 72]
Tasks [page 74]
9.2.5
Data Context and Data Flow
In a workflow, data is changed and transported by events and tasks. This data is stored in the process context.
Data flow is an essential aspect of every process automation solution.
You need to define the input and output of your workflow model, which is like the interface to the outside world. In
addition, you need to define the mappings between flow objects such as tasks.
The workflow context consists of several data items: data input, data output, and data object. The name of these
elements must be unique within a workflow definition.
Data Input
To define input parameters for your workflow, you can use the data input element. Data inputs have 0..n outgoing
edges. For service tasks, you can map a data input element to input parameters of a task.
Enabling Users to Observe a Business Scenario
HANA Workflow
© 2015 SAP SE or an SAP affiliate company. All rights reserved.
75
Data Output
To define output parameters for your workflow, you can use the data output element. Data outputs have 0..n
incoming edges. For service tasks, you can map an output parameter of a task to a data output parameter.
Data Object
You can model the data flow in your workflow with data object elements. These are alive for the whole lifetime of
the workflow and store context data. In the input as well as the output mapping of service tasks, you can use them
to map the output of previous tasks to the input of the next tasks.
Generated Artifacts
The workflow context is automatically saved by the HANA workflow. Two kinds of tables are generated, one for
the data items of scalar type and one for every data item of table type.
Related Information
Tasks [page 74]
Mapping [page 76]
Modeling the Data Flow [page 92]
9.2.6
Mapping
In a process, data is changed and transported by service and user tasks. To track the data changes, you need to
define the input and output mappings for the tasks.
In the task's properties, you can define the mapping by using drag and drop or by using the toolbar to create data
objects or data input and data output elements.
Note
Mappings are supported for scalar and table types.
Automated multi-mappings are also supported; this is done by dragging the root nodes. Multi-mappings can be
created for elements that have matching names and compatible types. Type compatibility is strict; different types
cannot be mapped together.
76
© 2015 SAP SE or an SAP affiliate company. All rights reserved.
Enabling Users to Observe a Business Scenario
HANA Workflow
Move Corresponding
Currently, mapping by move corresponding is supported. This means that you can only map a context element
and a service parameter if they are of the same type, including additional attributes. Regarding the length, you can
map from a smaller to a larger element or parameter, but not the other way round. The following table shows
some examples:
Table 22:
Source
Target
Mappable?
INTEGER
INTEGER
Yes
INTEGER
BIGINT
No
VARCHAR(30)
VARCHAR(30)
Yes
VARCHAR(30)
VARCHAR(50)
Yes
VARCHAR(50)
VARCHAR(30)
No
VARCHAR(30)
NVARCHAR(30)
No
Input Mapping
In the input mapping, you define the data mapping from the workflow context to the input and inoutput
parameters of the SQL procedures. You can define the mapping either by dragging and dropping from the
workflow context to the target, or by using the toolbar to create either a data object or a data input.
The following figure shows an example of an input mapping:
Output Mapping
In the output mapping, you define the mapping from the output and inoutput parameters of the SQL procedure to
the workflow context. You can define the mapping either by dragging and dropping from the source to the
workflow context, or by using the toolbar to create either a data object or a data output.
Enabling Users to Observe a Business Scenario
HANA Workflow
© 2015 SAP SE or an SAP affiliate company. All rights reserved.
77
Note
An output mapping overwrites the value of a context element.
The following figure shows an example of an output mapping:
Data Association
Input or output mappings can be expressed and visualized with data associations. Data associations have no
semantics for workflow executions in a HANA workflow, but can be used to visually enhance models for better
understanding. Multiple data associations, however, make the workflow model unusable. so you can show or hide
data associations on different levels: in the workflow editor toolbar with a toggle button, for specific modeling
elements with a speed button, and for tasks.
Mapping Refresh
There is a mapping refresh feature for service tasks. The parameters of the selected service are stored in the
HANA workflow model and are read from there. A change to the parameters of the service is not automatically
reflected in the mapping. If a new procedure is selected, the mapping is re-evaluated and any defined mappings
that are not supported will be shown as invalid. You can trigger this evaluation manually by using the refresh
toolbar function.
Note
The mapping is shown as invalid to allow you to decide whether the parameter list of the service needs to be
restored or the mapping needs to be adapted.
78
© 2015 SAP SE or an SAP affiliate company. All rights reserved.
Enabling Users to Observe a Business Scenario
HANA Workflow
9.3
HANA Workflow APIs
The HANA workflow API allows an easy and tight integration of HANA workflows with an application.
The integration of HANA workflows with the application provides a programmatic interaction with the workflow,
the rendering of workflow data within an application user interface, and the association of application data with
workflow data. You can easily call a HANA workflow and its functionalities from your application coding. The users
of the application perceive HANA workflows as part of the application.
HANA workflow provides two different APIs:
● XSJS-based API:
This API is used to start new instances of a HANA workflow and to retrieve the current state and result of a
workflow.
For more information, see XSJS-Based APIs [page 79].
● SQL-based API:
This API includes a generic API shipped with HANA workflow as well as a generated API.
For more information, see SQL-Based APIs [page 80].
9.3.1
XSJS-Based APIs
The XSJS-based API includes the following classes and methods to start workflow instances and retrieve the
current state and result of a workflow:
● Class: PublicApi
○ startWorkflow(): returns WorkflowInstance
○ getWorkflowById(): returns WorkflowInstance
○ getPackage()
○ getName()
● Class: WorkflowInstance
○ isRunning()
○ getResult()
○ getId()
Example
Creating a new workflow of a workflow template.
To start a new workflow, the generated role <package_of_workflow>.security.Start is required.
var workflowAPI = $.import("<package_of_workflow>.api","PublicApi");
var processStartParams = ...;
var executionContext = new workflowAPI.ExecutionContext({
connection: $.db.getConnection()
});
var workflowInstance = workflowAPI.startWorkflow({
data: processStartParams,
executionContext: executionContext
});
Enabling Users to Observe a Business Scenario
HANA Workflow
© 2015 SAP SE or an SAP affiliate company. All rights reserved.
79
Example
Reading the current status of a workflow.
To read the current status of a workflow, the generated role <package_of_workflow>.security.Read is
required.
var workflowAPI = $.import("<package_of_workflow>.api","PublicApi");
var workflowId = ...;
var executionContext = new workflowAPI.ExecutionContext({
connection: $.db.getConnection()
});
var workflowInstance = workflowAPI.getWorkflowById({
workflowId: workflowId,
executionContext: executionContext
});
var isRunning = workflowInstance.isRunning();
Related Information
HANA Workflow APIs [page 79]
SQL-Based APIs [page 80]
9.3.2
SQL-Based APIs
For efficient data retrieval and transformation, you can access the HANA workflow API, in most cases at SQL level.
Table 23: Data Retrieval (Generated)
Calculation View
Description
Example
<workflow_package>.Scalar
Access to scalar type data objects (one
column per data item)
SELECT * FROM
"_SYS_BIC"."<workflow_packa
ge>/Scalar" WHERE
"WORKFLOW_ID"= 1234;
<workflow_package>.<DataObj
ect_Name>
Access to table type data objects (one
calculation view per data item)
SELECT * FROM
"_SYS_BIC"."<workflow_packa
ge>/<DataObject_name>"
WHERE "WORKFLOW_ID"= 1234;
Calculation View
Description
Example
workflow
Access to workflows
SELECT * FROM
"_SYS_BIC"."sap.bc.hwf.api/
workflow" WHERE "STATUS" =
'RUNNING';
Table 24: Data Retrieval (Shipped)
80
© 2015 SAP SE or an SAP affiliate company. All rights reserved.
Enabling Users to Observe a Business Scenario
HANA Workflow
Calculation View
Description
Example
workflowAuditLog
Access to events stored in the audit log
SELECT * FROM
"_SYS_BIC"."sap.bc.hwf.api/
workflowAuditLog" WHERE
"TECHNICAL_NAME" =
'workflow1TN' and
"VERSION_ID"='v1';
workflowTemplate
Access to metadata of the workflow
template deployed on the SAP HANA
system
SELECT * FROM
"_SYS_BIC"."sap.bc.hwf.api/
workflowTemplate";
Table 25: Workflow Template Lifecycle (Shipped)
Procedure
Description
Example
SET_TEMPLATE_TO_ACTIVE
Sets the status of a given template to ac­
tive, so that asynchronous processing of
workflows is enabled (if xs job for work­
flow template has been activated).
CALL
"SAP_HWF"."sap.bc.hwf.api::
SET_TEMPLATE_TO_ACTIVE"('wo
rkflow1TN', 'v1');
SET_TEMPLATE_TO_INACTIVE
Stops asynchronous workflow process­
ing so that new patches of a workflow
template can be deployed.
CALL
"SAP_HWF"."sap.bc.hwf.api::
SET_TEMPLATE_TO_INACTIVE"('
workflow1TN', 'v1');
Procedure
Description
Example
CANCEL_WORKFLOW
Administrative operation that cancels a
running workflow so that it will not be
processed any further. A workflow can­
not be reactivated after this;it is in a final
state.
CALL
"SAP_HWF"."sap.bc.hwf.api::
CANCEL_WORKFLOW"(1);
SUSPEND_WORKFLOW
Administrative operation that suspends
a running workflow. It will not be proc­
essed any further until it is resumed
again.
CALL
"SAP_HWF"."sap.bc.hwf.api::
SUSPEND_WORKFLOW"(1);
RESUME_WORKFLOW
Administrative operation that resumes a CALL
suspended workflow. From this point on, "SAP_HWF"."sap.bc.hwf.api::
the workflow will continue to be exe­
RESUME_WORKFLOW"(1);
cuted.
Table 26: Workflow Lifecycle (Shipped)
Table 27: Developer Mode (Shipped)
Procedure
Description
Example
DEVELOPER_MODE_ENABLE
Enables developer mode on the system,
to allow easy deployment of workflow
templates in a development environ­
ment.
CALL
"SAP_HWF"."sap.bc.hwf.api::
DEVELOPER_MODE_ENABLE";
Enabling Users to Observe a Business Scenario
HANA Workflow
© 2015 SAP SE or an SAP affiliate company. All rights reserved.
81
Procedure
Description
Example
DEVELOPER_MODE_DISABLE
Disables developer mode to prohibit de­
ployments of new workflow template
patches, which can cause server issues
in a productive environment.
CALL
"SAP_HWF"."sap.bc.hwf.api::
DEVELOPER_MODE_DISABLE";
Procedure
Description
Example
COMPLETE_TASKMGT_TASK (Only
Completes an instance of a task in a
workflow instance (represented by a
user task in the workflow model). This
procedure needs to be called from the
task execution UI in order to complete
the task and continue the corresponding
workflow instance.
CALL
"SAP_HWF"."sap.bc.hwf.api.u
sertask::COMPLETE_TASKMGT_T
ASK"(123);
Table 28: User Task Integration (Shipped)
necessary for tasks of workflow tem­
plates generated with Support Stack 04
and lower; not necessary for templates
generated with Support Stack 09 and
higher.)
Related Information
HANA Workflow APIs [page 79]
XSJS-Based APIs [page 79]
9.4
Creating HANA Workflows
To create a HANA workflow, you need to perform several steps in SAP HANA studio.
Prerequisites
● SAP Operational Process Intelligence, including the components HANA workflow and HANA task
management, is installed and configured. For more information, see the SAP Operational Process Intelligence
Installation and Upgrade Guide.
● You have configured the necessary development environment in SAP HANA studio. For more information, see
the SAP Operational Process Intelligence Installation and Upgrade Guide, in particular the section Updating
SAP HANA Studio with SAP OPInt Add-Ons.
● HANA workflow requires package privileges for the package you are developing your workflow in.
● To model HANA workflows, you need the following role: sap.bc.hwf.security::HWFDeveloper. For more
information, see the SAP Operational Process Intelligence Security Guide, in particular the section
Authorizations and Roles.
82
© 2015 SAP SE or an SAP affiliate company. All rights reserved.
Enabling Users to Observe a Business Scenario
HANA Workflow
Procedure
1. Creating a Project [page 83]
2. Creating a HANA Workflow File [page 84]
3. Modeling a HANA Workflow [page 85]
4. Activating the HANA Workflow [page 95]
5. Generating the HANA Workflow Artifacts [page 96]
6. Configuring the Generated XS Job [page 97]
9.4.1
Creating a Project
Before you start modeling a HANA workflow, you have to create a project and a workflow file. Both of these are a
type of container in which you store the different elements you use in workflow modeling.
Prerequisites
The package where you want to store your HANA workflows is available and you have the necessary package
privileges. This package privilege needs to have the following authorizations:
● REPO.READ
● REPO.EDIT_NATIVE_OBJECTS
● REPO.ACTIVATE_NATIVE_OBJECTS
● REPO.MAINTAIN_NATIVE_OBJECTS
● REPO.EDIT_IMPORTED_OBJECTS
● REPO.MAINTAIN_NATIVE_PACKAGES
● REPO.MAINTAIN_IMPORTED_OBJECTS
Context
A project contains all your artifacts in a convenient central location. Sharing the project makes the contents of the
new project available to other members of the HANA workflow development team by linking the local project to
the SAP HANA repository. In this way, you can manage object versions and synchronize changes to development
objects.
For more information about SAP HANA projects, see the SAP HANA Developer Guide at section
Getting Started
SAP HANA Projects .
Enabling Users to Observe a Business Scenario
HANA Workflow
© 2015 SAP SE or an SAP affiliate company. All rights reserved.
83
Procedure
1. In SAP HANA studio, choose
2. Choose
General
File
New
Project .
Project .
3. Enter a project name and browse to the location where you want to store your local changes. Follow the steps
in the New Project wizard.
4. In the Project Explorer, select your project, and in the context menu, choose
Team
Share Project .
5. In the Share Project wizard, select SAP HANA Repository.
6. Perform one of the following steps:
○ Select a workspace.
○ Add a new workspace.
1. Select your target system.
2. Enter a name and a location for your local workspace.
7. Select your working package in the target system.
8. Choose Finish.
Results
You have created an SAP HANA project and shared it. This SAP HANA project is visible to other team members
and is available for them to import. The next step is to create an SAP HANA file.
Related Information
Creating a HANA Workflow File [page 84]
9.4.2
Creating a HANA Workflow File
The workflow file is a model template, also called a workflow pattern. It is the same across all its instances.
Context
Once you have created and shared an SAP HANA project, you can now create a HANA workflow file in this project.
84
© 2015 SAP SE or an SAP affiliate company. All rights reserved.
Enabling Users to Observe a Business Scenario
HANA Workflow
Procedure
1. In SAP HANA studio, choose
File
New
Other
SAP HANA Operational Process Intelligence
Workflow .
2. (Optional) Browse to the shared SAP HANA project you created for your HANA workflows and enter it as
Location.
3. Enter a name for your workflow.
The workflow name is used for the .hprworkflow file that is created for your workflow file.
4. If you have activated the Use default technical name option, a technical name for your HANA workflow is
entered automatically. This technical name is quite similar to the name you entered before, but some special
characters are replaced. For example, spaces are replaced with underscores. You can deactivate this option
and enter a different technical name containing the following characters only: a-z and A-Z and 0-9 and _.
The technical name ensures that the workflow template is unique, which prevents generated artifacts from
being overwritten by other templates.
5. Enter an existing schema or a name for a new schema and choose Finish.
Results
A new file with extension .hprworkflow is created in the SAP HANA package. It is automatically opened in the
HANA workflow editor.
You can now start modeling your workflow using the palette containing BPMN elements or the speed buttons.
Related Information
Modeling the Sequence Flow [page 87]
Accelerated Modeling with Speed Buttons [page 86]
9.4.3
Modeling a HANA Workflow
For modeling workflows in SAP HANA studio, a subset of BPMN (Business Process Modeling and Notation)
artifacts is provided.
The workflow editor in SAP HANA studio consists of three major areas:
● Canvas
The editor canvas is used to render and model the sequence flow. The sequence flow connects flow objects
such as events, activities, and gateways, and defines the order of performance of the flow objects.
● Palette
The palette contains model elements, for example, events, tasks, and connections. You can easily model your
workflow by selecting the required model element in the palette and placing it on the canvas using drag and
drop.
Enabling Users to Observe a Business Scenario
HANA Workflow
© 2015 SAP SE or an SAP affiliate company. All rights reserved.
85
● Properties
The Properties view provides details and configuration options for your model elements. The view changes
depending on which element is currently selected on the canvas.
If it is not displayed, choose
Window
Show View
Properties
to open it.
Once you have created a shared SAP HANA project and a HANA workflow file (.hprworkflow), you can start
modeling your workflow with the workflow editor in SAP HANA studio.
Related Information
Modeling the Sequence Flow [page 87]
Accelerated Modeling with Speed Buttons [page 86]
9.4.4
Accelerated Modeling with Speed Buttons
In addition to the palette, you can use the speed buttons for quick and easy modeling.
The speed buttons are displayed around the flow objects. In the following figure you see a service task with the
speed buttons around it. The number and type of speed buttons that are displayed may vary depending on the
model element.
The following table contains all the different types of speed buttons and explains their function:
Table 29:
Speed Button
(Append Event)
(Append Gateway)
(Append Activity)
(Create Connection)
86
Description
Creates an end event and the corresponding sequence flow connection.
To create a start event, use the palette.
Creates an exclusive or parallel gateway and the corresponding sequence
flow connection.
Opens a menu and creates a user task or service task, depending on what
you select in the menu.
Creates a connection. Depending on the elements that you want to con­
nect, the appropriate connection is created. This means that flow objects
are connected with a sequence flow; data objects, data inputs, and data
outputs are connected with a data association. For data associations, the
validation logic of mappings is executed. See section Mapping [page 76].
© 2015 SAP SE or an SAP affiliate company. All rights reserved.
Enabling Users to Observe a Business Scenario
HANA Workflow
Speed Button
Description
(Change Type)
Quickly changes the type of the data object, for example, to change it into
data input or data output.
Shows or hides all data associations. Depending on the number of data
associations you have in your model, you can improve the visibility.
(Show/Hide Data Associations)
Removes the corresponding flow object or data item with its connections.
(Remove Item)
Caution
When you choose the waste bin speed button, the corresponding flow
object or data item is removed immediately without a request for con­
firmation.
9.4.5
Modeling the Sequence Flow
You create sequence flows to connect flow objects in the workflow and to define their order of performance in the
workflow.
Context
You can model the sequence flow using the palette and/or the speed buttons in the workflow editor that is
embedded in SAP HANA studio.
Procedure
1. To model the start of a workflow, select the start event from the palette and drag and drop it onto the canvas.
2. You can now create another flow element, for example, a service task, by either using the speed buttons
around the start event or the palette.
○ If you create the next flow element using the corresponding speed button, the connection of type:
sequence flow is automatically set.
○ If you create the next flow element using the palette, you need to connect them in a separate step.
3. To connect two flow elements, perform one of the following steps:
○ From the flow element that needs to be performed first, choose the corresponding speed button, keep
the mouse button pressed and move your cursor to the next flow element that needs to be performed in
the workflow.
○ From the palette, choose the sequence flow. Then, on the canvas, select the flow element that needs to be
performed first and then the flow element that needs to be performed next.
4. To model the end of a workflow, select the end event from the palette and drag and drop it onto the canvas.
You can also use the speed buttons.
Enabling Users to Observe a Business Scenario
HANA Workflow
© 2015 SAP SE or an SAP affiliate company. All rights reserved.
87
Results
You have now defined the order of the process steps. The details of the process steps and the data flow are
defined later.
Related Information
Modeling User Tasks [page 89]
Modeling Service Tasks [page 88]
Modeling Gateways [page 91]
Modeling the Data Flow [page 92]
9.4.6
Modeling Service Tasks
Procedures that need to be performed in your workflow are encapsulated within service tasks.
Prerequisites
You have opened the workflow in the workflow editor in SAP HANA studio.
Context
Service tasks can also be used as an integration point of HANA workflows with SAP HANA rules framework, which
is a component available with SAP Operational Process Intelligence. For more information, see the latest SAP
HANA Rules Framework Modeling Guide on SAP Service Marketplace .
The following steps explain how to create a service task without modeling the data flow within this task. The input
and output mapping will be done later, when modeling the data flow of the HANA workflow.
Procedure
1. Expand Tasks from the palette.
2. Choose the Service Task from the dropdown menu, and click the modeling surface. The service task appears
in the place where you clicked.
3. Connect the service task with other flow objects.
4. In the service task's Properties, choose Service and then Select to assign the procedure that will be called as
part of the service task.
88
© 2015 SAP SE or an SAP affiliate company. All rights reserved.
Enabling Users to Observe a Business Scenario
HANA Workflow
If the Properties window is not displayed, choose
Window
Show View
Properties
to open it.
5. Enter the name of the procedure.
If you enter two adjacent letters of the procedure you want to select, a list of all available SAP HANA
procedures and objects with these two letters in their name is displayed. You can then select the procedure in
the list without knowing the exact name, and confirm with OK.
The name of the service task is automatically changed on the canvas, and now reflects the name of the
configured SAP HANA procedure.
6. (Optional) If you want to use a different name for the service task, for example, a simpler or shorter name,
choose Description and specify a name for the service task in the Name field.
7. (Optional) Enter a description for the service task in the Documentation field.
8. To make this task work, you need to model the data flow.
Related Information
Modeling the Data Flow [page 92]
Tasks [page 74]
Mapping [page 76]
9.4.7
Modeling User Tasks
In addition to service tasks, HANA workflow provides user tasks to represent activities that are performed by
humans.
Sequence Flow of a User Task
When you create a human-based workflow, you define input parameters as properties, which you find in SAP
HANA studio on the Properties tab page of the user task.
You can specify a subject and a description of the task. These texts are translatable and are defined as properties.
While a subject is mandatory for a user task, a description is optional.
You can use parameters in both texts by putting the name into angle brackets (<>). Whenever a workflow reaches
this user task step, the parameters will be replaced by real values for the new task. Autocompletion is available;
choose Ctrl + Spacebar to display a list of parameters.
The task UI field specifies information about the UI that will be used by the end user at runtime when working on
tasks of this type.
It is possible to define a list of users that should be added as participants of the user task. This can be done either
statically, using a fixed list of SAP HANA user names, or dynamically, by referencing a data object or data input
element in the workflow.
Enabling Users to Observe a Business Scenario
HANA Workflow
© 2015 SAP SE or an SAP affiliate company. All rights reserved.
89
Note
You can use only data objects or data inputs based on the SAP HANA table type
SAP_HWF.sap.bc.hwf.api.usertask::TASKMGT_TASK_PARTICIPANT can be used.
It is often necessary from a business perspective to have a decision for each user task. This enables you to control
the sequence flow in the workflow according to the result of the user task. A task decision includes a technical key,
which is provided in the output mapping of the user task when the task is completed, as well as a translatable text
that can be rendered in the task UI.
Output mapping shows the data that will be received in the workflow once the user task is completed. Upon
completion, the following information will be returned and can be mapped to workflow context objects:
● TASK_ID (of type BIGINT) - The ID of the user task that is completed.
● DECISION (of type NVARCHAR32) - If a decision is modeled for the user task, the task can only be completed
with one of the modeled decisions. In this case, the decision that is used for task completion can be used to
model different workflow behaviors based on the decision taken. (Optional)
● COMPLETEDBY (of type NVARCHAR256) - The user who completed the user task.
● COMPLETEDAT (of type TIMESTAMP) - Timestamp when the user task was completed.
The figure below shows a workflow model of the sequence flow:
Note
The sequence flow of user tasks that have been modeled using the SAP HANA workflow modeler 1.4 is
completely different. There is no automatic migration to the sequence flow of 1.9 since there are different
concepts and a different feature set. If you are working with user tasks created with version 1.4, the old UI will
be shown. In releases higher than 1.4, only the sequence flow described above will be used for newly created
user tasks.
Translation of User Tasks
To be able to localize the user task in the correct language and region (LOCALE), text bundles (with the file
extension hdbtextbundle.) are used, which contain the subject and description of each user task in a workflow
90
© 2015 SAP SE or an SAP affiliate company. All rights reserved.
Enabling Users to Observe a Business Scenario
HANA Workflow
template. This file is generated in addition to the other generated content. Once this SAP HANA repository artifact
is activated, the content will be transferred to an internal table predelivered by SAP HANA. You need to export the
developer language, translate it into the desired language, and import the translated files again. This procedure is
similar to the procedure explained in section Translating Scenario Custom Texts [page 67]. The translated files
are stored in
SAP HANA Repository
<workflow package name>.i18n
texts.hdbtextbundle .
Related Information
HANA Workflow APIs [page 79]
Modeling the Data Flow [page 92]
Modeling Service Tasks [page 88]
9.4.8
Modeling Gateways
You can create gateways to indicate that a decision must be made, or that the workflow must be split. For
exclusive gateways, this depends on the given conditions.
Prerequisites
You have opened the workflow in the workflow editor in SAP HANA studio.
Procedure
1. Expand Gateways from the palette.
2. Choose Exclusive Gateway or Parallel Gateway from the dropdown menu, and click the modeling surface. The
gateway appears in the place where you clicked.
3. Connect the gateway with other flow objects.
For exclusive gateways, an entry is created in the properties for each outgoing sequence flow. To open the
Properties window, choose
Window
Show View
(Other...)
(General)
Properties .
4. Define the conditions for each outgoing sequence flow of an exclusive gateway:
a. To edit a sequence flow, select it in the Properties of the gateway and choose Edit, or select the sequence
flow on the canvas and then go to the sequence flow's Properties.
b. In the Sequence Flow Details (in the gateway properties) or in the Attributes (in the sequence flow
properties), enter a name for the sequence flow, for example, Approved.
c. To add a condition, choose Add Condition and then choose Edit to enter an expression.
The Expression Editor opens. In the Expression Editor the available parameters and operators are listed
and can be selected.
d. Once you have entered an expression as a condition, choose Validate to check whether the expression is
valid.
Enabling Users to Observe a Business Scenario
HANA Workflow
© 2015 SAP SE or an SAP affiliate company. All rights reserved.
91
5. Repeat the steps for the other sequence flows of the exclusive gateway, and set one sequence flow as the
default by activating the Default Flow for Exclusive Gateway "<Gateway Name>" option. The default sequence
flow will be executed if the verification of all other gates fails.
Related Information
Gateways [page 73]
Modeling the Data Flow [page 92]
9.4.9
Modeling the Data Flow
You can think of the data flow as the interface to the outside world.
A workflow usually involves some passing of data. For example, a service task needs input parameters, which are
the results of a different task. The service task then provides its own results as output parameters, which are
needed for the execution of another task. Therefore, you need to define the data input and data output as well as
the mapping between the different flow objects. Data input and data output are a workflow's interface to others.
You use data objects to handle the context internally.
Prerequisites
● You have modeled the sequence flow.
● You have assigned the HANA procedures to the tasks, if there are any in your workflow.
Supported HANA Workflow Data Types
Data types in HANA workflow are primarily based on SQL data types supported by SAP HANA. They are used in
procedure signatures for tasks, and in data input, data output, and data objects, based on scalar or table types.
The following list provides all the data types that are currently supported by HANA workflow during design time
and runtime:
● INTEGER
● NVARCHAR
● DECIMAL
● BIGINT
● CHAR
● DATE
● DOUBLE
● REAL
92
© 2015 SAP SE or an SAP affiliate company. All rights reserved.
Enabling Users to Observe a Business Scenario
HANA Workflow
● SMALLINT
● TIME
● TIMESTAMP
● NVARCHAR
● TINYINT
● VARCHAR
Modeling Data Input
For input data in your workflow, you create a Data Input element. You have various options: You can use the
palette or the corresponding icon in the Properties view of the task.
Creating Data Input Elements with the Palette
1. Expand Data Items from the palette.
2. Choose Data Input from the dropdown menu, and click the modeling surface. The data input element appears
in the place where you clicked.
3. (Optional) Enter a name for the input element.
4. Select the data type of the input element.
○ Table Type
Choose Browse and select the table type in the catalog.
If you enter two adjacent letters of the table type you want to select, a list of all available table types with
these two letters in their name is displayed. You can then select the table type in the list without knowing
the exact name, and confirm with OK. If you select a table type that is not supported, you will get an
appropriate message.
○ Scalar type
Select the data type from the dropdown list, which contains all supported scalar data types. Depending on
the selected scalar type, you have to maintain additional properties, for example, length for character
liked types.
5. To add a data association between the data input element and a flow element, expand Connectors from the
palette, and choose Data Association.
6. Click the data input element and then the flow element. A data association is created from the data input
element to the flow element.
Creating Data Input Elements from the Properties View
1. In the Properties view of a task, choose Input Mapping.
2. Under Target, select an item and choose
(Create new data input).
A data input element with the name and the data type of the target item is created and displayed on the
canvas.
3. (Optional) You can change the name by selecting the data input element on the canvas and then changing the
settings in its Properties view.
4. (Optional) To display the data associations on the canvas, select the mapping of two elements and choose the
(Hide/Show Data Associations) toggle button in the Input Mapping in the Properties view.
Note
The input mapping is created automatically.
Enabling Users to Observe a Business Scenario
HANA Workflow
© 2015 SAP SE or an SAP affiliate company. All rights reserved.
93
Modeling Data Output
For data output in your workflow, you create a Data Output element. Just like data input elements, you can also
create data output elements using the palette or the corresponding icon in the Properties view of the task.
Creating Data Output Elements with the Palette
1. Expand Data Items from the palette.
2. Choose Data Output from the dropdown menu, and click the modeling surface. The data output element
appears in the place where you clicked.
3. (Optional) Enter a name for the output element.
4. Select the data type of the output element.
5. To add a data association between the data output element and a flow element, expand Connectors from the
palette, and choose Data Association.
6. Click the flow element and then the data output element. A data association is created from the flow object to
the output element.
Creating Data Output Elements from the Properties View
1. In the Properties view of a task, choose Output Mapping.
2. Under Source, select an item and choose
(Create new data output).
A data input element with the name and the data type of the target item is created and displayed on the
canvas.
3. (Optional) You can change the name by selecting the data output element on the canvas and then changing
the settings in its Properties view.
4. (Optional) To display the data associations on the canvas, select the mapping of two elements and choose the
(Hide/Show Data Association) toggle button in the Input Mapping in the Properties view.
Note
The output mapping is created automatically.
Modeling Data Objects
For example, you have modeled an approval workflow. A service task determines the input parameters for the
approval step, which is a user task. The service task writes the parameters in the workflow context; this means
that there is an output mapping where the parameters provided by the service task are mapped to the parameters
in the workflow context. These parameters are then mapped from the workflow context to the user task
parameters. Data objects can be used in the subject of a user task, for example.
Creating Data Objects with the Palette
1. Expand Data Items from the palette.
2. Choose Data Object from the dropdown menu, and click the modeling surface. The data object appears in the
place where you clicked.
3. (Optional) Enter a name for the data object.
4. Select the data type of the data object.
94
© 2015 SAP SE or an SAP affiliate company. All rights reserved.
Enabling Users to Observe a Business Scenario
HANA Workflow
5. To add a data association between the data output element and a flow element, expand Connectors from the
palette, and choose Data Association.
6. If the parameter that is represented by the data object is an input parameter for a flow element, click the data
object and then the flow element. A data association is created from the data object to the flow object.
7. If the parameter that is represented by the data object is an output parameter of a flow element, click the flow
element and then the data object. A data association is created from the flow element to the data object.
Creating Data Objects from the Properties View
1. In the Properties view of a task, in the Input Mapping or Output Mapping, select an item and choose
(Create new data object).
A data object with the name and the data type of the selected item is created and displayed on the canvas.
2. (Optional) You can change the name by selecting the data object on the canvas and then changing the
settings in its Properties view.
Related Information
Data Context and Data Flow [page 75]
Mapping [page 76]
Modeling Service Tasks [page 88]
Modeling User Tasks [page 89]
9.4.10 Activating the HANA Workflow
Before you can generate the runtime artifacts of the workflow, you need to commit and activate the HANA
workflow file to the SAP HANA repository via the team provider.
Context
HANA workflow files (with .hprworkflow extension) are validated on activation by the SAP HANA repository.
Procedure
1. In the Project Explorer, select the HANA workflow file.
To open the Project Explorer, choose
Window
Show View
Other
General
2. In the context menu of the HANA workflow file, choose
Team
Commit
.
3. In the context menu of the HANA workflow file, choose
Team
Activate
.
Enabling Users to Observe a Business Scenario
HANA Workflow
Project Explorer .
© 2015 SAP SE or an SAP affiliate company. All rights reserved.
95
Results
The HANA workflow is activated and you can now generate the runtime artifacts to run the HANA workflow.
Related Information
Generating the HANA Workflow Artifacts [page 96]
Modeling a HANA Workflow [page 85]
9.4.11 Generating the HANA Workflow Artifacts
The generation of a HANA workflow creates a set of new artifacts in the package of the .hprworkflow file.
Procedure
1. In SAP HANA studio, in the Project Explorer, select the HANA workflow (.hprworkflow file).
2. In the context menu of the HANA workflow file, choose HANA Workflow Generate .
In the Job Log view, you get either a success or an error message. For details, double-click the entry in the Job
Log view. To open the Job Log view, choose
Window
Show View
(Other)
(General)
Job Log .
Results
The generation creates a set of new artifacts in the package of the .hprworkflow file. To display the artifacts, in
the Package Explorer, refresh the corresponding package folder.
96
© 2015 SAP SE or an SAP affiliate company. All rights reserved.
Enabling Users to Observe a Business Scenario
HANA Workflow
9.4.12 Configuring the Generated XS Job
Every HANA workflow automatically generates an XS job, which needs to be configured and activated so that the
HANA workflows are executed properly.
Prerequisites
● You have been granted permission to view and modify the job scheduler values in the runtime admin tool. The
role sap.hana.xs.admin.roles::JobAdministrator needs to be assigned to your user. This role is part of the
sap.opi.pv.roles::OPINTADMIN role.
● There is an .xsapp file in the root path.
● You have created a user with the following authorizations in SAP HANA studio:
○ The Job role available in the security subpackage: /<workflow technical name>/<workflow version>/
security/Job.hdbrole.
○ All necessary analytical privileges, if required by the custom procedures that are called by the workflow.
○ All additional privileges for catalog objects for which no content objects exist.
For more information about roles and permissions, see Authorizations and Roles [page 59].
Procedure
1. Start the SAP HANA XS administration tool by using the URL http://<host>:<port>/sap/hana/xs/
admin/, where <<host>> is your SAP HANA server host, and <<port>> is 80 followed by your SAP HANA
server instance number.
2. In the navigation pane on the left, navigate to the HANA workflow package.
3. Expand the subpackage with the technical name.
4. Expand the subpackage v1.
5. In the config subpackage, choose the generated XS job.
6. Add your user credentials.
7. Choose a locale (for example: en/US).
8. Select the Active checkbox.
9. Choose Save Job.
Enabling Users to Observe a Business Scenario
HANA Workflow
© 2015 SAP SE or an SAP affiliate company. All rights reserved.
97
9.5
Building Custom Task UIs
To create HANA workflow custom task UIs, you have to perform several steps.
Prerequisites
● You have created a business scenario project in SAP HANA studio.
● In your business scenario project, you have created a HANA workflow that contains a user task.
Procedure
1. Create an SAP UI5 HTML file in any folder of the business scenario project.
2. Read the task ID of your user task from its parameters. To do so, perform var taskId =
jQuery.sap.getUriParameters().get("taskid");.
3. Read the defined task decisions (if any) using the REST-based API: Retrieve Task Details [page 99].
4. Provide actions and/or buttons for task completion using one of the REST-based APIs: Complete a Task
[page 101] or Complete a Task with Decision [page 102].
Note
If decisions are defined, one of the defined decisions has to be used to complete the task: {"decision":
"NAME"}.
Next Steps
The custom task UI URI can now be configured in the HANA workflow human task properties as a relative URI:
/<package in which the business scenario project is located>/<folder inside the business scenario project with the
task UI>/<name of the html file including file suffix>?taskid=.
Related Information
Task Management REST APIs [page 99]
98
© 2015 SAP SE or an SAP affiliate company. All rights reserved.
Enabling Users to Observe a Business Scenario
HANA Workflow
9.6
Task Management REST APIs
The task management REST-based APIs allow an easy and tight integration of tasks on SAP HANA with HANA
workflows.
Base URI: http://<server:port>/sap/bc/taskmgt/api/
Permissions: Application privilege sap.bc.taskmgt::Access exposed via role
sap.bc.taskmgt.roles:TASKMGT_CORE, and propagated in sap.opi.pv.roles::OPINTUSER.
The following methods describe how to write custom code that interacts with the tasks on this platform.
Methods
Table 30:
HTTP Method
Action
URI
GET
Retrieve Task Details [page 99]
/sap/bc/taskmgt/api/TaskCollection(<id>L)
PUT
Complete a Task [page 101]
/sap/bc/taskmgt/api/TaskCollection(<id>L)/
complete
PUT
Complete a Task with Decision [page
102]
/sap/bc/taskmgt/api/TaskCollection(<id>L)/
complete
9.6.1
Retrieve Task Details
Use this REST-based API to retrieve the details of a task.
Request
URI: /sap/bc/taskmgt/api/TaskCollection(<id>L)
HTTP Method: GET
Parameters: ID
Response
Format: JSON
Description: The response body contains the details of a task, including the list of participants and the list of any
allowed decisions.
Enabling Users to Observe a Business Scenario
HANA Workflow
© 2015 SAP SE or an SAP affiliate company. All rights reserved.
99
Response Example:
{
"TASK_ID": 156,
"SUBJECT": "Subject",
"STATUS": "CONFIRMED",
"CREATED_ON": "2015-07-10 12:35:09.8860000",
"CREATED_BY": "USER_ID",
"DESCRIPTION": "Description",
"CHANGED_ON": "2015-07-10 12:35:10.8440000",
"CHANGED_BY": "USER_ID",
"AUTOCONFIRM": 1,
"CAN_COMPLETE": 0,
"CAN_REOPEN": 0,
"CAN_CONFIRM": -1,
"EXPIRATION_DATE": null,
"PRIORITY": "MEDIUM",
"CATEGORY": "TASK",
"EXECURL": "/taskurl?taskid=",
"participants": [{,
"ASSIGNMENT_ID": 234,
"TASK_ID": 156,
"PRINCIPAL_ID": "USER_ID",
"ROLE_TYPE": "OWNER",
"FIRSTNAME": "JOHN",
"LASTNAME": "DOE",
"AVATAR": "user.jpg",
"E_MAIL": "someuser@sap.com",
"PHONE": "55-1234",
]},
"decisions": [{,
"TASK_ID": 156
"NAME": "APPROVE",
"DECISION_NAME": "Approve",
]}
}
● AUTOCONFIRM, CAN_REOPEN, CAN_CONFIRM, and EXEC_URL: not relevant for custom task UIs.
● CAN_COMPLETE: indicates whether the current user is allowed to complete a task. Depending on this property,
the completion button or buttons on any custom task UI are enabled/disabled.
● participants.PRINCIPAL_ID: defines the user ID of a participant assigned to a task.
● decision.NAME: defines the ID of a decision of a task, and the parameter to the API Complete a Task with
Decision [page 102].
● decision.DECISION_NAME: defines the text to be visible on any custom task UI for the decision of a task.
Related Information
Task Management REST APIs [page 99]
Complete a Task [page 101]
Complete a Task with Decision [page 102]
100
© 2015 SAP SE or an SAP affiliate company. All rights reserved.
Enabling Users to Observe a Business Scenario
HANA Workflow
9.6.2
Complete a Task
Use this REST-based API to complete a task.
Request
URI: /sap/bc/taskmgt/api/TaskCollection(<id>L)/complete
HTTP Method: PUT
Parameters: ID
Note
For tasks without a decision, a request body must not be specified.
Response
Format: JSON
Description: The response body contains the timestamp when the task was completed, and by whom it was
completed.
Response Example:
{
"LastChangedTime": "<value>",
"LastChangedBy": "<value>"
}
Related Information
Task Management REST APIs [page 99]
Retrieve Task Details [page 99]
Complete a Task with Decision [page 102]
Enabling Users to Observe a Business Scenario
HANA Workflow
© 2015 SAP SE or an SAP affiliate company. All rights reserved.
101
9.6.3
Complete a Task with Decision
Use this REST-based API to complete a task with a defined decision.
Request
URI: /sap/bc/taskmgt/api/TaskCollection(<id>L)/complete
HTTP Method: PUT
Parameters: ID, decision
Format: JSON
Description: The request body contains the decision.
Request Example:
{
"decision": "VALUE"
}
Note
For tasks with a defined decision, a request body is mandatory.
Response
Format: JSON
Description: The response body contains the timestamp when the task was completed, and by whom it was
completed.
Response Example:
{
"LastChangedTime": "<value>",
"LastChangedBy": "<value>"
}
Related Information
Task Management REST APIs [page 99]
Retrieve Task Details [page 99]
Complete a Task [page 101]
102
© 2015 SAP SE or an SAP affiliate company. All rights reserved.
Enabling Users to Observe a Business Scenario
HANA Workflow
9.7
Lifecycle of a HANA Workflow
A HANA workflow template passes through different phases before it can be productively used, and multiple
workflow instances of the same workflow template can be started.
Modeling
You model HANA workflow templates in SAP HANA studio once you have updated it with the SAP Operational
Process Intelligence add-ons and the HANA workflow design time is integrated. For more information, see
Updating SAP HANA Studio with SAP Operational Process Intelligence Add-Ons [page 6].
A subset of BPMN (Business Process Modeling and Notation) artifacts is provided for modeling workflows in SAP
HANA studio. For more information, see Modeling a HANA Workflow [page 85].
Activating
Once the HANA workflow model is created, you activate it. This creates a HANA workflow template. HANA
workflow files are validated on activation by the SAP HANA repository. For more information, see Activating the
HANA Workflow [page 95].
Note
Activating a HANA workflow on a specific system does not mean that this workflow is ready to be started. You
need to generate the HANA workflow first.
Generating
Generating a HANA workflow automatically creates all necessary XS and SQL artifacts in the package of
the .hprworkflow file. In addition, generating ensures that the HANA workflow is properly versioned and that
workflow instances can be started. For more information, see Generating the HANA Workflow Artifacts [page 96].
Caution
The HANA workflow can only be generated if the developer mode is enabled or the HANA workflow template is
in Inactive status. Otherwise the generation is revoked. For more information, see Configuring the Developer
Mode for HANA Workflows [page 106].
Note
Once a HANA workflow has been generated on a specific system, workflow instances can be started. To make
the HANA workflow template fully operational, you need to configure it.
Enabling Users to Observe a Business Scenario
HANA Workflow
© 2015 SAP SE or an SAP affiliate company. All rights reserved.
103
Configuring
1. Enable the HANA workflow repository integration.
For more information, see the
Configuring the SAP Operational Process Intelligence Scheduler
HANA Workflow Repository Integration
Upgrade Guide.
Enable
section in the SAP Operational Process Intelligence Installation and
2. Ensure, that the .xsapp file is in the root path.
3. Enable the XS job scheduling.
For more information, see the
Configuring SAP Operational Process IntelligenceContext
SAP Operational Process Intelligence Scheduler
Installation and Upgrade Guide.
Configuring the
section in the SAP Operational Process Intelligence
4. Configure the generated XS job.
For more information, see Configuring the Generated XS Job [page 97].
Transporting
After generating, you can export the HANA workflow as a delivery unit and transport it to another SAP HANA
system.
Once you have imported the HANA workflow delivery unit, you only need to perform the configuration steps. You
do not need to generate the HANA workflow again.
Upgrading/Patching
To upgrade a HANA workflow to a new version/patch, see section Patching a HANA Workflow [page 105].
Related Information
Configuring the Developer Mode for HANA Workflows [page 106]
Modeling the Sequence Flow [page 87]
Activating the HANA Workflow [page 95]
Generating the HANA Workflow Artifacts [page 96]
104
© 2015 SAP SE or an SAP affiliate company. All rights reserved.
Enabling Users to Observe a Business Scenario
HANA Workflow
9.7.1
Patching a HANA Workflow
You can upgrade a running HANA workflow to a new version/patch.
Prerequisites
● One of the following conditions is met:
○ The developer mode is active.
For more information about enabling and activating the developer mode, see Configuring the Developer
Mode for HANA Workflows [page 106].
○ The developer mode is not active, but the HANA workflow is in Inactive status. This means that none of
the HANA workflow instances of this HANA workflow template are being processed. For more information
about deactivating workflows, see HANA Workflow APIs [page 79].
Note
If the developer mode is not active and the HANA workflow template is not in Inactive status, the HANA
workflow instances of this workflow template are being processed. The regeneration and deployment
of the HANA DU containing different artifacts will be revoked.
● You have the sap.bc.hwf.security::HWFAdmin role and the generated role:
<package_name>.<technical_name>.v1.security::Read assigned to you.
● You have activated the workflow template-specific job and it is running successfully.
Context
You can upgrade a workflow template with a new version/patch in two ways: by deploying an SAP HANA delivery
unit containing the .hprworkflow file and all generated artifacts, or by manually changing and activating
the .hprworkflow file and generating the workflow.
Procedure
1. Set the HANA workflow template to inactive by executing the procedure SET_TEMPLATE_TO_INACTIVE. For
more information, see SQL-Based APIs [page 80].
Note
This is an asynchronous process that may take some time.
2. Do one of the following:
○ Import an SAP HANA delivery unit containing the .hprworkflow file and all generated artifacts.
○ Manually change and activate the .hprworkflow file in SAP HANA studio and then generate the
workflow.
Enabling Users to Observe a Business Scenario
HANA Workflow
© 2015 SAP SE or an SAP affiliate company. All rights reserved.
105
3. Reactivate the HANA workflow template by executing the procedure SET_TEMPLATE_TO_ACTIVE. For more
information, see SQL-Based APIs [page 80].
Related Information
Lifecycle of a HANA Workflow [page 103]
SQL-Based APIs [page 80]
9.8
Configuring the Developer Mode for HANA Workflows
The developer mode is an integral part of the HANA workflow versioning concept.
The developer mode enables developers to deliberately override existing versions of a workflow in a system. It is a
safety net mechanism that prevents accidental corruption of workflow instances by reactivation and/or
regeneration of a workflow model.
An administrator needs to explicitly switch on the developer mode, by changing the runtime configuration.
Note
● The developer mode is disabled by default.
● We do not recommend enabling the developer mode on productive systems.
● Developer mode is enabled (developer_mode = true): activation and generation is not restricted
● Developer mode is disabled (developer_mode = false): The following restrictions apply when patching existing
HANA workflows by regenerating or by deploying a delivery unit containing a HANA workflow:
○ Patching is revoked if the workflow template is not in Inactive status (HANA workflow instances of that
workflow template are still being processed).
○ Patching is allowed if the workflow template is in Inactive status (none of the HANA workflow instances of
that workflow templates are being processed).
To set HANA workflow templates to status Inactive, CALL
"SAP_HWF"."sap.bc.hwf.api::SET_TEMPLATE_TO_INACTIVE"('workflow1TN', 'v1'); with input
<_technicalName> and <_versionID>.
To set HANA workflow templates to status Active again, CALL
"SAP_HWF"."sap.bc.hwf.api::SET_TEMPLATE_TO_ACTIVE"('workflow1TN', 'v1'); with input
<_technicalName> and <_versionID>.
Note
When the developer mode is active, it is not guaranteed that running workflows continue running after
patching.
To enable the developer mode from the SQL console, CALL
"SAP_HWF"."sap.bc.hwf.api::DEVELOPER_MODE_ENABLE" ().
106
© 2015 SAP SE or an SAP affiliate company. All rights reserved.
Enabling Users to Observe a Business Scenario
HANA Workflow
To disable the developer mode from the SQL console, CALL
"SAP_HWF"."sap.bc.hwf.api::DEVELOPER_MODE_DISABLE" ().
Enabling Users to Observe a Business Scenario
HANA Workflow
© 2015 SAP SE or an SAP affiliate company. All rights reserved.
107
Important Disclaimers and Legal Information
Coding Samples
Any software coding and/or code lines / strings ("Code") included in this documentation are only examples and are not intended to be used in a productive system
environment. The Code is only intended to better explain and visualize the syntax and phrasing rules of certain coding. SAP does not warrant the correctness and
completeness of the Code given herein, and SAP shall not be liable for errors or damages caused by the usage of the Code, unless damages were caused by SAP
intentionally or by SAP's gross negligence.
Accessibility
The information contained in the SAP documentation represents SAP's current view of accessibility criteria as of the date of publication; it is in no way intended to be a
binding guideline on how to ensure accessibility of software products. SAP in particular disclaims any liability in relation to this document. This disclaimer, however, does
not apply in cases of wilful misconduct or gross negligence of SAP. Furthermore, this document does not result in any direct or indirect contractual obligations of SAP.
Gender-Neutral Language
As far as possible, SAP documentation is gender neutral. Depending on the context, the reader is addressed directly with "you", or a gender-neutral noun (such as "sales
person" or "working days") is used. If when referring to members of both sexes, however, the third-person singular cannot be avoided or a gender-neutral noun does not
exist, SAP reserves the right to use the masculine form of the noun and pronoun. This is to ensure that the documentation remains comprehensible.
Internet Hyperlinks
The SAP documentation may contain hyperlinks to the Internet. These hyperlinks are intended to serve as a hint about where to find related information. SAP does not
warrant the availability and correctness of this related information or the ability of this information to serve a particular purpose. SAP shall not be liable for any damages
caused by the use of related information unless damages have been caused by SAP's gross negligence or willful misconduct. All links are categorized for transparency
(see: http://help.sap.com/disclaimer).
108
© 2015 SAP SE or an SAP affiliate company. All rights reserved.
Enabling Users to Observe a Business Scenario
Important Disclaimers and Legal Information
Enabling Users to Observe a Business Scenario
Important Disclaimers and Legal Information
© 2015 SAP SE or an SAP affiliate company. All rights reserved.
109
www.sap.com/contactsap
© 2015 SAP SE or an SAP affiliate company. All rights reserved.
No part of this publication may be reproduced or transmitted in any
form or for any purpose without the express permission of SAP SE
or an SAP affiliate company. The information contained herein may
be changed without prior notice.
Some software products marketed by SAP SE and its distributors
contain proprietary software components of other software
vendors. National product specifications may vary.
These materials are provided by SAP SE or an SAP affiliate company
for informational purposes only, without representation or warranty
of any kind, and SAP or its affiliated companies shall not be liable for
errors or omissions with respect to the materials. The only
warranties for SAP or SAP affiliate company products and services
are those that are set forth in the express warranty statements
accompanying such products and services, if any. Nothing herein
should be construed as constituting an additional warranty.
SAP and other SAP products and services mentioned herein as well
as their respective logos are trademarks or registered trademarks
of SAP SE (or an SAP affiliate company) in Germany and other
countries. All other product and service names mentioned are the
trademarks of their respective companies.
Please see http://www.sap.com/corporate-en/legal/copyright/
index.epx for additional trademark information and notices.