cancel
Showing results for 
Search instead for 
Did you mean: 

Complete method of a Callable Object

Former Member
0 Kudos

Hi,

I have developed a dc in NWDS7.1. It has a component which i am making as a callable object. I have the default methods like getDescription() and execute methods. I have include the complete method also, where the process gets completed exactly.

Now, from VC i want to call this callable object and give the input values. I want to know how to trigger that complete method of my callable object from VC?

Can anybody help me?

Thanks in advance,

Venkat

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member4529
Active Contributor
0 Kudos

Hi,

If you have developed the Web Dynpro Java component implementing the GP interface that can be used as a Callable Object in Guided Procedure. If you use VC then it's a different type of callable object and there you don't have any getDescription() execute() methods (no coding can be done in VC). From VC you can't call any callable object as VC itself is a callable object. You call a VC acllable object or a Web dynpro callable object from Guided procedure.

Refer the following documents for WDP and VC callable objects:

<a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/50d74ada-0c01-0010-07a8-8c118d408e59">Implementing a Web Dynpro Callable Object which Implements the GP Interface (GP)</a>

<a href="http://help.sap.com/saphelp_nw04s/helpdata/en/44/429bbd709914bce10000000a155369/frameset.htm">Modeling Visual Composer iViews for Guided Procedures (SAP Library - Creating Composite Applications)</a>

Thanks,

Dipankar

Former Member
0 Kudos

Hi Dipankar,

I develop a Web Dynpro DC where I use the GP interface. I have got three components, so I created three Actions on Portal -> Guided Procedures -> Runtime (Design and start a simple process -> Simple sequence wizard). After I put them in a Process and added three different users to each of the Action.

When I reach the last view of the first component and call the complete method I get a NullPointerException in the component controller code at the following line:

IGPStructure output = executionContext.getOutputStructure();

Where should I search for the problem?

May the Simple sequence wizard not suitable for me?

Thanks & regards,

Peter

former_member4529
Active Contributor
0 Kudos

Hi,

Declare a class variable as below in the interface controller (in the others section at the bottom of interface controller implementation):


//@@begin others   
private IGPExecutionContext executionContext;   
private IWDTextAccessor textAccessor;
//@@end

In the execute method write the following line as the first statement:

this.executionContext = executionContext;

This will solve your issue.

Thanks,

Dipankar

Former Member
0 Kudos

Hi Dipankar,

I did as you told. But the problem is remains the same, here is a sample of my code:

public void complete( )
  {
    //@@begin complete()
	IWDTextAccessor textAccessor = wdComponentAPI.getTextAccessor();
	GPWebDynproResourceAccessor resourceAccessor = new GPWebDynproResourceAccessor(textAccessor);
	
	IContextElement contextElement = wdContext.currentContextElement();
	IGPExecutionContext executionContext = contextElement.getExecutionContext();

	
	
	try {
		IGPStructure output = executionContext.getOutputStructure();		
		IGPStructure reqDataStructure = output.addStructure("RequestData"); 
		reqDataStructure.setAttributeValue("ApplicationDate", wdContext.currentRequestDataElement().getApplicationDate());
		reqDataStructure.setAttributeValue("ApplicationTime", wdContext.currentRequestDataElement().getApplicationTime());
		reqDataStructure.setAttributeValue("Department", wdContext.currentRequestDataElement().getDepartment());
		reqDataStructure.setAttributeValue("Priority", wdContext.currentRequestDataElement().getPriority());
		reqDataStructure.setAttributeValue("ReceivingSystem", wdContext.currentRequestDataElement().getReceivingSystem());
		reqDataStructure.setAttributeValue("Requester", wdContext.currentRequestDataElement().getRequester());
		reqDataStructure.setAttributeValue("Telephone", wdContext.currentRequestDataElement().getTelephone());
	

...

Do you have an idea for the reason?

Thanks & regards,

Peter

former_member4529
Active Contributor
0 Kudos

Hi,

If you are getting a null pointer exception at the statement

IGPStructure output = executionContext.getOutputStructure();

I still want to check whether you have declared executioncontext as a class vailable and set that in execute() method. Also note that you can only invoke the Interface controller's complete() method when you execute the Web Dynpro as a GP callable object from a GP process only. If you try to run the Web Dynpro as a stand-alone application and execute the complete() method you'll get the null pointer exception.

Thanks,

Dipankar

Former Member
0 Kudos

Hi.

The nullpointerException is still at the following statement:

IGPStructure output = executionContext.getOutputStructure();

I also have declared a variable named executionContext as class variable and set that in execute method. I try to run the application on Portal in GP Runtime.

I developed the application according to this documentation:

<a href="http://IWDTextAccessor textAccessor = wdComponentAPI.getTextAccessor();">Implementing a Web Dynpro CO with GP</a>

In this example the complete method has to be created in the Component Controller, and the views are also mapped to the Component controller. The getDescription and execute methods are in the Interface Controller.

However I saw another sample application as well, where all the methods were in the Interface Controller, and all the views were mapped to the Interface Controller. In this sample a Web Dynpro model was used. In this example a WD Model was used.

In my WD I only use some custom code for searching and creating of master data, so I have no WD Model.

Where could have I make the mistake?

Thanks,

Peter

former_member4529
Active Contributor
0 Kudos

Hi Peter,

You've the complete() method in the component controller? But the executionContext object is declared and initialized in the interface controller where you've the excute and getDescription methods. So you need to write the complete method in the interface controller as well.

Thanks,

Dipankar

Former Member
0 Kudos

Hi Dipankar,

Yes, I had the complete method in the component controller but there was the executionContext declared and initialized as well. Just like in the following document:

So I can reward points for your help, which I appreciate!

Thanks,

Peter