Using X-UP Models in a Nexacro Application

This chapter describes how to develop a Nexacro application using a model created in the section Model Development Using SAP RFC Invoke. Nexacro applications are developed using the Nexacro Studio tool. Please refer to the section Deploy and Undeploy for model development and deployment methods.

This chapter has been written with the assumption that the user is familiar with Nexacro and Nexacro Studio. Therefore, certain details have been omitted for basic Nexacro application development stages.

The application development stages described in this chapter for an X-UP model that uses Nexacro Studio are as follows:

TypeDefinition - Service Registration

  1. Add a service in TypeDefinition as shown in the image below.

Field Name

Field Value

Prefix

‘XUP_SERVER’

Enter a prefix used in the model call script code.

Type

‘bs’

To call an X-UP model, “bs” must be selected as the type.

URL

‘http://localhost:8080/xup/’

Enter the X-UP Server URL.

ServiceList

‘FrontControllerServlet.do?service=serviceInfo&target=modelList’

Enter the service list call URL.

DatasetLayout

‘FrontControllerServlet.do?service=serviceInfo&target=modelLayout’

Enter the URL for I/O information acquisition.

Model List and Interface Import

  1. [Refresh] the service in Project Explorer, and retrieve the X-UP Server's model list.

The imported model list displays models according to domains.

A domain is a namespace to distinguish between models and is set with the X-UP Builder project name. In other words, a single X-UP project corresponds to a single model domain.

  1. Refresh the INVOKE_SAP_RFC model in the model list and retrieve the interface information (I/O).

Model Call Script Creation

  1. Drag the I/O dataset from the model's interface information in Project Explorer, and drop it into the Invisible Objects Editor.

  1. Create a model call code in the Script Editor as shown below.

this.btnSearch_onclick = function(obj:Button,  e:nexacro.ClickEventInfo)
{
	
	var svcparam 	= "domain=" 	+ "NexawebInc"   		// Domain name
					+ "&model=" 	+ "INVOKE_SAP_RFC"  	// Model name
					+ "&format=" 	+ "xml"
					+ "&version=" 	+ "xplatform";

	var svcUrl = "XUP_SERVER::FrontControllerServlet.do" +
							"?service=xupservice&" + svcparam;
    
    // Model Input parameters
    var strInDatasets = "";
    var strOutDatasets = "FLIGHT_LIST1=FLIGHT_LIST1";
    var strArgument = "";
    
	this.transaction("searchFlightList", svcUrl, strInDatasets, strOutDatasets
										, strArgument, "fn_Transaction_Callback");
	
}

this.fn_Transaction_Callback = function(strSvcID, nErrorCode, strErrorMag)
{
	if(nErrorCode < 0) {
		this.alert(strErrorMag);
		return
	}
	
	if(strSvcID == "searchFlightList") {
		trace(this.FLIGHT_LIST1.saveXML());
	} 

}

The information for calling an X-UP model in Nexacro is as follows:


Service URL:

http://[host]:[port]/xup/FrontControllerServlet.do?service=xupservice&domain=[domain name]

&model=[model name]&format=xml&version=xplatform


Input parameter: Transmit input parameters required by each model with GET or POST.

  1. Run Quick View and verify the results.