Introduction

If you had the chance to touch SAP NetWeaver BPM 7.31 SP6 or a later SP, you may notice the newly introduced features to define custom attributes and actions for tasks.

The custom attributes and actions help task owners make appropriate decision for a task by presenting essential information in the tasks list directly. Having the important task’s data presented, task owner can take a direct action, without opening it, on a task instance in case custom action for this task had been specified. In SAP NetWeaver BPM 7.31 SP7, the task editor has been extended with a new tab called “Attributes & Actions”. Custom attributes and actions are exposed through SAP NetWeaver BPM’s public API and could be consumed in custom inbox. The public API allows obtaining the custom attributes and actions of the task and their values and completing the task directly.

With these articles I would like to describe how to benefit from custom attributes and actions for tasks in your custom inbox using the public API. I would also provide information about what are the necessary steps to enable custom attributes and actions for task definition.

 

Sample BPM process

To demonstarte the custom attributes and actions I would use a commonly used process for master data quality.

 

pic01.jpg

A company recently acquired new companies and needs to align master data process with all new branches. Customer master data creation process is one of them. The process has the following routine:

  1. Customer requester is a person who is responsible for acquiring retailers for IDES Company. Once the requester finds a new retailer, he/she enters information about it. The data that the requester enters is the customer's ID, first name, last name, country, city, street, zip code, and credit limit.
  2. The data quality manager who is working in the same country location as the new customer reviews the data, and if needed, returns it for rework by customer requester.
  3. Data quality manager can also directly approve or reject customer’s request.

pic02.jpg

 

Custom attributes for tasks

Custom attributes are defined during design time as a part of a task definition when performing modeling in Process Composer. The input data context of the task definition would be available for choosing as custom attributes. The attributes defined in Process Composer are visible as columns in the task list in BPM Inbox. Custom attributes of task would be visible in BPM Inbox when the user filters by task type. The expression would be calculated using the real process data and would be visible as a value. To define your custom attributes for a task follow the steps below.

 

Modeling Custom Attributes in NWDS

Open “Attributes and Actions” tab to define custom attributes for task definition. For each custom attribute the user has to specify its name, label, type, and expression (value). The label of the attribute is a translatable text and the name of the action serving as a key. The expression is the actual value of the attribute, populated in BPM inbox. The order in which the custom attributes are listed in the table would be same when the custom attributes are retrieved from BPM’s public API.

 

pic03.jpg

Optional: Translation of task custom attributes

Copy and rename task’s ‘.xlf’ file. Then open it with S2X document editor. Choose the ‘Source language’ in Header tab, open ‘Resource Text’ tab, and edit the translated text.

 

 

pic05.jpg

For more information, see Internationalization of Java Projects.

 

Consumption of Custom Attributes through Public API

To fetch the custom attributes, use TaskDefinitionManager, TaskInstanceManager, and TaskAbstractCustomAttributesCriteria. The task definition contains information about the name, label and type of all custom attributes defined for this task. The task instance contains the actual values for these custom attributes. To get TaskAbstract with custom attribute’s value, use an instance of TaskAbstractCustomAttributesCriteria as shown below.

 

 

IAuthentication auth = UMFactory.getAuthenticator();
IUser user = auth.forceLoggedInUser(request,response);
 
TaskInstanceManager taskInstanceManager = null;
TaskDefinitionManager taskDefinitionManager = null;
 
        try {
            taskInstanceManager = BPMFactory.getTaskInstanceManager();
            taskDefinitionManager = BPMFactory.getTaskDefinitionManager();
 
            
 
//Task statuses we are interested in
            Set<Status> statuses = new HashSet<Status>();
              statuses.add(Status.READY);
              statuses.add(Status.CREATED);
              statuses.add(Status.IN_PROGRESS);
              statuses.add(Status.RESERVED);
 
 
//The TaskAbstractCustomAttributesCriteria class is a marker telling the 
//getMyTaskAbstracts() method whether to fetch the custom attributes for the 
//tasks or not.
            
List<TaskAbstract> taskAbstracts = 
 taskInstanceManager.getMyTaskAbstracts(statuses, null, new TaskAbstractCustomAttributesCriteria());
            
for(TaskAbstract ta : taskAbstracts) {
 
 URI taskModelId = ta.getModelId();
 URI taskDefinitionId = ta.getDefinitionId();

 

If you are interest in particular task definition and want to get its custom attributes, you have to use the following approach:

 

{
 
//Get custom attributes definitions for the current task definition
TaskDefinition taskDefinition =   taskDefinitionManager.getTaskDefinition(taskDefinitionId);
List<CustomAttributeDefinition> customAttributeDefinitions = 
      taskDefinition.getCustomAttributeDefinitions();
      
     for(CustomAttributeDefinition cad : customAttributeDefinitions) {
     //Retrieves the label of the custom attribute defined which is        
      //translated based on logged in user's Locale.
            String caLabel = cad.getLabel();
            String caName = cad.getName();
            Class<?> caType = cad.getType();
      }
            //Get The custom attribute values
            Map<String, Object> caValues = ta.getCustomAttributeValues();
}

 

                 

If you have more than one version of the process and you are interested in an active version of task definition and its custom attributes, you have to use the following approach:

 

{
//Get custom attributes definitions for the active task definition
TaskDefinition taskDefinition =  taskDefinitionManager.getActiveTaskDefinition(taskModelId);
List<CustomAttributeDefinition> customAttributeDefinitions = 
      taskDefinition.getCustomAttributeDefinitions();
      
      

for(CustomAttributeDefinition cad : customAttributeDefinitions) {
     //Retrieves the label of the custom attribute defined which is 
     //translated based on logged in user's Locale.
            String caLabel = cad.getLabel();
            String caName = cad.getName();
            Class<?> caType = cad.getType();
}
}

 

 

If you have more than one version of the process and you are interested in all versions of task definitions and their custom attributes, you have to use the following approach:

 

{
//Get custom attributes definitions for any task definition
Set<TaskDefinition> taskDefinition = taskDefinitionManager.getTaskDefinitions(taskModelId);

for(TaskDefinition td : taskDefinition) {
            List<CustomAttributeDefinition> customAttributeDefinitions = 
           td.getCustomAttributeDefinitions();
            

for(CustomAttributeDefinition cad : customAttributeDefinitions) {
     //Retrieves the label of the custom attribute defined which is 
      //translated based on logged in user's Locale.
            String caLabel = cad.getLabel();
            String caName = cad.getName();
            Class<?> caType = cad.getType();
      }
      }
}
}
        
}catch(BPMException e ) {
       //exception handling goes here
}

 

pic05.jpg

 

Custom actions for tasks

Custom actions are defined during design time as a part of a task definition. At runtime, they can be fetched via the public API or accessed through the BPM Inbox. The public API is enhanced with a complete method taking custom action’s technical name as a parameter. The name of the action can be taken during the next step of the process by mapping the new task attribute “customAction” to the process context. To define your task custom actions follow the steps below.

 

Modeling custom actions in NWDS

To enable the defining of custom actions for task definition, open the “Attributes & Actions” tab. This tab is used to define actions in a table. For each custom action you have to specify the name, label, and description. The label and description are translatable text, and the name of the action serves as a key. The actions will be presented in BPM inbox as buttons. The order in which the custom actions are listed in the table would be same when the custom actions are retrieved from BPM’s public API.

 

pic06.jpg

 

Optional: Translation of task custom actions

You can follow the same approach described for custom attributes.

 

Modeling process workflow using action value

You have to map ‘customAction’ value to some context. So this ‘customAction’ attribute can be used for decision-making. In our case this value is used to make decision about how the process ends.

 

pic07.jpg

 

Consumption of custom actions through public API

This code snippet shows how to get the custom action definitions for all tasks assigned to the current user.

IAuthentication auth = UMFactory.getAuthenticator();
IUser user =  auth.forceLoggedInUser(request,response);
 
    TaskInstanceManager taskInstanceManager = null;
    TaskDefinitionManager taskDefinitionManager = null;
    
try {
        taskInstanceManager = BPMFactory.getTaskInstanceManager();
        taskDefinitionManager = BPMFactory.getTaskDefinitionManager();
 
        //Task statuses we are interested in
        Set<Status> statuses = new HashSet<Status>();
            statuses.add(Status.READY);
        statuses.add(Status.CREATED);
            statuses.add(Status.IN_PROGRESS);
            statuses.add(Status.RESERVED);
 
 
        //The TaskAbstractCustomAttributesCriteria class is a marker telling the 
          // getMyTask Abstracts() method whether to fetch the custom actions for the tasks or not.
        List<TaskAbstract> taskAbstracts = 
           taskInstanceManager.getMyTaskAbstracts(statuses, null, 
                     new TaskAbstractCustomAttributesCriteria());
   
      PrintWriter pw = response.getWriter();
        for(TaskAbstract ta : taskAbstracts) {
            URI taskDefinitionId = ta.getDefinitionId();
                TaskDefinition taskDefinition = taskDefinitionManager.getTaskDefinition(taskDefinitionId);
                List<CustomActionDefinition> customActions = taskDefinition.getCustomActionDefinitions();
            }
 
    }catch (BPMException e) {
               // TODO: handle exception
    }

 

pic08.jpg

 

Complete a task instance with a custom action via the public API

The public API of SAP NetWeaver BPM now has a complete method accepting a custom action as a parameter:

 

    public  void  complete(URI taskInstanceId, DataObject taskOutputData, CustomAction customAction) 

Using this method you can complete a task with one of the already defined custom actions for this task definition. When the complete method call from public API with custom action value is processed, task completion message is created with custom action value, if chosen. And during the same method’s (complete) processing, notification of the completion state is delivered to the BPEMTaskParent, where the task attribute's 'customAction' element is updated with the custom action value that is chosen to complete the task.

 

For more information about custom attribute, see Defining Custom Attributes for Tasks.

Modern client-side web frameworks and libraries like SAPUI5 are using REST services to load data from a server. If you want to consume existing business logic from these new web applications, you first need to make them REST-enabled.

 

For standard SAP applications, you can use SAP NetWeaver Gateway. But what about your own composite services built e.g. using the Composite Application Framework (CAF)?

 

In this blog, we will use the Apache Jersey library to expose a CAF Business Object as a RESTful web service.

Deploying Jersey

 

For a description on how to package and deploy the Jersey libraries to the SAP NetWeaver Application Server, please refer to this excellent blog by Werner Steyn.

 

It is recommended to wrap the External Library into its own Enterprise Application, and have it packaged in a separate Software Component so that it can be reused from multiple applications.

 

Don’t forget to remove the access restrictions to the DCs and its public parts, in order to make it available to other applications.

 

Creating a web module DC

 

The Jersey servlet needs a web.xml to be configured and deployed. Create a new web module DC in the software component which holds your CAF project.

Add a DC dependency from the CAF EAR DC to the new web DC so that it is included with the CAF application.

 

Enabling access to the CAF project

 

Since you want to reuse the existing CAF service, you need to be able to reference it from your new web module DC.

In the component properties of the CAF EAR DC, switch to the “Public Parts” tab, select the “client” public part and add permission for your web DC. Repeat this for all other public parts.

 

PP.png

 

Next, switch to the “Permissions” tab and again add permission for the web DC.

 

permissions.png

 

Setting DC dependencies

 

Now, switch to the component properties of your web DC and add the following DC dependencies:

  • caf/core/ear
  • caf/runtime/ear
  • jersey/ear (from the Software Component which contains the Jersey libraries)
  • tc/bl/exception/lib

You can test if everything works by building the CAF application. If the build is failing, check the build log for error messages.

 

Implementing the resource class

 

Now it’s time to actually implement the REST service. All you need is a plain Java class with some annotations. The JNDI name to look up the CAF EJB can be retrieved via the JNDI Browser in NWA.

The GET method simply all employees stored in the respective CAF table. Since Jersey supports POJOs, we can return the Employee object as-is and don’t need to create any wrapper objects.

 

 

package com.sap.demo.cafrest.employee;

import java.util.List;

import javax.naming.InitialContext;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;

import com.sap.demo.employee.modeled.Employee;
import com.sap.demo.employee.modeled.bonode.employee.employee.EmployeeServiceLocal;

@Path("/employees")
public class EmployeeResource {

      EmployeeServiceLocal employeeService;
      final String JNDI_NAME = "demo.sap.com/employee~ear/LOCAL/com.sap.demo.employee.modeled.bonode.employee.employee.Employee/com.sap.demo.employee.modeled.bonode.employee.employee.EmployeeServiceLocal"; 

      @GET
      @Produces(MediaType.APPLICATION_JSON)
      public List<Employee> getAllEmployees() {

            try {
                  InitialContext jndiContext = new javax.naming.InitialContext();
                  employeeService = (EmployeeServiceLocal) jndiContext.lookup(JNDI_NAME);
                  List<Employee> result = employeeService.findAll();
                  return result;
            } catch (Exception e) {
                  throw new RuntimeException(e);
            }
      }

}

In the code sample above, we only implement the method to get all objects. You can easily implement all CRUD and finder methods in a similar way using the respective annotations for GET, PUT, POST and DELETE. Check the Jersey documentation for more details.

This example uses a CAF business object service, but the same approach also works for application services.

 

Configuring the Jersey servlet

 

