Developing multi-step interactive processes is a challenging task. Find out how to model the data flow within a business process. In addition, learn how to assign roles to your interactive steps and how to define conditions for gateways that care for the branches in your process flow. Finally see how to build, deploy, and run your business process.
Key Concept
The data flow in a process model defines how data is mapped from a process step to the process context and vice versa. With output mapping, the data flows from the process step to the process context, and with input mapping, the data flows from the process context to the process step. You never model a data flow from step to step. This principle is crucial for the understanding of the data flow within a business process.
Imagine you have defined a new collaborative process with SAP NetWeaver Business Process Management (SAP NetWeaver BPM). You also have defined the artifacts needed for each process step, such as Web Dynpro components for the interactive steps and Web services for the automated background steps. You have even assigned those building blocks to the steps by using the Composite Designer. What is missing to bring the process eventually to execution? Well, here is what you have to do:
- Assign roles to the interactive steps
- Model the data flow for your business process via mapping
- Define the conditions for gateways responsible for branches in your process flow
- Define the group of users allowed to take over administrative tasks for your process
After you have finished these steps, you are ready to run your process. So let me show you what this means in detail.
Finalize the Investment Approval Scenario
I am close to the end of my demo scenario as described in my two earlier articles. All the pieces are now available, so I am going to glue everything together to an executable process within the process composer. After closing all Composite Application Framework (CAF)-related windows, you are once again back in the Composite Designer. This time, you only use it for navigation. Double-click the process symbol for the Investment Approval process and the system guides you to the process model within the process composer (Figure 1).

Figure 1
Process model within the process composer
After the process composer screen opens, you still see the error marker in the process header. Move the mouse pointer over it to get a list of open tasks you have to do to make the process executable.
Note that all the error markers for the activities are gone because of the assignments made. The first problem to solve is the assignment of users to activities. Here you have two choices: either assign users/group/roles to a lane and automatically all activities within that lane are assigned to the selected users/groups/roles. Or, you can assign this on the activity level explicitly. Each of the approaches is fine — your scenario directs which option is best because the dialogs are identical. Keep in mind that assignments made on the activity level overwrite the ones assigned on lane level. For my example I’ll create the assignments on the activity level.
Create the Assignments
Right-click the first human activity (Enter Purchase Request) and select Properties from the context menu. In the Properties tab (beneath your process diagram) click the Task button in the button bar on the left to open the task-related properties. Within those properties click the Task link to open the task editor. The Overview tab (at the bottom of the task editor’s screen) contains the associated Web Dynpro user interface (UI), which you can find in the User Interface section of the screen (Figure 2). The Component field points to the Web Dynpro component you have assigned to the Enter Purchase Request task.

Figure 2
User Interface section of the task editor’s Overview tab strip
To set the user or group of users who are allowed to handle this task, switch to the Roles tab strip. In the Potential Owners section click the Choose… button to assign concrete users, roles, and groups to the task (Figure 3). To assign users, select User from the Principal name drop-down menu (Figure 4). If you know the name of the user, you can enter an appropriate search string. In this example, you want to assign the demo user. Enter demo (or any other user name of your system who has execution rights for business processes) into the search field and click the Search button.

Figure 3
Click the Choose… button to assign a user to an activity

Figure 4
Search for a concrete user
Behind the scenes, a connection to the user management engine (UME) of the Java server is set up. If you connect to the engine for the first time, you have to provide appropriate credentials. Make sure to select the Store user name check box to avoid having to enter the credentials repeatedly. After you provide the data, click the OK button to proceed. The Search Results table lists all the hits that match your search criteria. Select the demo user and click the Add button.
The selected entry now appears in the Principals to Select table. You can add more users, roles, or groups — you can even mix these principals. Once finished, click the OK button. The assignment of users to a task has been finished. Save your changes in the task editor and close it. Repeat this assignment for the second activity (Approve Purchase Request) with the same user. Normally, you would assign a different user to different tasks. However, for simplicity reasons, take the same user. This helps you later during runtime because you do not need to log in repeatedly for different users.
To summarize, for a human activity to be executable, you need a task, which comprises information about the associated UI and the users who are allowed to execute the step. There are more attributes you can assign to a task, but UI and user are mandatory to make a task executable.
Set Up the Automated Activity
So far you’ve assigned the Web service to it. To be executable, you also need information about the concrete endpoint where the Web service is running. You can define this on the Properties tab for the automated activity. Right-click the automated activity and select Properties from the context menu.
On the Properties tab, click the Interface button on the left. As you can see, the Service Interface has already been assigned (Figure 5). For the endpoint assignment, you have two options:
- Service group: This allows you to define one connection for many services hosted on one system
- Logical destination: The definition of a destination for each service call

Figure 5
Provide information about the logical destination
You have already defined the logical destination, so use the second option. Select Use logical destination and enter the destination’s name LocalWSIL. With that, you have finished the adjustments on the activity level. Don’t forget to save your changes. Next, you continue with the data flow within the process.
Model the Data Flow
One of the key concepts of a collaborative process framework is its ability to handle the data flow between activities. The term “process context” describes the ability of a process framework to let data flow from activity to activity, while ensuring its persistency throughout the lifetime of a process.
Within SAP NetWeaver BPM, any data structure can be used for a process context. When you define such a data structure and make it available to the process, you can map data from an activity to the process context and vice versa. It is essential to understand this basic principle of process data flow: from the activity to the process context or from the process context to the activity, never from activity to activity.
To make this happen, you can define the structure within the SAP NetWeaver Developer Studio using the XSD Editor or import a predefined XSD file. For the sake of simplicity, I have created the appropriate XSD file for you, which you can download at the bottom of this article.
In SAP NetWeaver Developer Studio, the Composite Explorer (upper left area of your window) displays all the layers of your composite. To import an XSD file that you can use in our process, you have to import it into the project of your business process.
Go to Process > LocalDevelopment > Process Modeling > Data Types > XSD Files. To import the file into the XSD Files folder, right-click the XSD Files node and select Import XSD from the context menu. Accept the Output folder as is and click the Next button. Click on the Browse button and navigate within your file system to the folder that contains the downloaded XSD file named processcontentdata.xsd. Select it and click the Open button. The path to your file appears in the wizard’s dialog. Click the Finish button.
The XSD file is read and the structure is made available within the Data Types folder. Depending on the namespace defined in the XSD file, the structure appears in an identically named package within the Data Types folder. The namespace in the XSD file has been defined as xmlns:tns=“https://www.example.org/approvalprocess”, so you can find an appropriate structure in the associated package. For this example, you need the InvestmentApprovalProcess data structure.
Drag and drop the entry somewhere into one of the process’ lanes. The data object icon (a document with the upper right corner of it turned down) appears (Figure 6). With that, the process context is defined. Now you can model the data flow between activities and the process context.

Figure 6
Place the process context in the process model via drag and drop
Start with the Enter Purchase Request activity. Select it in the process flow and click the Input Mapping button on the Properties tab. You see a mapping area, where the fields of the process context appear on the left side and the fields of your activity on the right side (Figure 7).

Figure 7
Input mapping for the Enter Purchase Request activity
The mapping tool allows you to map either single fields or complete structures. For single field mapping, drag and drop an appropriate field from left to right with the left mouse button. To map a whole structure, drag and drop it from left to right with the right mouse button. Once you release the right mouse button, a context menu appears from which you can select Map automatically for automatic mapping based on the field’s name.
On the left side, expand the DO_InvestmentApprovalProcess node so that the structures ApprovalInfo, Product, PurchaseOrder, and Requester appear. On the right side, expand the node UIRequest under TaskInput. Here you see the structures ApprovalInfo, Product, and Requester. Use the automatic mapping feature by dragging and dropping the ApprovalInfo structure with the right mouse button from left to right. Select Map automatically once you release the mouse button and the final result should look like the screen in Figure 8. Repeat the mapping step for the structures Product and Requester using the automatic mapping. Figure 9 shows the final result.

Figure 8
Mapping between the process context (left) and the fields of the Enter Purchase Request activity (right)

Figure 9
Completed input mapping for the Enter Purchase Request activity
Now switch to the output mapping. The process context is now on the right side of the mapping area whereas the fields of the activity appear on the left (Figure 10). Assign Requester, Product and ApprovalInfo by using the Map automatically feature. You can find the structures of your activity beneath the TaskOutput > UIResponse node. Do not use the fields for the DO_InvestmentApprovalProcess node, which also appears on the left side of the mapping editor.

Figure 10
Completed output mapping for the Enter Purchase Request activity
One last step is missing. In the process context, you reserved a field named orderTotalAmount to contain the total amount of the order. It’s calculated by multiplying quantity and the product’s price. Select both fields on the left side and drag and drop them on the orderTotalAmount field. When the fields are connected, you can see a circle indicating that a function has been included automatically to combine the two fields. In addition you can identify an error marker attached to the circle. Move your mouse pointer over the error and you receive the error message “Wrong argument type for function ‘concat’”(Figure 11).

Figure 11
Error message for the concat function
Double-click the function symbol with the error marker to open the function editor. The mapping tool generates a concatenation of the two input variables by default. As both fields (productPrice and productQuantity) are of type Decimal, the concatenation doesn’t work because the function requires two strings as input.
What you want to achieve instead is the multiplication of the two variables. On the right side of the editor, the framework comes with predefined functions that you can find beneath the node Rules and Functions (Figure 12). It comprises all the predefined functions that you can reuse for formula editing.

Figure 12
Pre-delivered functions in the function editor
Drag and drop the numeric-multiply function into the editor to the left. As a result, the function appears in the editor. Add an opening bracket and copy the parameters of the concat function as parameters to the multiply function. Finally, remove the entire first line. Don’t forget the closing bracket for your numeric-multiply function.
You now have the right function with the right arguments. Leave the dialog by clicking the OK button. This removes the error marker.
Now that you are familiar with the mapping tool, map the input fields for the Approve Purchase Request activity (Figure 13) as well as its output fields (Figure 14).

Figure 13
Completed input mapping for the Approve Purchase Request activity

Figure 14
Completed output mapping for the Approve Purchase Request activity
The approval activity returns only three new fields (the others were modeled as read only in the Web Dynpro UI), so you only need to map those.
Finally, map the input fields of the service call (Figure 15). Because the input fields for the service are not structured, you have to map each field individually (drag and drop from left to right with the left mouse button).

Figure 15
Completed input mapping for the service call Create Purchase Order
This completes the mapping exercise. Again save your changes and move on with the definition of the conditions for the branches of the gateway.
Define the Conditions for the Gateway
So far, you’ve defined the two branches of the gateway with two labels (Resubmit and Approved), but you didn’t define the conditions (which one of the branches has to be executed when). Start with the Approved label. Right-click it in your process diagram and select Properties from the context menu.
On the Properties tab beneath the process diagram, click the Condition button to define when this branch has to be followed. The function editor is part of this dialog to define more complex conditions. Activate the check box at the bottom of the screen to make the current branch (or gate) to the default gate (Figure 16).

Figure 16
Set the default gate for the Approved branch
For every gateway it is mandatory to define one default gate, which is fired if all the other conditions are not true. In this example, you want to make the Approved branch the default gateway, so activate the check box. Note that you cannot add any condition to a default gate.
Next, define the condition for the Resubmit branch by selecting it in your process model. This gate should be activated as soon as the purchase order has been rejected by the approver. To create the formula for this condition, drag the predefined function “not” into the editor and enter an opening bracket. You can find the “not” function beneath the boolean node of the Rules and Functions folder. Next, drag the process context field orderApproved after the opening bracket (Figure 17).

Figure 17
Define the condition for the Resubmit gate
All the fields of the process context are at your disposal for defining conditions. They reside beneath the special node Context. Finally, don’t forget to enter the closing bracket. Save all your changes
By now, the errors are gone and only some warnings show up. While moving the mouse pointer over the warnings icon
, you get a complete list of open warnings (Figure 18).

Figure 18
List of open warnings
An administrator hasn’t been defined for your process yet, so you need to define one now.
Define an Administrator for the Process
Click once in the process header area in your process model (the area that contains the process title Investment Approval Process) and select the Properties tab beneath the process model. Click the Administrators button to define an administrator. Administrators are allowed to watch the process progress and intervene in case of problems (e.g., reassign tasks). Click the Choose… button to define administrators for your process. This returns you to the dialog for assigning users/groups/roles. Select the demo user to take over the role of an administrator and click the OK button.
Next click the User Texts button which you will find straight beneath the Administrators button. The dialog allows you to define a text that will be shown during runtime as a link which can be used to navigate to the process model. When clicked during runtime, the process flow diagram is shown to the end user with the current step marked with a green icon. This allows end users to orient themselves within the process. By default the text reads New Pool 0. Replace it with Investment Approval Process (Figure 19).

Figure 19
Set the User Texts
The process is now ready for execution. After saving and closing all process-related windows, you are back in the Composite Designer. Right-click the product’s root node (SpjInvestApprProduct) and select Build from the context menu.
A dialog asks you for the components to be built. Leave the screen unchanged and click the OK button. The build process starts compiling all the artifacts that belong to your composite application.
After building your application, deploy it by right-clicking the composite’s root node and selecting Deploy from the context menu. A dialog asks you which of the development components you want to deploy. Because nothing has been deployed yet, you can leave the settings as they are and deploy everything. However, once you modify certain components of your product, you can decide which ones you want to deploy. Click the OK button. If you deploy for the first time, you have to enter credentials for accessing your Java engine. Provide the requested information and continue by clicking OK.
If the dialog shown in Figure 20 appears, click the Deselect All button and continue by clicking the OK button. The dialog wants to synchronize all the used development components. This is not necessary for this example project, so proceed as described.

Figure 20
Dialog for synchronizing DCs
Before running your process, let me show you one final feature of the Composite Designer. So far, you have used references for a selected artifact (e.g., the process). However, this is only for direct connections from the process to the next level. It does not go any deeper.
If you want to see all the relationship levels, right-click the process node in Composite Designer and select Relations from the context menu. In the Relations tab beneath the Composite Designer’s main area you can see all the connections for your modeled process (Figure 21).

Figure 21
All relationships for the modeled process
Run the Investment Approval Scenario
You’ve reached the final step of this development exercise. All the components of your process example have been developed and deployed to the server. Now you need to run the process. Start the SAP NetWeaver Administrator via https://<host>:<port>/nwa. Navigate to the Process Repository by following menu path Configuration Management > Processes and Tasks > Process Repository. Here you can see an overview of all the processes that have been deployed on the server. From the Components table, select your investment approval process component (Figure 22).

Figure 22
Select the component that contains the investment approval process
Beneath the Components table is a table listing the different versions of your process that have been deployed so far. Because this is your first deployment, you see only one entry. It is automatically activated, as the check mark in the Active column indicates. Select the row to proceed.
The third table at the bottom of the screen lists all the process definitions and tasks for the selected process version. In that table, select the entry with the Process Definition type called Investment Approval Process (Figure 23).

Figure 23
Select the Investment Approval Process for execution
Note
To double-check the process flow, click the Process Flow button to see an overview of it.
Click the Start Process button and a new window opens that lists all the start events for your process in a table. As you’ve modeled only one start point, the table contains only one entry that you have to select. Click the Start Process button in that window again. A success message beneath the table informs you about the successful start.
Behind the scenes, the process runtime initiated the first step (the Enter Purchase Request activity). A notification has been generated and sent to the process participant you assigned to the associated activity during design time. The notifications show up in the universal worklist (UWL). You can access it via the portal by going to https://<host>:<port>/irj and log in with the appropriate credentials of the demo user. Select Home > Work.
The UWL lists the notification for the first step (Enter Purchase Request) in the Tasks table. If the entry doesn’t show up, click the menu icon
in the UWL’s header area and select Refresh from the context menu. This causes the UWL to check for new notifications. Once the entry appears you can navigate to the activity by clicking the Enter Purchase Request link. A new window opens displaying the screen you’ve developed in Web Dynpro enhanced by process runtime information such as started at, owner, priority, and status of the step. This data appears as the header on top of your Web Dynpro screen. Take a look at the link named Investment Approval Process in the upper right corner (Figure 24). This is the user text you added to the process during design time.

Figure 24
The first activity Enter Purchase Request during runtime
Click the link to get an overview of the process enhanced with information about the current runtime status (Figure 25). The green signal indicates the current step the user is working on. While moving the mouse pointer over this step, a loupe speed-button appears. Click it to get more detailed information about the step. This overview is especially useful for complex processes so that participants always know the current status of the process, which steps have been executed so far, and which activities follow when the current one is finished. Close this window to return to the Web Dynpro screen.

Figure 25
Process model during runtime with the current step marked
Enter the appropriate data for your order. Web Dynpro automatically creates appropriate UI components for handling different data types: simple input fields for text and string data and a calculator control for numeric fields. When finished, click the Submit button to proceed. You receive a pop-up window that contains a short note about the successful completion of the step. Click the Close button to return to the UWL.
To display the latest notifications click the menu icon for the universal worklist and select Refresh from the list. The next step of your process is now available. Click the link to open the approval screen.
If your mapping is correct, you should see all the fields being filled and the Order Total Amount field containing a value which was calculated by multiplying product price and quantity. That’s the process context in action. Complete the form by adding a short note to the comment (Figure 26).
Note
To test the jump back to the first activity, leave this screen without checking the orderApproved check box by clicking the Submit button. You receive the notification about the successful completion. After confirming the dialog, you are back in the UWL. Refresh the notifications and navigate again to the Enter Purchase Request screen.

Figure 26
The approver’s screen during runtime
The Comment field contains the conversation between requester and approver. Adjust the fields accordingly and click the Submit button. Confirm the dialog informing you about the successful completion of the current task. After refreshing the UWL, navigate to the Approve Purchase Request activity again.
This time, add a final comment and approve the request by selecting the Order Approved check box (Figure 27). Click the Submit button and confirm the dialog that pops up. After refreshing the UWL, no entry should appear.

Figure 27
Approval of the request in the approver’s screen
Behind the scenes, the process framework has called the Web service to save the order in the database. You can verify this by using the Service Browser, a tool that is shipped with CAF and which is used for test purposes. It allows you to look at the contents of your modeled business objects.
Call the Service Browser by entering the URL https://<server>:<port>/caf and clicking the Service Browser link. Inside the Service Browser window is a section named CAF applications on the left side of the screen. Look for your project and expand the PurchaseOrder node beneath your project’s name. Your PurchaseOrder business object provides a findAll method (Figure 28).

Figure 28
PurchaseOrder business object in the Service Browser
Click it to actually call the findAll method and look at the contents of the database table that is associated to your business object. A table to the right appears containing the data entered during the lifetime of your process (Figure 29).

Figure 29
Contents of the database table associated with the PurchaseOrder business object
This proves the successful completion of your Investment Approval Process.
Conclusion
You should now have a fairly good understanding about the new modeling capabilities of SAP enhancement package 1 for SAP NetWeaver Composition Environment 7.1. The development effort has been significantly reduced due to the new SAP NetWeaver BPM offering for collaborative business process modeling combined with the Composite Designer as the central cockpit for composite application development.
The Composite Designer helps you not only in getting an overview of the composite’s artifacts, it also helps you in identifying their relationships. The Composite Designer also glues different components developed with different tools together by providing wizards that take over all the cumbersome and error-prone administrative tasks for wiring the components together. It also supports you in navigating back and forth between the different pieces.
These features are complemented by the new SAP BPMN-based modeling environment for defining executable collaborative business processes: you were able to graphically model your business process and at the same time bring this model to execution – a really exciting innovation. To create such an executable process, you had to:
- Model the process flow
- Create Web Dynpro components which had to fulfill a contract for exchanging data and events with the process framework and plug them into the associated tasks
- Model a business object for data persistency, expose its create-method as web service and assign it to an automated activity
- Assign users to human activities
- Define and import a data structure as representation for the process context
- Map data from activities to the process context and vice versa
- Build and deploy the whole application with just two clicks
I hope I was able to inspire you for your own composite application development projects. If you are looking for further business process ideas, I recommend visiting the BPM process samples page. With this article a new foundation stone in the area of composite application development has been laid. Further articles will certainly analyze even more features of the tools introduced here. So stay tuned to what else SAP NetWeaver Composition Environment has to offer for you. The voyage has just started.

Dr. Volker Stiehl
Prof. Dr. Volker Stiehl studied computer science at the Friedrich-Alexander-University of Erlangen-Nuremberg. After 12 years as a developer and senior system architect at Siemens, he joined SAP in 2004. As chief product expert, Volker was responsible for the success of the products SAP Process Orchestration, SAP Process Integration, and SAP HANA Cloud Integration (now SAP HANA Cloud Platform, integration service). He left SAP in 2016 and accepted a position as professor at the Ingolstadt Technical University of Applied Sciences where he is currently teaching business information systems. In September 2011, Volker received his Ph.D. degree from the University of Technology Darmstadt. His thesis was on the systematic design and implementation of applications using BPMN. Volker is also the author of Process-Driven Applications with BPMN as well as the co-author of SAP HANA Cloud Integration and a regular speaker at various national and international conferences.
You may contact the author at editor@SAPpro.com.
If you have comments about this article or publication, or would like to submit an article idea, please contact the editor.