Additional Blogs by Members
cancel
Showing results for 
Search instead for 
Did you mean: 
Former Member
0 Kudos

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://web...!

 

 

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

 

 

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>

5 Comments