Finally, we need to configure the servlet container for Jersey. Open the web.xml of your web DC and add the following lines:

 

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
      xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
      id="WebApp_ID" version="2.5">
      <display-name>CAF REST demo</display-name>
      <servlet>
            <servlet-name>Jersey REST Service</servlet-name>
            <servlet-class>com.sun.jersey.spi.container.servlet.ServletContainer</servlet-class>
            <init-param>
                  <param-name>com.sun.jersey.config.property.packages</param-name>
                  <param-value>org.codehaus.jackson.jaxrs;com.sap.demo.employee.modeled;com.sap.demo.cafrest.employee</param-value>
            </init-param>
            <init-param>
                  <param-name>com.sun.jersey.api.json.POJOMappingFeature</param-name>
                  <param-value>true</param-value>
            </init-param>
            <load-on-startup>1</load-on-startup>
      </servlet>
      <servlet-mapping>
            <servlet-name>Jersey REST Service</servlet-name>
            <url-pattern>/rest/*</url-pattern>
      </servlet-mapping>
</web-app>

 

Via the parameter com.sun.jersey.api.json.POJOMappingFeature, we tell Jersey to use POJO mapping instead of JAXB annotations.

In the value for com.sun.jersey.config.property.packages, you need to add all Java packages containing the POJOs used in your CAF services. Otherwise the POJO to JSON mapping will not work.

 

Testing the service

 

Deploy the whole CAF application to the server. After deployment, you should be able to call the service from your browser:

 

result.png

 

If you get an error message, check the dev traces in the NWA Log Viewer.

 

Summary

 

Exposing a CAF service via REST requires only a few lines of code. The trickiest part is to make sure you have set all the right permissions and dependencies between the various DCs.

A process model contains many artifacts which require human/system interaction to complete the end to end process execution. This blog explain how to write eclipse based JUnit tests to automate BPM process model tesing.

Restfuse(http://developer.eclipsesource.com/restfuse/) and Selenium(http://docs.seleniumhq.org/) are the two open source frameworks  used to automate the process model testing.Together with these frameworks the RESTful services of BPM public apis and Apache CXF framework are used .

 

Restfuse is a Junit extension to test RESTful services. A Restfuse based test uses annotations to define RESTful service url ,Request type, Authentication and content and its type. It is not required to deploy the tests to the BPM server. The test run like any other JUnit test in eclipse.

 

Restfuse provides a possibility for callbacks and polling in a declarative manner. It also offers dynamic request manipulation at the request header level.

This blog explains how  BPM process model testing can be automated by creating a new process instance and process all the human tasks of the process model and check the completion of the process. The basic requirements to build such tests are the following.

 

 

1.      1. SAP Netweaver BPM 7.31

2. RESTful services of BPM (http://scn.sap.com/community/bpm/blog/2011/10/27/restful-service-for-netweaver-bpm)

3.      3. Apache CXF framework (http://cxf.apache.org/)

4.      4. Restfuse (1.2)open source library from eclipse http://developer.eclipsesource.com/restfuse/

       https://github.com/eclipsesource/restfuse/blob/master/build/com.eclipsesource.restfuse.target/restfuse.1.2.0.target

  5. Selenium open source library from Selenium( http://docs.seleniumhq.org/docs/03_webdriver.jsp#introducing-webdriver)

6.      6. Harmcrest open source library from eclipse(http://hamcrest.org/)

     http://download.eclipse.org/tools/orbit/downloads/drops/R20110523182458/repository

7.         JUnit 4.10 from eclipse.

 

How to setup the test landscape

 

1.    1. Deploy the BPM RESTFul services in the JEE system.

     Down load the binaries from the SCN code exchange . The RESTful services can be enhanced to meet the various requirements of the test.

     http://scn.sap.com/community/bpm/blog/2011/10/27/restful-service-for-netweaver-bpm

2.Download and deploy the Apatche CXF framework as explained in the blog

     https://cw.sdn.sap.com/cw/message/86851#86851

2.    3. Down load the eclipse Restfuse 1.2 from

      https://github.com/eclipsesource/restfuse/blob/master/build/com.eclipsesource.restfuse.target/restfuse.1.2.0.target

     Build the sources in the Developer studio and package the class files in a jar file.

3.    4. Down load the Restfuse dependent libraries from

http://download.eclipsesource.com/technology/restfuse/restfuse-1.1.1.zip     http://download.eclipsesource.com/technology/restfuse/restfuse-1.1.1.ziphttp://download.eclipsesource.com/technology/restfuse/restfuse-1.1.1.zip

     (You need to use Restfuse 1.2  version in order to use the dynamic path segment feature to pass request parameters to the REST service.)

 

How to write a Junit test to automate a process model

 

The following annotations are required at the Junit class level

@RunWith( HttpJUnitRunner.class)

Public class bpmProcessModelTest {

      

 

       @Context private PollState pollState;

      

       @Rule public Destination destination = new Destination(this,"http://hostname:port/" );

      

       @Context private Response response;

 

The Response object will be injected after every request send to the BPM system.

 

Inorder to have provide the request paramter to the destination URL , you have to define a function which will be called before executing each test.

for eg: 

@Rule public Destination destination = getDestination();

 

 

In the implementation of the getDestination you could process the request URL .

for eg:

 

Destination dest =  new Destination(this,"http://servername:port" );

RequestContext context = dest.getRequestContext();

context.addPathSegment("pdefid",processdefid);

 

The above code snippet can be used to provide the process definition id to retrieve the start event of the process.

 

Test 1:  Get Process Definition of a Process model

 

The Path parameter provides the DC Name, Vendor Name and Process Model name to retrieve the process definition id of the process model. The header annotation define the response media type as Json model type.

 

@HttpTest(method = Method.GET,headers = {@Header(name = "Accept", value = "Application/Json") } ,authentications=@Authentication(type=AuthenticationType.BASIC,user="userid",password="@@@@"), path = "/bpm/bpemservices/processdefinitions?vendor=demo.bpm.test&dcName=customuiprocess&processName=simpleTestProcess")

       public  void getProcessDefintion()

       {

           String s = response.getBody();

          Object obj = JSON.parse(s);

          String pDefId = null;

           if(obj instanceof Map )

     {

             Map m = (Map)obj;

             Object ob = m.get("ProcessDefinitions");

                  if(ob instanceof Map)

        {                   

           Map m1 = (Map)ob;

                        if(m1.get("ProcessDefinition") instanceof Map)

           {

               Map m2 = (Map) m1.get("ProcessDefinition");

               pDefId = (String) m2.get("id");

                      }

        }

      }

           

      com.eclipsesource.restfuse.Assert.assertOk(response);

            

   }

 

Test 2: Get Process Start event of a process definition

 

Get the start event id of a process definition by providing the process definition id in the request url as a parameter.

@HttpTest(method = Method.GET,headers = {@Header(name = "Accept", value = "Application/Json") } ,authentications=@Authentication(type=AuthenticationType.BASIC,user="userid",password="@@@@@"), path = "/bpm/bpemservices/processstartevents?processDefinitionId={pdefid}")

       public void getProcessStartEvent()

    {

 

            String s = response.getBody();

             HashMap obj = (HashMap)JSON.parse(s);

            HashMap events = (HashMap) obj.get("ProcessStartEvents");

            HashMap event = (HashMap) events.get("ProcessStartEvent");

            eventId = (String) event.get("id");

      com.eclipsesource.restfuse.Assert.assertOk(response);

     } 

 

 

Test 3: Get Process Start Event Schema

 

Get the schema of the process start event. The process start event schema is required to define the input data to create an instance of the process.

@HttpTest(method = Method.GET,headers = {@Header(name = "Accept", value = "Application/xml") } ,authentications=@Authentication(type=AuthenticationType.BASIC,user="userid",password="@@@@"), path = "/bpm/bpemservices/processstartevents/{eventid}")

       public void getProcessStartRequestSchema()

       {

             String s = response.getBody();

             com.eclipsesource.restfuse.Assert.assertOk(response);

         

       }

 

 

 

Test 4: Create a process Instance

 

 

The Http Post method will send the content together with the request and get the process instance as response. The file attribute determine the input data which is stored in the class path of the test.

 

 

@HttpTest(method = Method.POST, file="data.xml" ,headers = { @Header(name = "Accept", value = "Application/json"),@Header(name = "Content-type" , value = "Application/xml") } ,authentications=@Authentication(type=AuthenticationType.BASIC,user="userid",password="@@@@"), path = "/bpm/bpemservices/processstartevents/{eventid}")

       public void createProcessInstance()

       {

             String s = response.getBody();

             HashMap obj = (HashMap)JSON.parse(s);

                    HashMap processInstance = (HashMap) obj.get("ProcessInstance");

             com.eclipsesource.restfuse.Assert.assertOk(response);

                         

       }

 

Test 5: Get all tasks of a process instance

 

The @Poll annotation will retry the method twice with 5 seconds interval inorder to ensure that the tasks are created .

 

@HttpTest(method = Method.GET,headers = { @Header(name = "Accept", value = "Application/Json") } ,authentications=@Authentication(type=AuthenticationType.BASIC,user="userid",password="@@@@"), path = "/bpm/bpemservices/taskinstances/ProcessInstance/{processinstance}?status=READY&status=RESERVED" )

       @Poll( times = 2, interval = 5000 )

       public void getTaskInstanceOfProcess()

       {  

             Object[] taskAbstractList = bpmjsonhelper.getTasks(response);

                            if(null != taskAbstractList )

             {

                             int size =  taskAbstractList.length;

                             for(int i = 0; i < size; i++)

               {

                   HashMap taskAbstract = (HashMap)taskAbstractList[i];

                   String taskid = (String)taskAbstract.get("id");

                   String taskName = (String) taskAbstract.get("name");

                         

                 }

}

// the number of polling interval defined at the @Poll annotation

            

 

               if(pollState.getTimes() == 2)

        {

            com.eclipsesource.restfuse.Assert.assertOk(response);

         }

            

       }

 

 

 

 

 

 

 

Test6: Claim & Completion of a Task

 

    @HttpTest(method = Method.PUT,content ="{x=1}",headers = { @Header(name = "Accept", value = "Application/json"),@Header(name = "Content-type" , value = "Application/json")} ,authentications=@Authentication(type=AuthenticationType.BASIC,user="userid",password="@@@@"), path = "/bpm/bpemservices/taskinstances/{taskinstance}?action=CLAIM")

      public void claimtestTask()

      {

           String s = response.getBody();

            com.eclipsesource.restfuse.Assert.assertNoContent(response);

                 

      }

     

The file attribute determines the task input data  and the file should be in the class path.

    

@HttpTest(method = Method.PUT,file="mytaskData.xml",headers = { @Header(name = "Content-type" , value = "Application/xml")},authentications=@Authentication(type=AuthenticationType.BASIC,user="userid",password="@@@@"), path = "/bpm/bpemservices/taskinstances/{taskinstance}?action=COMPLETE")

      public void completeMyTask()

      {

           String s = response.getBody();

            com.eclipsesource.restfuse.Assert.assertNoContent(response);

      }

 

Test 7:  Comletion of a Task using Task Execution UI

The REST call provide the task execution URL and selenium webdriver is used to open the task exectuion UI and complete the task.,

 

@HttpTest(method = Method.GET,headers = { @Header(name = "Accept", value = "Application/Json") } ,authentications=@Authentication(type=AuthenticationType.BASIC,user="userid",password="@@@@"), path = "/bpm/bpemservices/taskinstances/taskinstance/{taskinstance}" )

public void CompleteMyTask()

{

 

   com.eclipsesource.restfuse.Assert.assertOk(response);

   String s = response.getBody();

   WebDriver webdriver = new FirefoxDriver();

   webdriver.get(s);

   WebElement element = webdriver.findElement(By.name("j_username"));

   lement.sendKeys("userid");

   element.sendKeys(System.getProperty("username"));

   WebElement element2 = webdriver.findElement(By.name("j_password"));

   element2.sendKeys("@@@@");

   WebElement elementForm = webdriver.findElement(By.name("logonForm"));

   elementForm.submit();

 

   webdriver.get(s);

 

 

  WebElement taskCompletion = webdriver.findElement(By.id("FDOEEFPDBOMAACHH.TestTaskComponentView.TestTaskCompleteEvent"));  

   taskCompletion.click();

   webdriver.close();

}

 

Test:8 Process Completion

 

 

@HttpTest(method = Method.GET,headers = { @Header(name = "Accept", value = "Application/Json") } ,authentications=@Authentication(type=AuthenticationType.BASIC,user="userid",password="@@@@"), path = "/bpm/bpemservices/processinstances/{processinstance}?status=COMPLETED" )

@Poll( times = 3, interval = 5000 )

public void CheckProcessStatus()

{

       if(pollState.getTimes() ==3)

       {

        String s = response.getBody();

        com.eclipsesource.restfuse.Assert.assertOk(response);

        }

  

}

Recently, with imminent release, we came across a requirement where end user wanted to know processes with particular task subject. Though we have all the Reporting on standard and custom data sources in BW, accommodating it there via custom datasource at last moment would have triggered newer version of Reporting datasource and thereby triggering changes in BW side as well (Uncertain if this limitation - of getting new version created- is fixed in 7.31, we are working on 7.2 SP 5 at the moment). Also, we were not able to find “Subject” field in “BPM_TASKS_DS” which can be pulled in BW (It’s available in “BPM_MY_TASK_DS” which cannot be pulled in BW though), leaving us behind with only option of Visual Composer.

However, showing the processes with particular tasks name/subject requires JOIN operation on the 2 (BPM_MY_TASK_DS and BPM_MY_PROCESS_DS) datasources and whatever searches we did, said that JOIN is not supported in Visual Composer(Would be great to know if there is any alternate way). Nonetheless, with the mandate of fulfilling the requirement we somehow did it using concept of “Entry List”. Though this doesn’t let us go deep down in process’ attributes, we can identify the process names against particular tasks. Thankfully, that was sufficient for the requirement.

Security role requiredFor having a reporting view on these datasources, you can display data if your user is assigned to the SAP_BPM_SuperDisplay or SAP_BPM_SuperAdmin roles.

(Because, for BPM_MY_PROCESSES_DS, your user needs to be assigned to a role which gives you access to the particular process instance, e.g. Business Process Administratorrole and for BPM_MY_TASKS_DS, your user needs to be assigned to a role which gives you access to the particular task instance, for example Potential Owner, Actual Owner, Business Administrator, and so on.)

 

Scenario: Taking a simple process example – Scheduler Process - having 3 tasks viz. Sales Approval, Finance Approval and HR Approval, we will try to fetch the list of processes having “Finance Approval” task in it.

 

1.         

1.     Create a new Service Component in VC using datasource “BPM_MY_PROCESSES_DS” with simple “In” and “Out” Port. Choose appropriate fields, here we selected ID, Parent_ID, Status, Subject and Description. Save.

2.5 Service Component.JPG

2.     Create New Model -> Composite view with datasource “BPM_MY_TASKS_DS” and “In” and “Out” Port. Select appropriate fields, here we selected ID, Parent_ID, Status and Subject.

     4 Drag and Drop Task DS.JPG

3.     Create a just a “Start” event to start the model and select a “filter” from Out port.

     5 Start In and filter Out.JPG

4.     Define filter operator to filter on tasks with “Subject” containing “Finance” (Right click on Filter -> Define Operator)

     6 Define Filter.JPG

5.     Create a “Table View” from a filter.

     7 Create Table from Filter.JPG

6.     Go To Layout-> Change the Control type of “Parent Id” field to “DropDown List”( Parent Id specifies the process ID the task is part of)

     8 Change Control type.JPG

7.     Create a Dynamic “Entry list” on “Parent ID” field. (right click -> Entry List)

     9 dynamic Entry List.JPG

8.     On next screen, choose “Visual Composer components” in provider and search for the service component we created in Step 1.

     10 Search Service Component.JPG

9.     Skip “Configure Input” and proceed to “Configure Output”. Select “Id” in Value which specifies the process Id in service component (represented here as Parent_Id). Choose “Subject” in Display text which will show the Process Subject of particular tasks.

     11 Configure Output.JPG

10.    Make the “Parent_Id” field or perhaps the whole table as Read Only, adjust column’s properties of table as required. Save, Deploy and Run the model.

     12 Run the model.JPG

11.    "Export" option can be selected in VC for giving way to export the list to Excel file.

     13 Export option.JPG

 

I am not an expert in Visual Composer, hence any views from experts are most welcome to do this in simpler way Or some better way to have reporting on multiple datasources.

This blog post, as part of this blog series, refers to the recently introduced Conditional Start feature in SAP NetWeaver BPM available with SAP NetWeaver 7.3 EHP 1 SP 06 and higher.

 

The Conditional Start feature can be complex to administer. SAP NetWeaver BPM has some particularities that ease the administration and usability of conditional start scenarios.

 

Prevention of Manual Process Start

In conditional start scenarios, a web service message sent to the conditional start endpoint should only be consumed by exactly one process instance. This means that a message either starts a new process instance or triggers an intermediate message event of a running process instance.

To ensure that there is at most one process instance consuming a message of a kind at any point in time, the manual start of conditional start process instances through the process repository http://<host>:<port>/nwa/bpm-repository and through the public API is disabled.

Instead, a process could be started through sending a web service message to the conditional start endpoint. The process repository provides a parameterized link to the web service navigator to allow a web service message to be sent to the conditional start endpoint. The BPM system then decides whether the web service message starts a new process instance or whether it triggers an intermediate message event.

 

Prevention of Multiple Active Conditional Start Process Definitions Sharing the Same Message Trigger

In SAP NetWeaver BPM, a web service endpoint is represented by a message trigger. A message trigger is reusable and can be used in multiple process definitions. This allows messages to be broadcasted to different process instances. This is not wanted in conditional start scenarios because it implements a collect pattern. Therefore, a message should always be consumed by exactly one process instance.

To ensure that only one process instance consumes a message at any point of time, there must not be more than one distinct process definition active, which shares the same message trigger as their conditional start trigger.

Thus, the activation of a development component fails when a conditional start message trigger is already used by another active conditional start process definition. The activation of a development component also fails when it contains more than one conditional start process definition, which uses the same message trigger.

Such a situation could either happen when deploying a new development component to the process server, when activating another version in the process repository (http://<host>:<port>/nwa/bpm-repository) or when updating a system, which contains multiple active process definitions that share the same message trigger for conditional start.

During design time, the process developer is supported by an automatic check in the process composer that reports an error when there are more than one conditional start process models that share the same message trigger.

 

 

 

For me, capturing the last day of a conference has proven challenging. It's now 10 days since the 2013 Gartner Business Process Management Summit ended, yet I've not committed this post yet. As in days one and two, I took copious notes and photos, yet somehow the combination of the lack of momentum and tasks deferred led to delay. My hope is the time between may have generated a bit of perspective on the event, compared to the immediacy of posting the same day. You readers must decide.

 

Session - The Quest for Engagement - A Gamification Challenge

 

Maybe it's telling that my browser flags "gamification" as a misspelled word (what would auto-correct do?), as the concept of adding "play" features to work processes is both novel and controversial. Elise Olding did spectacular work framing the topic in serious terms, yet weaving in reward concepts, giving away prizes (e.g., see Image 1) for asking questions. To illustrate the random aspects of game theory, one must have asked the question according to the stated rules, but an unwritten (unpublished) rule was awards were only made on sequence number matching a list.

 

Elise displayed an image of one classic recognition - the Employee of the Month parking space - that illustrates gamification. Other examples she mentioned included workplace safety ("N days since an accident"), and one more applicable to the software world, the Microsoft Language Quality Game, where international teams competed to improve help message content. According to Elsie, the relatively small Japanese team took top honors, demonstrating that team size was not a factor, and culture might be.

 

A couple firms she referenced (both of which say they're number one on the respective web sites - maybe they play by different rules):

 

 

The latter name reminds me of both the ribbons distributed at ASUG/Sapphre/TechEd conferences (who wins for most ribbons, most obscure, etc.?) and the icons on SCN assigned to specific accomplishments or efforts (i.e., moderator, mentor, silver).

 

My question (for which I won the occasional light-up, unintelligible sounding clown face pen in Image 1), was on cheating.  As an SCN Moderator, I see the backroom efforts to keep the "playing field" level in the current recognition system. I'm also looking ahead to the previously announced Gamification phase here (see: Game On!   #Gamification Coming to #SCN (SAP Community Network), Talking about gamification, Gamification Workshops, and the eponymous SAP Gamification). Elise responded with comments on fairness, design (think, create, revise), crowd-sourcing, and a culture of accountability. One that stuck with me was characterizing "heroism" as a negative factor ("Billy Don't Be a Hero"), in that solo risk-taking/star-seeking could interfere with the team-building and socialization goals of a community.

 

Image 2 below shows another gaming example, with visual feedback on time sheet submission progress.

 

"Change so game fatigue does not set in" - Elise altered the rules of her "ask-a-question" presentation game, requiring the word "banana" to be stated in addition to the original terms of name and company, demonstrating the sense of keeping the scope fresh. As with the move underway to a new SCN gamification, these changes must be carefully designed, fully communicated, and regularly evaluated for impact. I would think change for change sake is a bad idea; keeping people involved, and altering their participation are good ideas. We'll need to see how well SAP pulls this off. I've been in a few conversations on this, and have missed others dues to conflicts.  Whatever the rules turn out to be, I think I will keep writing blogs here.

 

 

Session - TIBCO Software: Interactive discussion with Siemens Medical on how BPM saves lives

 

Billed as an "interactive discussion", this session met that capably, with but one slide on the screen during the majority of the time. Arranged as a casual interview, Ian Gotts and Tommy Richardson spoke about a Siemens software product built using TIBCO's tools. One example discussed (and demoed in a Flash video) was on hospital procedures around "MRSA", which I needed to Google - "Methicillin-resistant Staphylococcus Aureus". In business process terms, the treatment, isolation, and related phases need to be modeled, and that model needs to evolve based on metrics ("evidence-based medicine"); good software tools make this effort easier, faster, and more reliable. So the dialogue said.

 

There were good audience questions here, particularly around the staffing requirements - is the software to the point where IT does not need to be involved, how much IT do doctors need to know, and how much medicine does IT need to know, as well as how would smaller units administer this technology.

 

I can relate to the comment that "Doctors are smart people, they don't like computers telling them what to do", as it's much a question of trusting instinct as trusting the code. Medical practitioners are trained for years; maybe what was taught a decade or more ago has evolved.  Will "big data" help or hurt this field? I expect the next generation medical college graduates to be totally digital citizens, able to leverage technology far better than the rest of raised before this was so pervasive.

 

Image 3 below is from the video.

 

"The only place where Automation is ahead of Discovery... in the dictionary."

 

Session - Analyze your IT budget to identify savings opportunities


Jo Ann Rosenberger led the final session of the conference, with end-users only allowed. This one is as tricky to write about in a public space as is the one-on-one I had with Jo Ann the day before. As an employee of a company using enterprise software, it's not in my best interest to discuss ways of "lowering the bill" out loud. I'll touch on general concepts, rather than margins or profits.

 

You should look at your software portfolio for obsolete, redundant, or over-priced code.

 

I've been through this exercise, and know some of the challenges - finding all the bills, contracts, and fine print, knowing what people actually use vs what was purchased, and understating "work-alikes". As one example, suppose you had an entire suite of software (a "site license") and needed a third-party add-on that costs extra. What users need this?  How do you find out?  How do you measure use so that if there are runtime licenses instead of developer, you get the right deal?  Will "cloud" fix this, or obscure the picture?

 

One of the research results we saw was a list of which vendors were reported as conducting the most audits. With detailed terms such as underlying hardware constraints, user count allowances, and entity restrictions written into agreements, it's not hard to see how these may be overlooked later by those managing the deployments. Having been involved in an audit, I understand the pain imposed when a vendor springs these on a customer, sending in junior accounting types to verify the letter of the contract. That they don't know how the software works is an understatement. I think the takeaway here was not if, but when. 

 

There are ways to push back

 

I just can't tell you what they are.

 

 

 

 

Sandy Kemsley blog links

 

If it takes me a long time (hours, days, weeks) to post something, Sandy Kemsley accomplishes this in seconds or minutes. She'll post a blog during or immediately after a session.  I am just in awe at this massive parallel processing effort.  Her tweets during the conference:

 

 

 

Required reading. I'm not worthy.

 

Finally, Sandy and others had this conversation online.  Portions redacted to fit the SCN rules:

 

And @iangotts wins the prize for first bad word said from the #GartnerBPM conferences stage
RT @nitroxfrog: RT @skemsley: And @iangotts wins the prize for 1st bad word said from #GartnerBPM stage > surely not. it was only "********"
RT @sfrancisatx: @iangotts @nitroxfrog @skemsley in Canada that's a bad word, but not in Baltimore LOL. Should have used "********"

 

Sandy's Canadian; I'm from Baltimore...

 

p.s. Help Sandy get to SAP conferences - read this: http://www.column2.com/2013/04/maintaining-ethical-standards-as-an-industry-analyst-and-enterprise-consultant/

 

 

Wrap

 

After a week back in the office after a business process summit, what stands out for me?  Stray thoughts:

 

  • Business process expertise, and success, is hard.  Few do it well, and I'm not seeing anyone do it effortlessly.
  • Success stories tend to include vendor references, overlapping people work with automation. Discern them.
  • SharePoint is a piece of work, as is Visio.
  • SAP's penetration in this space isn't as complete as they say, or would like to have.
  • Despite obvious flaws in Jive's social software platform (as we know it here), Jive is big. SAP, not so much.
  • If you can get to one of these conferences, go for it. Bring business cards (my bad this time).

 

 

 

 


 

2013-04-04 08.30.19a.jpg

 

IMAGE ONE - Tchotchke - sense 1/wikipedia, sense 2/urban dictionary (pretty much OK for work)

 

2013-04-04 08.44.36a.jpg

 

IMAGE TWO - MY PROMPTITUDE SUMMARY - LEVEL 4 / SO CLOSE

2013-04-04 09.31.46a.jpg

 

IMAGE THREE -  MRSA PROCESS FLOW

This blog post, as part of this blog series, refers to the recently introduced Conditional Start feature in SAP NetWeaver BPM available with SAP NetWeaver 7.3 EHP 1 SP 06 and higher.

 

Introduction

This blog post refers to the recently introduced Conditional Start feature in SAP NetWeaver BPM available with SAP NetWeaver 7.3 EHP 1 SP 06 and higher.

As described in the blog post before, Conditional Start patterns are usually used in system centric scenarios, receiving and aggregating messages from other systems. Therefore, a quality of service has to be guaranteed to the systems with calling Conditional Start processes.

 

Guaranteed Message Reception

When using SAP NetWeaver BPM in a system-centric use case, there can be a problem that messages may be lost. When the message for starting a process instance and messages that will be consumed by an intermediate message event are sent within a small time frame, a message that is sent to the intermediate message event might be lost. This is because starting a process instance is an expensive and time consuming operation. During the process start the web service endpoint is not yet configured completely and the process instance cannot yet listen to the endpoint.


process-bootstrapping.png

Figure 1: Messages are getting lost during bootstrapping of traditional processes

When an external system sends messages at a high rate to an endpoint that is used for process start and correlation, this problem is even worse. The Conditional Start process feature is designed to manage this. SAP NetWeaver BPM recognizes the start of a Conditional Start process instance. During the start-up, messages, which are sent to the intermediate message event are saved until the instance is able to receive them, when:

 

  • they are sent to the same web service endpoint as the process instance that is currently starting
  • their payload does not satisfy the correlation condition of any running process instance listening to this webservice endpoint

 

When the process instance is ready to receive messages, the processing of all held messages continues. If their payload satisfy the correlation condition of the started process instance, they will be assigned to it. Otherwise they will start a new process instance themselves.

This also implies that messages that may not match the currently starting process instance, but will start a new process instance themselves, are also held, as SAP NetWeaver BPM cannot predict the correlation condition of a currently starting process instance. This is up to the process model and cannot be calculated having only the payload of the message that triggered the process start.

Guaranteed message reception for Conditional Start processes needs additional processing time compared to traditional processes and thereby has an overall impact on the performance of the BPM system.

 

Summary

When using Conditional Start, SAP NetWeaver BPM guarantees that all messages sent to a web service endpoint used by a Conditional Start process are either starting a new process instance or be consumed by an already running process instance. The functionality increases the overall processing time for a message.

This blog post, as part of this blog series, refers to the recently introduced Conditional Start feature in SAP NetWeaver BPM available with SAP NetWeaver 7.3 EHP 1 SP 06 and higher.

 


Dude, Where’s My Message?

Conditional Start processes use the same web service endpoint for the start event as well as for the intermediate message event by utilizing a reusable message trigger. Both events define restrictions (start condition or correlation condition) that define which messages to accept and which to reject. Sometimes it might not be clear at first sight what happened to a message that was sent to SAP NetWeaver BPM: Did it reach the system? Did it correlate with a process? Did it start another process instance? Or to put it short: Dude, where's my message?


For that purpose, logging was introduced to ensure traceability throughout the complete life cycle.

 

Duties of the Doorman: Accept or Reject

A message sent to the web service endpoint will be attempted to be correlated to a running process. In case the message payload does not satisfy any correlation condition or there is no process running, the system rejects it for correlation. Referring to the example of part 1 (Conditional Start: Introduction), the process might only be interested in colored pencils. If a message for a white pencil is sent to the system it will be discarded as white is obviously not a color

 

This event is written to the business log of the SAP NetWeaver Administrator, which can be accessed in the SAP NetWeaver Administrator by choosing Troubleshooting > Processes and Tasks > Business Logs (Quick link: http://host:port/nwa/bpm-bizlog).

 

figure01.png

Figure 1: Business log entry for a message that could not be matched to any process


Note that the container type is NOT_APPLICABLE and the container ID is 32x0 as there is no process (container) and subsequently no ID the business log entry could be mapped to.

 

Up to this point, there is no difference to traditional correlation. But Conditional Start goes one step further: As a next step, SAP NetWeaver BPM determines whether the message payload matches the start condition. If this is the case, another business log entry can be found indicating that a new process was started.

 

figure02.png

Figure 2: Business log entry for a newly started process


This time, the container type is PROCESS and the container ID corresponds to the ID of the started process. Hence, this information is also available in the Manage Processes application (http://host:port/nwa/bpm-processes).

 

figure03.png

Figure 3: Business log entry in the 'Manage Processes' application


Having this information at hand, it could easily be told whether an incoming message made it into the system or was already rejected at the door.

 

Received vs. Consumed - What’s the Deal?

Assuming that there is a running process and the message payload fulfills the correlation condition, it will be further processed. As explained in the documentation on the SAP help portal, SAP NetWeaver BPM differentiates between message receipt and message consumption. This is also expressed by two different events in the history/business log of a process.

 

figure04.pngFigure 4: Business log entries for a message that was received and consumed in the 'Manage Processes' application


As with any business log entry, this could also be monitored using the Business Log Viewer.

figure05.png

Figure 5: Business log entries for a message that was received and consumed in the 'Business Log Viewer'


The delay between the two entries depends on various factors such as the process state or the asynchronous processing of incoming messages. In case a message was expected to be consumed, but was not yet, SAP NetWeaver BPM provides a monitor to check the progress. High load or custom system configuration could increase the processing time and cause a delay in consuming the message. In order to find out, one could check the BPM Action Monitor, which is part of the SAP NetWeaver Administrator and can be accessed by choosing Troubleshooting > Processes and Tasks > BPM Actions (Quick link: http://host:port/nwa/bpm-actions).

 

figure06.png

Figure 6: The 'BPM Action Monitor' provides a look behind the scenes helping to identify delays in asynchronous processing


At a glance, an administrator sees the number of queued, failed or disabled actions plus SAP NetWeaver BPM configuration settings for asynchronous processing. In the case that an action has failed, the technical exception can be examined. After the maximum number of attempts, the action will be disabled and no longer being processed until explicitly being reset. This allows administrators to correct the underlying problem without having interferences before restarting the processing.

 

Note that Correlation/Conditional Start is not the only component creating BPM actions, hence other actions could be part of that list as well.

 

Hasta la Vista, Process!

One specialty of Conditional Start is the leftover message handling that was already mentioned in a part 1 (Conditional Start: Introduction). Upon process termination, every received but not consumed message will produce another business log entry highlighting this. As this information is logged in the context of a process, one will find it in the tab History in the Manage Processes application.

 

figure07.png

Figure 7: Business log entry for a message that was not consumed before process termination


Following the Conditional Start paradigm, such message will either correlate with another running instance or start a new instance if it fulfills the start condition (Duties of the Doorman: Accept or Reject).

 

In case an administrator suspects unexpected leftover messages for a process, a better approach might be formulating an advanced query using the Business Log Viewer.

 

figure08.png

Figure 8: Specifying an advanced query in the Business Log Viewer


Thereby all leftover messages and the corresponding processes can be determined.

 

Houston, We Have a Problem!

Conditional Start must allow a maximum of one process that is ready to receive messages for the used web service endpoint, for example, to enable the aggregator enterprise integration pattern. The pattern might was highlighted in part 2 (Conditional Start: Typical Examples). What’s worth mentioning is that the SAP NetWeaver BPM has a mechanism to detect this and prohibit further processing. So, in the unlikely event of multiple matches, a business log entry is written for each affected process allowing the administrator to analyze the situation, correct the problem and clean up the affected system.

 

figure09.png

Figure 9: A business log entry for multiple matches, which is prohibited for Conditional Start processes


Note that unlike the other business log entries mentioned so far, this one is logged with severity FAILURE instead of STANDARD to indicate the wrong usage of the Conditional Start pattern.

 

One More Thing: The Application Log

The business log should be the primary choice when tracing a message and its life cycle in the system. In case that’s not sufficient, SAP NetWeaver BPM provides additional means to increase supportability. Using the application log more detailed entries are immediately written for the category /Applications/BPM/Correlation.

 

Event Severity Text
Message received Info Message received on endpoint <E> was correlated with BPM process instance <P>.
Message received Info Message previously received on endpoint <E> and correlated with BPM process instance <P> was rolled back.
Message received Debug Message received on endpoint <E> cannot be correlated to a running BPM process instance of definition version <D> (compiled to use Correlation Adapter).
Message received Error Message received via endpoint <E> matched with multiple process instances (<P>, …, <P>) which is prohibited for 'Conditional Start' scenarios.
Message received Fatal The transaction identifying multiple matches in a 'Conditional Start' scenario was not rolled back, but successfully committed.
Message received Fatal Persisting business log entries for multiple matches in a 'Conditional Start' scenario failed: <E>
Message received Fatal Error while leaving the transaction level: <E>
Message consumed Info Message consumed by BPM process instance <P> via Intermediate Message Event <I>.
Message consumed Info Consumption of message by BPM process instance <P> via Intermediate Message Event <I> was rolled back.

Table 1: An overview of application logs provided for Correlation


As application logs are written without transactional scope, some log entries might be irrelevant when a certain transaction is rolled back.

Combining the application log and the default trace helps analyzing situations where side effects or preceding exceptions had an influence on Conditional Start. Both are part of SAP NetWeaver Administrator and can be accessed by choosing Troubleshooting > Logs and Traces > Log Viewer (Quick Link: http://host:port/nwa/logs).

 

Disclaimer: Navigation paths, quick links, log texts, figures or tables highlighted in this blog post might differ from actual SAP NetWeaver BPM installations.

More words, less pictures today.  I promise.

 

Yesterday, I said and did this: Gartner BPM Conference - will never be the same - day one

 

Today, I spent time on the "show floor", attended more sessions, and had an analyst "one-on-one" session. I almost missed that session, as it did not show up on my agenda on the Android app.  That's similar to what happens at ASUG/Sapphire with various one-off meetings such as Community Lounges, executive meetings and other non mainstream sessions. I needed to look for the mail confirmation to find it.  Fortunately, I also received an email notification at 15 minutes before the scheduled time, though if I had been heads down in a one-hour session I may have completely missed it.

 

2013-04-03 09.27.34a.jpg

The check-in was dead simple - hold your badge up to a scanner. No paper schedules, no line, no sweat. Finding "booth 12" required asking for directions (and you know the myth about guys and directions); as it turned out, there was no booth, only a small round table.

 

I'll leave out the Q&A for that session, and pass it on to my management.  As might be expected, I didn't get answers to all my questions, though I did get good pointers on followup research.

 

 

Session - Getting More Value From SharePoint

 

Since we use SharePoint, I picked this session to get a pulse on how others deploy it, what works, what doesn't, and what's coming. The speaker (Mark Gilbert) was excellent, knew his stuff, and had several trends to share. The size of data and hardware beneath a few landscapes generated a few tweets when I mentioned a 40 terabyte system.

 

@jspath55 "Are you ready for Big SharePoint?" - we're talking 40 TB plus ... #gartnerbpm

@twailgum RT @jspath55: "Are you ready for Big SharePoint?" - we're talking 40 TB plus ... #gartnerbpm >>is anyone ready for that?

@jspath55 @twailgum Gartner says that is real. I assume they (customer) are ready.

@twailgum @jspath55 that just seems like A LOT of SharePoint to manage/use, since even nominal SP installs can feel overwhelming. Interesting trend

@jspath55 @twailgum people are routinely *emailing* me files over 1 MB. Doesn't take long for an enterprise repository to grow huge. 10K+ users..

@oswaldxxl @twailgum @jspath55 perhaps more importantly, should they be?

@karin_tillotson RT @jspath55: @oswaldxxl @twailgum I think there's a big future in archiving from SharePoint. Cc @karin_tillotson”>> job security :-)

@twailgum @karin_tillotson good one. what's going to happen when SAP HANA for SharePoint + Duet Enterprise rolls out? cc @jspath55 @oswaldxxl

 

 

Hearing about issues of repository replication was useful to me, as the growth of more and more systems, getting larger and larger, is where users tend to see performance and use problems.  The suggestion of hedging your bets by putting content into several different versions makes limited sense; going to third parties to manage data has inherent risks, but as Microsoft doesn't handle this, you have few options.

 

In Social Networking, Microsoft's acquisition of Yammer sets up a situation similar to their absorption of Visio years ago.  It doesn't fit the Office suite exactly well, though it's getting better, and there's always the next upgrade to consider.

 

How does this fit with BPM? It seems there's a niche for SharePoint, positioned between an ERP system that has much structured data, and basic unstructured file repositories. You would not suck every legal document into ECC, nor would you necessarily put it into SharePoint, but the latter is better positioned to interact with email, documents and spreadsheets than the former.

 

 

LUNCH

 

I visited a few booths at lunch, chatting with fellow SAP Mentor Peter McNulty.  This shot is fuzzy, but I used the front camera lens rather than trying a blind trick shot.

 

2013-04-03 11.49.03a.jpg

 

Session - Microsoft: Microsoft Visio: Enabling Social, Mobile, and Cloud based BPM

 

This session did not live up to my expectations.  I had stopped at the MS booth to learn a bit about the connection between Visio and BPM, and gleaned a lot in a few minutes on the improvements from prior versions in exposing live data from back end systems into drawings. For me, that might be the amount of storage space used by different teams on different file systems.  For others, that might be operational data such as stock levels, project completion, etc.  This was covered in slides during the presentation (while the booth demo was working software).

 

The implication was Visio was better for light weight process control, which was an honest admission by the presenter (Chris Crane). I think it will have uses, but it looks like I'll need to get an upgrade, or go to the cloud version (shudder).

 

Unfortunately, the remainder of the presentation until Q&A was from a partner, and I not only struggled to see the slides, I failed to hear anything related to Visio during his portion.  If I had known that was going to happen, I would have ducked out for another topic.

 

The Q&A redeemed the session a bit, though the speaker was blunt about what were best practices and what was simply a bad idea ("load a million rows into a Viso drawing via a data connection - no don't do that"),  The suggestion of copying data from SQL Server to a spreadsheet before connecting that to Visio was odd, until one considers the data security might prevent other users seeing what you see.  More work, so you'd need to consider this solution carefully.

 

BPM? Well, I know Visio is used extensively.  It's cheaper than other flow chart solutions.  Does it walk and talk the BPMN code language?  I'm not certain it can do it all, though I think doing most of the work is much better than doing little of it.

 

 

 

2013-04-03 13.46.30a.jpg

 

2013-04-03 14.01.16a.jpg

 

Session - Streamlining Inpatient Flow Using Care Process Management

 

The Ottawa Hospital was chosen to talk about how they applied BPM techniques to patient care. Seems a bit dehumanizing, so they substituted "Care" for the "Business", and Cameron Keyes spoke about CPM rather than BPM. It was a compelling story, starting small, and building up to larger projects, in a short period of time, relatively.  They used mobile devices early (and well), they gathered lots of data, and iterated through changes.

 

One metric which generated a need for "fixes" was projections of the date when patients would be ready for discharge. Certainly they and their families want them out of care quickly, not to mention staff (and insurers), though clinicians wanted to ensure patient health over a basic numbers game (I'm paraphrasing and oversimplifying). An interesting chart shown was the amount of time under or over the estimates given. It looked like a Bell curve, except for minor aberrations.

 

The answer they came up with for the next phase was to postpone estimating a discharge date until patients were "medically stable". Seems clear in hindsight, but that's the kind of process improvement that must occur if something is built quickly (otherwise it's not in production and just costs more and more), and is flexible enough to be revised easily.

 

The speaker answered a question about mobile devices with a flat statement that this project would not have worked without it.

 

2013-04-03 14.53.29a.jpg

 

2013-04-03 15.05.07a.jpg

 

2013-04-03 15.20.17a.jpg

 

 

Session - Maverick Thinking: Automated Competition Using Scenario Based BPM

 

 

 

 

2013-04-03 15.48.40a.jpg

 

Jim Sinur talked about maverick thinking. His main theme was how machine intelligence will be altering the way things are done, which I believe, and that putting controls into place, is mandatory, which I certainly agree with.  He's extrapolating from current data, as a good analyst should. Yet, there are many ways the future could be shaped. He left out pressing issues such as climate change, energy shortfalls, and continued population growth in many parts of the world, unfortunately, narrowly focusing on what good technology can bring. rather than the side effects is may also cause.

 

 

 

Session - To The Point: Business Process Analysis: Pictures or Decisioning?

 

 

2013-04-03 16.46.58a.jpg

 

I stuck it out for one last 30 minute session at the end of the day. The theme was intended to challenge process modelers to produce something that works, rather than something that is pretty and may end up as wallpaper.

 

"All models are wrong, but some are useful." - George E. P. Box

 

David Norton also had a lot of great stories, throwing in logistics and OODA loops, along with BPM maturity levels, software license models (cloud?) and "technical stuff."  I've blotted out the Harvey Balls on the above shot, as I'm not sure I'm allowed to reproduce it.  Stay tuned for the Gartner "Market Scope" review of the purveyors of BPA and BPM tools.

 

 

What's next?

 

One more half day.

Agenda time

 

Though I'm primarily on the "technical side" of IT, it doesn't hurt to get better with the other side, so after several missed chances to attend the Gartner BPM conference, this year I've managed to get here.  It will never be the same. What follows are random thoughts on the conference, including the registration and agenda process, some networking, and a bit about business process management.  Since Gartner's analyses are proprietary, I'll be cautious about sharing anything from the famous magic quadrants.

 

Pre-conference registration was easier than most SAP events I've been to, though with fewer than 1,000 attendees, comparing the experience to those where over 10,000 attend isn't totally fair. As I'm local, I didn't need to deal with travel and lodging. I entered various personal profile details (industry sector, etc.), and was off to the races. The confirmation emails suggested an app for Android and iPad; with both in my tool kit I decided to go with the former on my phone. Installation was pretty easy.

 

The online agenda builder was not too hard to navigate, given I've used probably a dozen versions of similar tools over the years for ASUG, Oracle, and SAP events. Like SAP Tech-Ed hands-on sessions, one had to reserve attendance at analyst or round table meetings. These were partly full by the time I go to the agenda, and confirmation was a bit disjointed (but only took a few minutes).  Export to an email calendar was more challenging, with each of my session appointments appended into a single file.  Eventually I got MS Exchange to import these to my enterprise calendar.  Adding a session later left me with a dilemma - would importing the schedule again cause double booking? I could not find a single "save to calendar" button, so I gave up.

 

The Android agenda tool had high spots and low spots. On the high side, viewing the overall schedule, specific events, and speakers was quite smooth.  Adding items to the agenda was also dead simple - click the gray plus sign, and it turns into a green check mark. The icons showing "Registration required" or "Registered" are clear enough, given the small real estate dedicated.

 

The filter button resembles a sound board slider panel. What I was looking for was the filter to "show only my agenda"; it's not there, nor anywhere else I looked on the app. I gave up and just looked for the green checks.  Other low spots on the app were more than one crash (see Part One below), frequent log-outs, and a "Who's Here" roster that only included speakers or analysts.  It would have been nice to see other attendees listed somewhere.  Oh well, probably a privacy concern.

 

The lowest spot was my attempt to "tweet" from the app. The first session I tried this with overflowed the message buffer by 119 characters, and there was no way to edit the text! The second attempt, with text that fit, led to a series of authentication attempts. I received two different multi-digit codes, but no place to enter them. After the endearing but unhelpful message "Oh dear, something has gone awry" and another fault, I gave up.  There's probably a way to make this work simply. I would hope.

 

 

Enough preamble, on to the sessions, starting with the keynote.

 

Keynote

 

My mistake was reading the slides on the keynote beforehand, so many of the punch lines lost their impact. Overall, the theme was "Change is about politics, not right and wrong".  I stand by my tweet:

 

Tina Nunno doing the #gartnerbpm keynote - politics in the workplace. Interesting, not particularly illuminating. via.me/-b1gdbsu

 

 

Highlights from the keynote:

 

  • 'There is no such thing as a "happy surprise" to a high status individual.'
  • I'd call myself 'marginalized' from the sort-of-magic quadrant on political skills.
  • Enterprise decision making in a single flowchart - http://www.primarygoals.org/diagrams/decision-making/
  • I liked the example of culling printers by pitching the project as "green" - good for the planet, bypassing the "mine" tendency.
  • Manufacturing industries represented in higher numbers at the conference (where that sector had led in process improvement)

 

 

Session - The Future of Enterprise Social Networking

 

The weirdest part of the day had to be me looking at the iPad of the person sitting next to me at the keynote, where my Twitter bio was displayed. As it turns out, Mike Gotta, Gartner analyst of enterprise social software and moderator of the next session, was sitting next to me. I said "hey, that's me" and we shook hands. I didn't know at the time who he was.  Now, I'm following @MikeGotta.

 

We went around the table, introducing ourselves and which social media tools are within our respective networks. I was surprised to hear a few companies running Jive (though which version wasn't clear). It's one of the leaders; big companies like Oracle, IBM and Microsoft are on the map, but I didn't see SAP.  Maybe I missed it.

 

We talked about Microsoft's evolution, and the puzzling spot they are in with Yammer, Jabber, Lync, and I'm not sure what else.  I gotta do my own homework here, as SharePoint doesn't have enough fire power for what it could do.  There was also a thread on security concerns, where photos uploaded to the work network ruffled feathers.  Virus and malware attacks have many vectors; I'd think it was the IT department's job to get this to work. The normal answer seems to be that it's easier to ban the behavior than enable it.

 

Other areas to look into (without giving away the Gartner views):

 

  • Newsgator
  • K2
  • Dropbox (for the enterprise)
  • Skydrive

 

Session - Getting Started with Modeling, Analysis and Measurement

 

Have you heard about the restaurant opened by a chicken and a pig? I had, and I won't spoil the punch line for you.  The speaker, David Norton, used these creatures in his talk, starting with getting most of the audience on their feet clucking and oinking. One story he told (and there were plenty of good ones) was the Canon company buying a suitcase to use as the target form factor for a portable copier.

 

Books referenced:

 

  • Improving Performance: How to Manage the White Space on the Organization Chart [link]
  • Seizing the White Space [link]

 

I liked the example of a simulation model of a warehouse, available to a supervisor as a mobile app, that reveals whether loss of a single fork lift would hinder the work shift. Very real world, very focused app, though no references I saw.  Another good example was trying to use supermarket checker scanning speed as a quality metric, where customers might be happier to have the food handed over in an orderly fashion.

 

David spent time covering various tools, such as "Automated Business Process Discovery", which can be run against, say, an SAP Enterprise system, to reverse engineer a process model based on the "as built" state of the software.

 

Session - SAP: Bank of America Shares Their Success with SAPs BPM Suite

 

Peter McNulty (Peter McNulty ) spoke with John Cuomo on the intricacies of NetWeaver's BPM tool suite. With analyst Sandy Kemsley sitting 2 rows behind me at the session, I defer to the expert.  Read her post:

 

 

 

Her tip after the session was to check out "Disco" - fluxicon.com/disco/ (also follow @fluxiconlabs).

 

 

Session - To The Point: Shedding Light On Your Dark Processes for Profit and Compliance

 

 

To end the day, I sat in a 30 minute session with the intriguing title listed. Basic premise: "You can't manage what you can't see" - different than the other old saw - "you can't improve what you can't measure" but with a subtle difference. I was hoping to hear more specific examples of these hidden dangers. One that stuck out was blocking customers with specific cosmetic issues, assuming that not fixing the condition implied an inability to pay bills (I'm obfuscating a bit to keep this from veering off on a bizarre tangent).

 

Jim Sinur was an interesting speaker, with too much material for the time allotted.  He believes studying "dark processes" will grow with improvements in data mining.  I also worry about Big Brother. We shall see.

 

 

Firms to look into:

 

 

Tomorrow?

 

 

Another day.

 

Images

 

2013-04-02 08.56.37a.jpg

2013-04-02 15.42.15a.jpg

 


Part One

device-2013-04-01-155519a.png

 

device-2013-04-01-155622a.png

 

device-2013-04-01-155652a.png

device-2013-04-01-155808a.png

device-2013-04-01-155808b.png

 

 

 

 

 

 


Part Two

device-2013-04-02-151825a.png

device-2013-04-02-191438a.png

 

device-2013-04-02-151855a.png

 

device-2013-04-02-151918a.png

 

device-2013-04-02-151944a.png

device-2013-04-02-152409a.png

This blog post, as part of this blog series, refers to the recently introduced Conditional Start feature in SAP NetWeaver BPM available with SAP NetWeaver 7.3 EHP 1 SP 06 and higher.

 

It describes the advanced usage scenarios of Conditional Start, which are enabled by modifying the correlation criteria for the start event. For a basic example of Conditional Start usage, please, take a look at part 1. For general information, you can refer to Conditional Start documentation on the SAP help portal.

 

 

Example Process

The scenarios are based on a simple conditional start process for gathering a given number of pencils of the same color and packaging them, once the number of expected pencils is reached. The process consists of the following modeling elements:

 

  • Data object PencilColor - initialized during process instance start and used in the correlation condition of the intermediate message event
  • Data object NumberOfPencils - initialized during process start and value decreased each time a pencil is processed
  • Start event - triggered by process start and initializes the PencilColor and NumberOfPencils data objects
  • Mapping activity Decrease NumberOfPencils - used to decrease the number of expected pencils by one
  • Exclusive choice gateway - based on the current value of NumberOfPencils decides if there are more pencils to gather, or the process may proceed to the packaging activity
  • Intermediate message event (IME) - triggered by incoming message, which correlates with the already expected color (e.g., PencilProcessedOperation/color = PencilColor)
  • Automated activity Package the gathered pencils - sending a message once the expected number of pencils is reached
  • End event - triggered when the process is about to complete

 

Scenario 1 - Having Unrestricted Correlation Condition in the Start Event

For this scenario, the correlation condition of the start event is set to true. This means, if there is no running Conditional Start process instance, which is able to consume the incoming message, a new process will be started. The table below illustrates the exemplary execution of the process.

 

ConditionalStart_scenario1.jpg

Sending message #1:

 

Message Payload
Running Process Instances
Handled by Process Instance
Number of Remaining Pencils
<message_payload>
  <pencilColor>BLUE</pencilColor
  <numberOfPencils>3</numberOfPencils> 
</message_payload>
--2
Description of Behavior
  • The message is received
  • There is no running process instance, which can consume the message
  • New Conditional Start process instance is started
  • NumberOfPencils is set to 3
  • PencilColor is set to BLUE
  • The activity Decrease NumberOfPencils decreases the value of NumberOfPencils by 1
  • The value of NumberOfPencils is 2, so the process does not yet continue to the packaging activity, but is waiting on the IME

 

Sending message #2:

 

Message Payload
Running Process Instances
Handled by Process Instance
Number of Remaining Pencils
<message_payload>
  <pencilColor>BLUE</pencilColor> 
  <numberOfPencils>3</numberOfPencils> 
</message_payload> 
BLUE pencils process instanceBLUE pencils process instance1
Description of Behavior
  • The message is received
  • The message correlates with the condition of BLUE pencils process instance IME and is consumed by the process
  • The activity Decrease NumberOfPencils decreases the value of NumberOfPencils by 1
  • The value of NumberOfPencils is 1, so the process does not yet continue to the packaging activity, but is waiting on the IME

 

Sending message #3:

 

Message PayloadRunning Process Instances
Handled by Process Instance
Number of Remaining Pencils
<message_payload>
  <pencilColor>RED</pencilColor>
  <numberOfPencils>3</numberOfPencils> 
</message_payload> 
BLUE pencils process instance-2
Description of Behavior
  • The message is received
  • There is no running process instance, which can consume the message
  • New Conditional Start process instance is started
  • NumberOfPencils is set to 3
  • PencilColor is set to RED
  • The activity Decrease NumberOfPencils decreases the value of NumberOfPencils by 1
  • The value of NumberOfPencils is 2, so the process does not yet continue to the packaging activity, but is waiting on the IME

 

Sending message #4:

 

Message PayloadRunning Process Instances
Handled by Process Instance
Number of Remaining Pencils
<message_payload> 
  <pencilColor>GREEN</pencilColor>
  <numberOfPencils>3</numberOfPencils> 
<message_payload>

BLUE pencils process instance

RED pencils process instance

-2
Description of Behavior
  • The message is received
  • There is no running process instance, which can consume the message
  • New Conditional Start process instance is started
  • NumberOfPencils is set to 3
  • PencilColor is set to GREEN
  • The activity Decrease NumberOfPencils decreases the value of NumberOfPencils by 1
  • The value of NumberOfPencils is 2, so the process does not yet continue to the packaging activity, but is waiting on the IME

 

Sending message #5:

 

Message PayloadRunning Process Instances
Handled by Process Instance
Number of Remaining Pencils
<message_payload> 
  <pencilColor>BLUE</pencilColor> 
  <numberOfPencils>3</numberOfPencils> 
</message_payload> 

BLUE pencils process instance

RED pencils process instance

GREEN pencils process instance

BLUE pencils process instance0
Description of Behavior
  • The message is received
  • The message correlates with the condition of BLUE pencils process instance IME and is consumed by the process
  • The activity Decrease NumberOfPencils decreases the value of NumberOfPencils by 1
  • The value of NumberOfPencils is 0, so the process proceeds to the packaging activity and afterwards completes

 

Sending message #6:

 

Message PayloadRunning Process Instances
Handled by Process Instance
Number of Remaining Pencils
<message_payload>
  <pencilColor>BLUE</pencilColor> 
  <numberOfPencils>3</numberOfPencils> 
</message_payload>

RED pencils process instance

GREEN pencils process instance

-2
Description of Behavior
  • The message is received
  • There is no running process instance, which can consume the message
  • New Conditional Start process instance is started
  • NumberOfPencils is set to 3
  • PencilColor is set to BLUE
  • The activity Decrease NumberOfPencils decreases the value of NumberOfPencils by 1
  • The value of NumberOfPencils is 2, so the process does not yet continue to the packaging activity, but is waiting on the IME

 

Scenario 2 - Having Strict Correlation Condition in the Start Event

For this scenario the correlation condition of the start event is set to PencilProcessOperation/color != "red". In this case, if there is no running Conditional Start process instance, which is able to consume the incoming message, a new process will be started only if the condition correlates, e.g,. if the pencil color is not red. The table below illustrates the exemplary execution of the process. 

 

ConditionalStart_scenario2.jpg

Sending message #1:

 

Message Payload
Running Process Instances
Handled by Process Instance
Number of Remaining Pencils
<message_payload>
   <pencilColor>BLUE</pencilColor>
   <numberOfPencils>3</numberOfPencils>
</message_payload>
--2
Description of Behavior
  • The message is received
  • There is no running process instance, which can consume the message
  • New Conditional Start process instance is started
  • NumberOfPencils is set to 3
  • PencilColor is set to BLUE
  • The activity Decrease NumberOfPencils decreases the value of NumberOfPencils by 1
  • The value of NumberOfPencils is 2, so the process does not yet continue to the packaging activity, but is waiting on the IME

 

Sending message #2:

 

Message Payload
Running Process Instances
Handled by Process Instance
Number of Remaining Pencils
<message_payload>
  <pencilColor>RED</pencilColor> 
  <numberOfPencils>3</numberOfPencils> 
</message_payload>
BLUE pencils process instance--
Description of Behavior
  • The message is received
  • There is no running process instance, which can consume the message
  • The message does not correlate with the Start Event condition and is discarded (deleted without further notice to the sender)

 

Sending message #3:

 

Message Payload
Running Process Instances
Handled by Process Instance
Number of Remaining Pencils
<message_payload>
  <pencilColor>BLUE</pencilColor> 
  <numberOfPencils>3</numberOfPencils> 
</message_payload> 
BLUE pencils process instanceBLUE pencils process instance1
Description of Behavior
  • The message is received
  • The message correlates with the condition of BLUE pencils process instance IME and is consumed by the process
  • The activity Decrease NumberOfPencils decreases the value of NumberOfPencils by 1
  • The value of NumberOfPencils is 1, so the process does not yet continue to the packaging activity, but is waiting on the IME

 

 

Scenario 3 - Best Practices

This scenario is almost the same as the first one, with one significant difference - there is an extra human activity step at the end.

 

ConditionalStart_scenario3.jpg

 

This activity, as well as any other source of delay, could have a significant impact on the process execution. Have a look at the following scenario:

 

  • 3 messages about BLUE pencils are received
  • New Conditional Start process instance is started and consumes the messages
  • All required messages are received and consumed, so at the gateway we proceed to the Package the gathered pencils activity
  • Once it completes, we proceed to the Check package human activity

 

At this point, the process basically waits for a human interaction and all further incoming messages about BLUE pencils will be gathered by the IME, but not consumed by the currently started process instance.


Once the human activity completes, the gathered messages will be further processed and consumed by the newly started process instance. However, this can lead to delays and it is considered as a best practice to use the correlation condition in order to directly start a new process instance, once the currently active process instance gathers all required messages.

 

There are different ways to do this, one is to use a custom flag in the correlation condition of the IME:

 

(PencilProcessedOperation/color = PencilColor) AND stillGatheringMessages

 

The flag stillGatheringMessages can be set to true in the start event and once all required messages are received can be set to false in the Decrease number of pencils mapping activity. In this way, all further messages about BLUE pencils will no longer correlate with the IME correlation condition and a new process instance will be started, which will then in parallel gather and consume the incoming messages.

 

Conclusion

Conditional Start is a very powerful feature in SAP NetWeaver BPM. Choosing the correlation condition is an important part of the Conditional Start fine tuning. Changing the correlation condition cannot only affect the number of started processes, but also lead to discarded messages.

This blog post, as part of this blog series, refers to the recently introduced Conditional Start feature in SAP NetWeaver BPM available with SAP NetWeaver 7.3 EHP 1 SP 06 and higher.

 

This blog post refers to the recently introduced Conditional Start feature in SAP NetWeaver BPM available with SAP NetWeaver 7.3 EHP 1 SP 06 and higher. As mentioned in the previous blogs of this blog series the aggregator pattern is one of the most common use cases of conditional start processes. This article will show three variants of this pattern and discuss their peculiarities. In general, a process implementing the aggregator pattern collects messages till a certain situation is reached. How this situation is reached is different between the variants.

 

Aggregation Pattern with Counter

The scenario introduced in the previous blog entries (depicted again below) is an example of this variant. The messages are collected till a certain number of messages are received and consumed. For detailed information on this variant refer to Conditional Start: Introduction (1/7).

Aggregation With Counter.png

 

Peculiarities and Pitfalls

It cannot be guaranteed that the messages are consumed in the same order as they are received. Especially if the messages are received in very quick succession, it is likely that they are not processed in the same order. For example, if our process gets four messages seperated by fractions of a second for Pencil_A, Pencil_B, Pencil_C and Pencil_D in this order, there is still a chance that one process only consumes the three messages for Pencil_D, Pencil_C and Pencil_B while the message for Pencil_A will be consumed by the next process instance.

In this scenario, processing the messages in the same order as they have been sent, can be achieved if the timespan between the single messages is long enough. If so, the process can successfully receive and process the message before the next message is sent. If a save delay between the single messages is unwanted but in order processing is still required, this can be achieved by providing the necessary logic within the process. In this case, the process should collect all messages (Pencil_D, Pencil_C, Pencil_B and Pencil_A) until all required messages are received (Pencil_C, Pencil_B and Pencil_A) and then resend those messages, which should not have been received (Pencil_D).
In the above example, the process would receive and consume the messages for Pencil_D, Pencil_C, Pencil_B and Pencil_A and store all necessary data. After the Pencil_A message was received, the process has to identify that all required messages are received and stop the collection of messages. Then the unwanted message for Pencil_D has to be resent using an automated activity, before proceeding with process steps for the wanted pencils. The following image shows how this process can look like.

Aggregation With Counter In Order.png

 

Aggregation Pattern with Timer

In this variant, the collection of messages will be stopped when a certain point in time is reached or after a certain timespan has passed.

Suppose a scenario where the pencils should be collected till the first day of the month is reached. After this, the batch should be sent to the packaging department as a whole. The process representing this scenario collects messages till the intermediate timer event is triggered, which will cause the collection loop to exit.

AggregationWithTimer.png

 

Peculiarities and Pitfalls

Also here, processing the messages in order is not guaranteed. In addition, it is necessary to pay close attention to the fact that the messages are not received in real time by the process.

This means that a message, which is sent very close to the trigger time of the intermediate timer event might only be received by the system but not by the process. This message will then not be consumed by the process even though the system will show a reception timestamp for the message, which is prior to the triggering of the timer event.

If it is necessary to collect all messages that have been received by the system till a certain point in time, this can be achieved by selecting the trigger time for the intermediate timer event a little longer than wanted. This might result in the collection of messages that were only received after the actual wanted collection time. These messages can however be avoided if the payload contains a timestamp and the correlation condition is set to not correlate those messages or compensated by resending them with an automated activity.

 

Aggregation Pattern with End Message

In this variant the collection of messages is stopped by the reception of a dedicated end message.

Suppose a scenario where pencils should be collected till the packaging department signals that it wants to pull the next batch. Then all collected pencils are sent to packaging.The process representing this scenario contains an event-based choice, which will either consume the message for the next pencil or stop the collection by consumption of the stop message.

Aggregation With End Message.png

 

Peculiarities and Pitfalls

As in the other variants, in order processing and real time processing are not guaranteed.

This means that it can happen that a message, which was supposed to be correlated, has only been received by the system but not consumed by the process when the stop message is processed.

For example, if the system gets messages for Pencil_A, Pencil_B, Pencil_C and Stop in that order, there is still a chance that the process consumes only the stop message while the messages for the pencils will be consumed by the next instance.

To avoid unwanted behavior it should be assured that the time between the correlation and stop messages is long enough and the system has the necessary performance and configuration to process the correlation messages in this time.

In this blog post series the new Conditional Start feature in SAP NetWeaver BPM will be introduced. It is available with SAP NetWeaver 7.3 EHP1 SP 06 and higher. The series consists of seven single blog posts.

 

The first blog post Conditional Start: Introduction (1/7) introduces the Conditional Start feature and describes a simple process, which makes use of it, following a so-called Aggregator Pattern. This conditional start process will be used as a running example throughout the different blog posts of the series.

 

Different variants of the Aggregator Pattern exist and are explained in the blog post Conditional Start: Typical Examples (2/7). In addition, the peculiarities and pitfalls for each variant are pointed out.

 

A more advanced usage scenario of the Conditional Start feature is described in the blog post Conditional Start: Deep Dive (3/7).

 

Conditional Start processes are making use of a specialized handling of messages. Therefore, advanced monitoring capabilities are available, which are described in the blog post Conditional Start: Monitoring (4/7).

 

The behavior of near-simultaneous message reception during the start of a conditional start process is shown in blog post Conditional Start: Under the Hood (5/7).

 

In some special cases, messages - intended to be consumed by a conditional start process - can be discarded and will not be consumed. The blog post Conditional Start: Discarded Messages (6/7) explains these special cases in detail.

 

The blog series ends with a blog post Conditional Start: Some Restrictions (7/7) describing the restriction of the Conditional Start feature.

This blog post, as part of this blog series, refers to the recently introduced Conditional Start feature in SAP NetWeaver BPM available with SAP NetWeaver 7.3 EHP 1 SP 06 and higher.

 

 

Running Example

This blog post uses a simple scenario as an example: One division of a stationery manufacturer produces graphite pencils [1]. Factory workers manually choose ten graphite pencils and separate them into bins on a conveyor belt so that they can be packed by a machine.

Conditional Start

In SAP NetWeaver BPM a web service endpoint is represented by a reusable message trigger. A process uses the so-called Conditional Start feature, if the same message trigger is used in the start event and in at least one intermediate message event of the process. Processes that are making use of the Conditional Start feature are referred to as conditional start processes in the following. For a running instance of a conditional start process it is defined that messages with matching correlation criteria will be received by the intermediate message event. In case there is no running process instance with matching correlation criteria, the message will be received by the start event - given the start condition is satisfied - thereby spawning a new process instance. For further information, see also help.sap.com -> Conditional Start.

In the exemplary scenario: In case no bin exists that can consume graphite pencils, a new bin will be provided. The newly provided bin will then be able to take another nine graphite pencils until it is full. The graphite pencils of the filled bin can then be packaged. Again a new bin for the next pencil will be provided and so on. The described behavior is related to the so-called Aggregator Pattern - an Enterprise Integration Pattern - which is described in more detail in [1].

Specialized Leftover Message Handling

SAP NetWeaver BPM differentiates between message reception and message consumption. For further information see also help.sap.com -> Correlation for Intermediate Message Events. This means that process instances can receive an arbitrary number of incoming messages that match the defined correlation condition. However, the already received message must not be necessarily consumed before the process completes or terminates.

 

In non-conditional start processes the consumption of each received message is not guaranteed and not yet consumed messages are discarded upon process completion. The behavior of not yet consumed messages differs for conditional start processes. These messages are not discarded but handled appropriately: Not yet consumed messages are resent to the same web service endpoint again upon process completion/termination. In case that there is no running process instance of the same process definition with matching correlation criteria, the message shall be consumed by the message Start Event (given the start condition is satisfied). Again a new process instance of the current active definition is spawned. For further information see also help.sap.com -> Conditional Start. When a process instance of the same definition is running, the messages are provided to the running process instance (given the correlation condition is satisfied).

 

Example: An already running conditional start process instance is able to consume three messages. Three messages are sent to its web service endpoint and are consumed by the intermediate message event of the process instance. The process flow of the process instance continues and it takes some time until the process completes. During this time another two messages are sent to the web service endpoint and are received by the Intermediate Message Event but will not be consumed. When the process instance finally completes and terminates, these two messages are resent. The first resent message will spawn a new process instance. The second resent message will be consumed by the intermediate message event of the newly spawned process instance.

Model the scenario with SAP NetWeaver BPM

The explained scenario can be modeled as a simple conditional start process in BPMN using the process composer. In the process model, the graphite pencils are represented by messages sent to the web service endpoint. The graphic pencils are identified by an id, named graphite pencil ID.

 

However, the concepts explained in the following example can be easily mapped to other scenarios, e.g., in a purchase order scenario in which a customer can collect ten different graphite pencils - the order items - in a web shop. The different order items are then aggregated in the backend by a process and sent to the supplier.

 

The conditional start process model implementing the scenario is shown in Figure 1. The model details can be found at the end of this blog post.

ConditionalStartProcess.png
Figure 1 - Process model implementing the exemplary scenario

 

Assume that no process instance of this conditional start process model is running on the process server. When a new message containing the pencil ID - representing a new unique graphite pencil - arrives at the process server a new process instance is spawned. The start event then consumes the message and temporarily saves the pencil ID in the CurrentPencilID data object. After that, the mapping activity AggregateCurrentPencilID concatenates the CurrentPencilID with a data object AggregatedPencilIDs containing the already aggregated pencil IDs.

 

The first message consumed by the Start Event also contains the number of messages (pencils) to aggregate, i.e., the size of the bin. This number is temporarily saved in the data object NumberOfPencilsToAggregate. The next Mapping Activity decreases this number by 1. The subsequent exclusive choice gateway checks the number. If the number is greater than zero, the process can consume further messages, i.e., the bin is not full. In this case the process flow follows the AggregateNextPencil edge of the gateway.

 

The intermediate message event then consumes the next message and saves the provided pencil ID again in the data object CurrentPencilID. Subsequently, the mapping activity AggregateCurrentPencilID aggregates the CurrentPencilID with the already aggregated pencil IDs in the AggregatedPencilIDs data object. Again the NumberOfPencilsToAggregate is decreased by 1. In case that the number has reached zero, i.e., the bin is full, the process flow follows the AllPencilsAggregated edge. An Automated Activity PackagePencils sends the aggregated pencil IDs stored in the AggregatedPencilIDs data object to a web service endpoint, i.e., the pencils are packaged by the supplier.

 

Table 1 shows the content of an exemplary process execution. The start message is consumed by the start event and the NumberOfPencilsToAggregate provided by the start message is 3. The pencil ID encapsulated in the payload of the start message is pencil_B, subsequent messages consumed by the intermediate message event contain the pencil IDs pencil_A and pencil_C in its payload.

 

 

CurrentPencilID
AggregatedPencilIDs
pencil_Bpencil_B
pencil_Apencil_B pencil_A
pencil_Cpencil_B pencil_A pencil_C

Table 1 - Content of the AggregatedPencilIDs data object after three consumed messages

 

Note: The aggregation of the CurrentPencilID in the data object AggregatedPencilIDs as a space separated list is only done for simplification reasons. In real scenarios a complex type should be created which can hold an arbitrary number of CurrentPencilIDs.

 

So far, it is assumed that only graphite pencils are considered by the process model. However, if the process model should distinguish between different colors, i.e., aggregating pencil IDs from pencils of a specific color, the color can be defined as a correlation condition of the intermediate message event. For more information see blog post Conditional Start: Deep Dive (3/7).

 

Process Model Details

The following section describes the details of the exemplary process model, which are important to model the process.

Web service

Create a new Conditional Start WSDL file ConditionalStart.wsdl. For your convenience you can copy the following WSDL content and paste it in the newly created file.

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://www.example.org/ConditionalStart/" 
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
name="ConditionalStart" targetNamespace="http://www.example.org/ConditionalStart/">           
     <wsdl:types> 
          <xsd:schema targetNamespace="http://www.example.org/ConditionalStart/"> 
               <xsd:element name="ConditionalStartOperation"> 
                    <xsd:complexType> 
                         <xsd:sequence> 
                              <xsd:element name="numberOfPencilsToAggregate" type="xsd:int"></xsd:element>
                              <xsd:element name="pencilID" type="xsd:string"></xsd:element>
                         </xsd:sequence>
                    </xsd:complexType>
               </xsd:element> 
          </xsd:schema>
     </wsdl:types> 
     <wsdl:message name="ConditionalStartOperationRequest">
          <wsdl:part element="tns:ConditionalStartOperation" name="parameters"/>
     </wsdl:message>
     <wsdl:portType name="ConditionalStart">
          <wsdl:operation name="ConditionalStartOperation">
               <wsdl:input message="tns:ConditionalStartOperationRequest"/>
          </wsdl:operation>
     </wsdl:portType>
     <wsdl:binding name="ConditionalStartSOAP" type="tns:ConditionalStart">
          <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" /> 
               <wsdl:operation name="ConditionalStartOperation">
                    <soap:operation soapAction="http://www.example.org/ConditionalStart/ConditionalStartOperation" /> 
                    <wsdl:input>
                         <soap:body use="literal" />
                    </wsdl:input> 
               </wsdl:operation> 
</wsdl:binding>
     <wsdl:service name="ConditionalStart">
          <wsdl:port binding="tns:ConditionalStartSOAP" name="ConditionalStartSOAP">
               <soap:address location="http://www.example.org/"/>
          </wsdl:port>
     </wsdl:service>
</wsdl:definitions>

 

 

The WSDL file contains an operation ConditionalStartOperation with two parameters pencilID and numberOfPencilsToAggregate.

Message Trigger

Create a new message trigger ConditionalStartTrigger and select the just created web service as shown in Figure 2.

NewMessageTrigger.png
Figure 2 - Creation of new message trigger


Process Model

Model the process ConditionalStartProcess as shown in Figure 1. Refer to the following sections for modeling details of the process model.

Data Objects

Ensure that the data object CurrentPencilID as well as the data object AggregatedPencilIDs is of type string and the data object NumberOfPencilsToAggregate is of type int.

Message Trigger

For the start and intermediate message event select the same message trigger ConditionalStartTrigger. This will enable the Conditional Start feature implicitly.

Start Event

The NumberOfPencilsToAggregate has to be set once during process start via the start message. The first start message already contains a pencilID to be aggregated in its payload. Therefore the input values of the start message have to be mapped in the output mapping of the start event, to the data objects of the process context, as shown in Figure 3.

StartEventMapping.png
Figure 3 - Start event output mapping

 

For further concatenation operations it is important that the AggregatedPencilIDs data object is initialized here by adding a simple function of an empty string to it:

 

"" 

 

Optionally a space can be added to the CurrentPencilID data object of the process context, such that the pencil IDs are separated by spaces in the AggregatedPencilIDs data object. Therefore, add a function to the CurrentPencilID data object:

 

concat(ConditionalStartOperation/pencilID, " ") 

 

Mapping Activity AggregateCurrentPencilID

The aggregation of the CurrentPencilIDs takes place in the mapping activity AggregateCurrentPencilID. The data objects of the process context have to be mapped as shown in Figure 4.

AggregateMapping.png
Figure 4 - Mapping of mapping activity AggregateCurrentPencilID

 

To enable the mapping, a function needs to be added to the AggregatedPencilIDs data object on the right hand side:

 

concat(AggregatedPencilIDs,CurrentPencilID) 

 

Due to the already added space to the CurrentPencilID, the function will lead to a space separated list of pencil IDs.

Mapping Activity DecreaseNumberOfPencilsToAggregate

To decrease the NumberOfPencilsToAggregate once a message is consumed either by the Start or the intermediate message event, the mapping activity DecreaseNumberOfPencilsToAggregate is needed. Define the activity by mapping the NumberOfPencilsToAggregate data object as shown in Figure 5.

DecreaseMapping.png
Figure 5 - Mapping of mapping activity DecreaseNumberOfPencilsToAggregate

 

In addition, add the following function to the NumberOfPencilsToAggregate data object on the right hand side:

 

NumberOfPencilsToAggregate - 1 

 

The function will decrease the number of pencils to aggregate by 1.

Exclusive Choice

To decide whether all pencil IDs are aggregated or not, set the conditions for the exclusive choice as shown in Figure 6.

ExclusiveChoiceConditions.png
Figure 6 - Conditions of exclusive choice gateway

 

If NumberOfPencilsToAggregate > 0 holds true, the edge AggregateNextPencil will be followed. If no further pencils are expected to be aggregated, the edge AllPencilsAggregated will be followed.

Intermediate Message Event

The Correlation Condition of the intermediate message event can be set to

 

true 

 

because only messages for graphite pencils are sent to the endpoint.

A message sent to the intermediate message event also contains a pencilID to be aggregated in its payload. Therefore the input values of the message have to be mapped in the output mapping of the intermediate message event to the data objects of the process context, as shown in Figure 7.

IMEMapping.png
Figure 7 - Intermediate message event output mapping

 

As for the start event, a space can be added optionally to the CurrentPencilID data object of the process context, such that the pencil IDs are separated by spaces in the AggregatedPencilIDs data object. Therefore, add a function to the CurrentPencilID data object:

 

concat(ConditionalStartOperation/pencilID, " ") 

 

The NumberOfPencilsToAggregate has to be set once during process start via the start message. Thus, a mapping is not needed here.

Automated Activity PackagePencil

The automated activity PackagePencil can have any web service interface, which could make use of the AggregatedPencilIDs data object for instance. Also, a notification activity can be used here.

 

[1] http://scn.sap.com/community/process-orchestration/blog/2012/10/11/enterprise-patterns-in-process-orchestration-aggregator

This is a last call to ASUG members who want to sign up for the Webcast I'll be giving next Monday.

It's a 'sneak preview' of some of the outstanding sessions at ASUG Annual Conference in the workflow track (conveniently co-located with SAPPHIRE).


If you've built or described a workflow using SAP Business Workflow, SAP NetWeaver BPM or Process Observer, then you can reap the benefits with Operational Process Intelligence sapopint built on HANA. This session shows you how.


Details, including the registration link can be found here: http://www.asug.com/events/detail/Intelligence-Into-Process-Operations

 

Sincere apologies to those of you not in this user group who cannot join us, but there are other great user groups out there and SAP can repeat these interactive sessions for other user groups, as they have done already for VNSG (Dutch) and DSAG (German-speaking) user groups.

 

If your company uses SAP software, and you are not in a user group, then you probably can join by simply contacting the regional user group directly who will know if your company is always a member.

 

And user groups do offer fun events... such as being chased around by huge prehistoric birds (fond memories of the Dutch annual conference last year).

 

VNSG2012PrehistoricBirds.png

So do make the effort to see if your company has already joined. And if you are already in ASUG, I look forward to hearing your questions and suggestions to what I present about sapopint on Monday.

 

Filter Blog

By author:
By date:
By tag: