June 2010 Previous month Next month

There are some useful patterns that implement features in SAP NetWeaver Composition Environment (SAP NW CE) that are not available out of the box.

Auto Put Back

Lets assume that there is a group of potential owners for a task. The first user that opens the task will be its exclusive owner. Until the task is not put back, it will never be visible for the other potential owners again. The assumption behind this exclusive task assignment behavior is that the task owner will immediately work on the task and complete it. But the owner might not be able to do that. With time cirtical tasks this can be an issue. A feature that puts back an exclusively assigned task after some configurable duration would solve the problem.

There is a simple solution for this requirement. Let's look at the pattern below:


By defining a boundary 'CompletionDeadLineIsCriticalException' that is routed back to the same task you can define a certain duration until the task has to be completed. If the task is not completed in time the task will be automatically canceled and restarted. The task will then be visible for all potential owners again.

Warning: Don't choose a short time interval as this solution puts additional load on the process server. Also consider that the task is canceled and restarted even if some user is processing it right now.

You can use an expression to set the duration dynamically based on task attributes the describe its criticallity. My recommendation is to calculate the duration in a way that the exception is triggered at a time with low system usage (e.g.  at user night time).

The upper process model layout does not represent the routing back sequence connector properly but I'm of the opinion that implementing such a feature should not mess up your proccess models.

Draft Handling

Now let's look at the following business requirements:

  • Business user wants to save process instances as "draft"
  • Automated deletion of untouched "draft" process instances after a configurable time

The idea is to always actually start the process in the user interface with a "save as draft" button. This information is passed to the process context via the interface of the start event. If the user has selected the "save as draft" option he will get a task in the UWL with attributes that distinguishes it from running instance (e. g. subject "Draft", no due date, etc.). For the automatic deletion requirement we use a CompletionDeadLineIsCriticalException boundary event. If triggered after the defined time period, the process instance is terminated.


Be aware that process analytics will of course consider this process as started, so you need to correct process cycle time accordingly.

The above process model brings solutions for more business requirements

Reuse of Instances

  • Ability to reuse data from other process instances (running, completed, draft) for new processes

A solution for this requirement is to leverage reporting activities and reporting data sources to store process context data that is used in new process instances. You will need to create a 'process picker' user interface component in Visual Composer using the standard SAP and custom reporting data sources with the right filter criteria. The custom reporting data source is used to start new process instances populated with data from other process instances. Be aware that the user can only use data from other process instances if he was involved in that process.

Anytime Read Access

  • Users must be able to look into the context of running process instances any timeeven if they don't have a task in their inbox.

This is achieved by the already described process instance picker user interface, the parallel spilt gateway and the following intermediate message event. On the left branch of the parallel gateway the normal process flow is modeled which consists in this case of an "Enrich Request" and an "Approve Request" human activity. At the end the process instance data is saved into the custom reporting data source to be reused for new process instances as described above.

The interesting part is on the right hand side of the parallel split gateway. To look into the content of a running process instance the user starts the process picker in NetWeaver Portal and selects a process instance. In the next step the UI triggers the intermediate message event which creates a task in the UWL for the user. Ideally the UI directly invokes the task avoiding the detour via UWL. It might be necessary to wait for a moment until the task is created. You can use a dummy service with some sleep() function for that purpose.

The UI used in "Display Request" has to be a read only UI. After the "Display Request" task is executed the process waits on the next intermediate message event to be triggered. As the termination event on the left hand side kills the whole process instance there is no need to have a parallel merge gateway in the process model.


With a little effort it is possible to enhance SAP NW CE with some additional features.  Be aware that some of the described patterns are not technology neutral. For example reporting data sources are not available in Web Dynpro Java. In the demontrated scenarios I used the process context for persistence. SAP does not recommend to do this if you have a large data model and/or high process instance volume. My purpose was to show what is possible out of the box without coding.

Stay tuned: In the next blog entries I will cover more useful patterns for ad-hoc processes,  process administration and process synchronisation.

Alexander Grobe

Process Templates

Posted by Alexander Grobe Jun 15, 2010

With SAP NetWeaver Composition Environment (CE) it is possible to develop composite applications that are designed to meet the current business requirements.

But is this the best possible solution design? Actually not, because you should not have to change the solution if the business requirements change in a certain way. For example the solution should be flexible that it can be used by different legal entities.

There are many ways to achieve flexibility in solution design:

  • Service orientation
  • Configuration (unguided setting of parameters)
  • Customizing (guided setting of parameters)
  • BADIs, User-Exits and Enhancement Points
  • Templates (parameterized patterns)
  • Variants
  • etc.

For the implementation of process templates I will focus on the options to define parameters within SAP CE that will change the behavior of a process. 

Parameter settings 

Below I compare different options that are available in SAP NW CE 7.2 in the following table:

 CAF Business Object

+ Accessible via web service and EJB
+ Detailed authorization concept (down to instance level)
+ Transportalbe
- Flat data model (no complex structures without Java coding)
- No version management
- Requires to develop an interface for the business users

 Business Rules

+ Accessible via web service, EJB or as mapping function in process models
+ Business user interface (Rules Manager)
+ Flexible data model
+ Transportable
+ Version management with approval (4 eyes principle)
+ Can, but must not be linked to process model versions
+ Easy to define depended parameters
- Only high level authorization concept
- No customizable and extensible user interfaces

 Java Config

+ Framework with API
+ Flexible data model
- Only for administrators
- No version management
- Requires to develop an interface for business users

 Custom Development

+ Everything is possible
- High manual effort

From the list above Busines Rules Managment (BRM) seems to be a good way to implement process template parameters.

So let's take a closer look of how this can be implemented. The following images show a way to define different approval patterns in a process template.


The decision table above allows different organizations to choose between one or two level approval. Furthermore the organizations can choose if the approval should happen in a sequential or in a parallel way. A process template using these parameters for process control is illustrated below:


Process Variants

Another way to achieve flexibility and still enforce standardization are process variants.
How can this be implemented with SAP CE 7.2?
Please take a look at the model below:


The idea is to leverage embedded sub processes that contain referenced sub-processes that represent the actual process variants. This way of modeling keeps the top most process model clean of the process variant details. With the referenced sub processes a process variant can be changed without effecting the rest of the executed process.

 In the next blog entry I will cover useful process patterns for a number of frequently reoccurring buisness requirements.


Filter Blog

By date: