Views

QuickGuideToAPI

The primary class of the API is XABizView. The code snippets below show how to execute a simple BizDoc with no input XML and no input parameters, returning the result as a Java string.

To use the High Level interface you would use the following methods:

// initialize the XAware API and engine
XABizView.initialize(XABizView.MODE_BATCH);

// invoke the BizDoc with no input XML and no input parameters
// returning the result as a String
String result = (String) XABizView.loadAndExecute(sBizViewName, "",
   "", XABizView.RESULT_TYPE_STRING, null, null, null);

First, the engine must be initialized. Then the BizView is executed using the full path specification for the BizDoc file (you may prefer to execute the BizDoc in packaged .xar file, using a resource path, as shown in the next section). Refer to the javadoc documentation for additional overloaded methods and parameter using this style.

To use the Detailed Level interface you would use the following methods:

// instantiate and initialize the XAware API and engine
XABizView invoker = new XABizView(XABizView.MODE_BATCH);

// instantiate an options object and set each option
IBizViewRequestOptions options = new BizViewRequestOptions();
options.setBizViewName(sBizViewName);

// invoke the BizDoc, returning the result as a String
String result = (String) invoker.executeBizView(options,
   XABizView.RESULT_TYPE_STRING);

First, an XABizView object is instantiated which also initializes the Engine. Next, the IBizViewRequestOptions object is instantiated and each option is set, as needed. Finally, the BizView is executed. Refer to the javadoc documentation for additional overloaded methods and request options available using this style.