Skip to Content

Netweaver BPM 7.3 API

Netweaver 7.3 is next major release from an overall product point of view.

There have many blog post especially from Aviad Rivlin which you can follow for all the upcoming features especially from NW 7.3 EP point of view.

From BPM perspective the one real feature that stands out is the access to the BPM API. Earlier the BPM process could only be raised through the invocation of Event Trigger assigned to start event in the process. Now there is no need to invoke the web service, you can simply invoke the process using the api.

For this blog we would cover an invocation of a very simple BPM process from a web page. You can extend it to fit your need.

Project Setup

1.  Create a BPM DC with a simple process. Create WSDL with an input attribute “in” in the BPM, attach this WSDL as the message trigger to the Start Message in the BPM process. Map the input of the start message to the Automated Task ( Can be any task, Automated task taken here for the sake of simplicity ) output. Build and deploy the application.

2.  *Develop EJB, WAR projects under an EAR projects. Add dependencies tc/bpem/facade/ear to both EJB and EAR projects. *

1.  In EJB project create a class called BPMConstants and put down these details

public class BPMConstants {

      

       public static String in = “in”;

      

       public static String bpmPackage = “yourcompany.com”;

       public static String bpmName = “your_deployed_bpm_name”;

       public static String bpmProcessName = “your_process_name”;

}

 

 

2. Create another class called BPMUtilClass which would finally raise the process.

 

public class BPMUtilClass {

 

   public void bpmUtilFunction(ProcessInitiateDTO dto) {

          try {

                 ProcessDefinitionManager pdefmgr = BPMFactory

                               .getProcessDefinitionManager();

                 ProcessDefinition pdef = pdefmgr.getActiveProcessDefinition(

                               BPMConstants.bpmPackage, BPMConstants.bpmName,

                               BPMConstants.bpmProcessName);

 

                 ProcessStartManager psmgr = BPMFactory.getProcessStartManager();                 object.setString(object.getType().getProperty(BPMConstants.in), dto

                               .getIn());

 

                 psmgr.startProcess(event, object);

 

                  return pdef;

 

          } catch (BPMException e) {

                 // TODO Auto-generated catch block

                 System.err.println(“*******************Process did not start”</p><p class=”MsoNormal” style=”margin-top: 0in; margin-right: 0in; margin-bottom: .0001pt; margin-left: .75in; line-height: normal; text-autospace: none;”>                               + e.getMessage());</p><p class=”MsoNormal” style=”margin-top: 0in; margin-right: 0in; margin-bottom: .0001pt; margin-left: .75in; line-height: normal; text-autospace: none;”> </p><p class=”MsoNormal” style=”margin-top: 0in; margin-right: 0in; margin-bottom: .0001pt; margin-left: .75in; line-height: normal; text-autospace: none;”>          }</p><p class=”MsoNormal” style=”margin-top: 0in; margin-right: 0in; margin-bottom: .0001pt; margin-left: .75in; line-height: normal; text-autospace: none;”>           return null;</p><p class=”MsoNormal” style=”margin-top: 0in; margin-right: 0in; margin-bottom: .0001pt; margin-left: .75in; line-height: normal; text-autospace: none;”> </p><p class=”MsoNormal” style=”margin-top: 0in; margin-right: 0in; margin-bottom: .0001pt; margin-left: .75in; line-height: normal; text-autospace: none;”>   }</p><p class=”MsoNormal” style=”margin-top: 0in; margin-right: 0in; margin-bottom: .0001pt; margin-left: .75in; line-height: normal; text-autospace: none;”> </p><p class=”MsoNormal” style=”margin-top: 0in; margin-right: 0in; margin-bottom: .0001pt; margin-left: .25in; text-indent: .5in; line-height: normal; text-autospace: none;”>}</p><p class=”MsoNormal” style=”margin-top: 0in; margin-right: 0in; margin-bottom: .0001pt; margin-left: .25in; text-indent: .5in; line-height: normal; text-autospace: none;”> </p><p class=”MsoNormal” style=”margin-top: 0in; margin-right: 0in; margin-bottom: .0001pt; margin-left: .25in; text-indent: .5in; line-height: normal; text-autospace: none;”> </p><p class=”MsoNormal” style=”margin-top: 0in; margin-right: 0in; margin-bottom: .0001pt; margin-left: .75in; line-height: normal; text-autospace: none;”>ProcessInitiateDTO is just a data transfer object used to ferry data from UI to this utility method to raise BPM process.</p><p class=”MsoNormal” style=”margin-top: 0in; margin-right: 0in; margin-bottom: .0001pt; margin-left: 1.5in; line-height: normal; text-autospace: none;”> </p><p class=”MsoNormal” style=”margin-top: 0in; margin-right: 0in; margin-bottom: .0001pt; margin-left: 1.5in; line-height: normal; text-autospace: none;”> </p><p class=”MsoNormal” style=”margin-top: 0in; margin-right: 0in; margin-bottom: .0001pt; margin-left: 1.5in; line-height: normal; text-autospace: none;”>public* class ProcessInitiateDTO {

       private String in;

 

       public String getIn() {

              return in;

       }

 

       public void setIn(String in) {

              this.in = in;

       }

      

      

}

 

3. In the mobile web application access this EJB in a servlet and create a form to pass the input parameters through ProcessIniateDTO.

 

!https://weblogs.sdn.sap.com/weblogs/images/251869781/2.PNG|height=338|alt=|width=670|src=https://weblogs.sdn.sap.com/weblogs/images/251869781/2.PNG!

 

 

!https://weblogs.sdn.sap.com/weblogs/images/251869781/3.png|height=110|alt=|width=681|src=https://weblogs.sdn.sap.com/weblogs/images/251869781/3.png!

 

 

Caveats : The end user should have BPM Admin rights, now this will be fixed in later SP where only a specific role for the end user would be required.

 

The mobile web page must be authenticated, or the you need to provide guest with BPM Admin role, which is seriously not a good idea.

 

Summary  : with upcoming NW 7.3 BPM, the platform is open to be incorporated into new devices such as mobile to maximize the reach of BPM beyond desktops.</p></div>

To report this post you need to login first.

5 Comments

You must be Logged on to comment or reply to a post.

    1. Priya Ranjan Post author
      Hi Daniel

      I don’t have the project right now with me,
      but if you follow the steps you should be able
      to do this.

      Hope it works for you…

      (0) 
  1. mpindu pethina
    Hi Sir,

    First of all i would like to say thank you for useful blog. I’ve made all these things step by step, but i guess i made a mistake but still i didn’t understand.

    System give error like that, could you please help me?

    “com.sap.glx.process.exception.TechnicalProcessException: Error while getting process definition for flow version ‘f76f812f2f69817f47c32db0432dd3fb'”

    (0) 
    1. Priya Ranjan Post author
      I would suggest that you post the question with full trace in the forums. As it would be difficult here to analyze the error here.

      thanks

      (0) 

Leave a Reply