cancel
Showing results for 
Search instead for 
Did you mean: 

what is wdContext.nodeOutput().invalidate();

Former Member
0 Kudos

Hi all,

What will happen if we didnt write wdContext.nodeOutput1().invalidate(); after

wdContext.currentBapi_Po_Getitems_InputElement().modelObject().execute();

Regards

Padma

Accepted Solutions (0)

Answers (2)

Answers (2)

abhimanyu_lagishetti7
Active Contributor
0 Kudos

Hi Padma

invalidate() method has different meaning for model node and value node

for model node, the value is refreshed with the latest value.

for value node it clears the data in the value node.

Regards

Abhimanyu L

Former Member
0 Kudos

Hi,

Is it possible to execute 2 models in a same customController

former_member186016
Active Contributor
0 Kudos

Yes.

Regards,

Ashwani Kr Sharma

Former Member
0 Kudos

Hi,

But only ome of my module is working.The scond is not working.

I folloewd the same for both.

The code i wrote in my wdDoInit() of CustomController is


try
	{
		
		wdContext.currentBapi_Po_Getitems_InputElement().modelObject().execute();
		wdContext.nodeOutput1().invalidate();
		wdComponentAPI .getMessageManager().reportSuccess("Controller:size of Pooutputnode"+wdContext.nodePo_Items().size());
		
		wdContext.currentZ_Po_F4_Help_InputElement().modelObject().execute();
		wdContext.nodeOutput().invalidate();
		wdComponentAPI .getMessageManager().reportSuccess("Controller:size of F4outputnode"+wdContext.nodeI_Ekko().size());
		
	}
	catch(Exception e)
	{
		e.printStackTrace();
	}

In the firstcase the size i am getting is 0 and next case the size is 3000

can u plz tell me where the problem may be

Regards

Padma

abhimanyu_lagishetti7
Active Contributor
0 Kudos

Hi Padma

Are you passing the Purchase order number to get the values?

Regards

Abhimanyu L

Former Member
0 Kudos

Hi

I am selecting purchaseorder from EVS which got populated by the F4Model.

But here i want the data related to that Purchaseorder from PoModel.

But that Model is not getting executed.It is giving size as Zero.

The code i used to execute this Model is


//@@end
  public void executeBapi_Po_Getitems_Input( )
  {
    //@@begin executeBapi_Po_Getitems_Input()
	try
			{
				wdComponentAPI .getMessageManager().reportSuccess("Controller:size of outputnode"+wdContext.nodePo_Items().size());
				wdContext.currentBapi_Po_Getitems_InputElement().modelObject().execute();
				wdContext.nodeOutput1().invalidate();
				wdComponentAPI .getMessageManager().reportSuccess("Controller:size of outputnode"+wdContext.nodePo_Items().size());
			}
			catch(Exception e)
			{
				e.printStackTrace();
			}
	wdComponentAPI .getMessageManager().reportSuccess("Controller:size of outputnode"+wdContext.nodePo_Items().size());
    //@@end
  }

Is there any wrong in code or there may be any wrong in mapping

Former Member
0 Kudos

Hi,

Are you passing the correct inuput for the first function module? Can you check it once again with the back end system.

Other wise general coding needs to be write the following way.

// instantiate the input class and bind to the component node.

Bapi_Po_Getitems_Input input = new Bapi_Po_Getitems_Input();

wdContext.nodeBapi_Po_Getitems_Input().bind(input);

// the FNModule rewuires any input pass it following way.

input.set<param1>("S000112");

input.setCustomer("6504");

try

{

wdContext.currentBapi_Po_Getitems_InputElement().modelObject().execute();

wdContext.nodeOutput1().invalidate();

wdComponentAPI .getMessageManager().reportSuccess("Controller:size of Pooutputnode"+wdContext.nodePo_Items().size());

} catch (Exception e)

{

e.printStackTrace();

}

The general way to call the function module and execute it.

The node size 0 means it returns nothing from the back end that means u passing bad input or your finding node doesnt return.

Try this way.

This might helps you.

Thanks,

Lohi.

Former Member
0 Kudos

Hi Padma

invalidate function is used to clear the contents of a node.i mean it will make the content fresh by deleting all the records in the table.

What happens if you don use invalidate

1)if you are displaying some data in the table , the records will be appended to the exsisting data

Ex: if there are 5 records in the table if you repopulate the table's data next time you will see 10 records ( old 5 records + new 5 records) this will happen always as you are not refreshing the node

2) if you invalidate the node it will clear the contents and displays the new 5 records only

Regards

Chaitanya.A

former_member186016
Active Contributor
0 Kudos

Hi,

When you call the invalidate() method you mark the node as dirty and hence the node will repopulated ( may be via supply methods).

To be more specific: If you don't put the call wdContext.nodeOutput1().invalidate(); after wdContext.currentBapi_Po_Getitems_InputElement().modelObject().execute();

the results will not be repopulated in UI.

Regards,

Ashwani Kr Sharma