Introduction to SAP Netweaver BPM: Part 6


SAP PI Interview Questions and SAP PI Tutorials

SAP PI Interview Questions and SAP PI Tutorials

In earlier parts of this series of blogs, we have learned to create a BPM Process, deploy it and import it in our Web Dynpro Java Component. This part focuses on the invocation of BPM process from our Web Dynpro Java application using java code. Sample code to invoke the adaptive web service model is given below:

ModelName objModelName = new ModelName();

Request_Name objRequest = new Request_Name(objModelName);

StartOpName objStartOpName = new StartOpName(objModelName);

// Set the values for the Details Node (Cardinality is 1:1)

DetailsType objDetailsType = new DetailsType(objModelName);

// Set the value for attribute Name, String type (Check for Null)

if (wdContext.currentDetailsElement().getName() != null)

objDetailsType.setName(wdContext.currentDetailsElement().getName());

else

objDetailsType.setName(“”);

// Set the value for Age (No check as by default it will be 0 if not already set)

SAP PI Interview Questions and SAP PI Tutorials

SAP PI Interview Questions and SAP PI Tutorials

objDetailsType.setName(wdContext.currentDetailsElement().getAge());

// Set the values for the Details Element

objStartOpName.setDetails(objDetailsType);

objRequest.setStartOp(objStartOpName);

// Bind the object

wdContext.nodeRequest_Name().bind(objRequest);

// Execute the model

wdContext.nodeRequest_Name().currentRequest_NameElement().modelObject().execute();

Above code is just for demonstration purpose and proper Naming/Coding standards should be followed while coding business applications. Remember we need to send the values for all the nodes which has a cardinality of 1:1 or 1:n failing which the model will throw errors and the process will not be triggered. Also verify that you do not send any null values for any string attributes, otherwise a null pointer exception will be thrown.

SAP PI Interview Questions and SAP PI Tutorials

SAP PI Interview Questions and SAP PI Tutorials

Share this:
Share this page via Email Share this page via Stumble Upon Share this page via Digg this Share this page via Facebook Share this page via Twitter
www.pdf24.org    Send article as PDF   
This entry was posted in sap bpm tutorials, sap pi 7.1 tutorials and tagged , , , , , , , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *