The core of the Component Enabler runtime is the LINCEnvironment component. Each LINCEnvironment object represents a single connection to a remote application server.
The LINCEnvironment class provides an interface for setting up a connection to the system. It is used to create IspecModel objects from the generated Ispec components and to handle the exchange of transaction requests and responses with the remote application. Client applications can have multiple LINCEnvironment objects in their environment, giving them concurrent access to multiple Agile Business Suite Systems, that might be running on different host systems.
The LINCEnvironment class provides ATT function to enable ATT recording from .NET Framework (ASP.NET, VB.NET) and Java-based clients. It maintains an ATTHelper instance to provide ATT recording sequence for an application.
The following example shows the intended use of LINCEnvironment. The explanation that follows the example contains an alternative example for JavaBeans users.
linc = new LINCEnvironment("mylinc", "com.somewhere", "gizmo", "reps"); #1 linc.connect("x-ratl:linchost.somewhere.com:2449", "PUBLIC_VIEW"); #2 linc.autoLogin("bob", "*******"); #3 linc.hello(); #4 sales = linc.getIspec("SALES"); #5 linc.loadIspec(sales); #6 ... #7 linc.simpleTransaction(sales); #n
The following text describes each line in the example above:
Line # 1 creates and initializes a new LINCEnvironment and all the objects it holds. The name of the LINCEnvironment is mylinc , the package where the application classes reside is com.somewherethe application name is gizmo, and the Bundle is reps.
For JavaBeans, replace this line with:
linc = Beans.getInstance("LINCEnvironment")
Line # 2 connects the LINCEnvironment object and the server. The server is specified by the URL: x-ratl:linchost.somewhere.com:2449 , and PUBLICVIEW is the name of the Remote Access server View to use. The URL specifies the host, the port, and the protocol you want to use.
If the LINCEnvironment object is created from a serialized object that has its URL and View name properties already set, use the alternate version of connect () with no arguments.
Line # 3 specifies the login to the server with the specified username and password. The maximum length for username is 12 characters and the maximum length for password is 14 characters. In some cases you do not need to login to the server, and you can omit this line.
As with connect () , there is an alternate version of login () that does not require arguments.
Line # 4 sends a HI message to the Remote Access server. This can fetch the fireup Ispec defined in the system.
Line # 5 creates an instance of the SALES IspecModel.
Line # 6 loads the fields of the SALES IspecModel from the server. This might not always be necessary, but it is useful when the server pre-fills some of the fields with useful values, such as a sale number.
Use Line # 7 and following lines to enter the details of the transaction by inserting data into the fields of the Ispec.
The last line sends the IspecModel object to the server to complete the transaction.
The following are the two types of transaction method:
simpleTransaction uses the same IspecModel object for the data sent to the server and the data returned by the server. The Ispec passed as the argument is used as the source of the data sent to the server and as the destination of the data returned by the server. If errors occur, they are stored in the LINCStatus object and the simpleTransaction returns an error code. Refer to “Response Codes” for more information on the error messages returned.
transaction handles the more general case when the IspecModel sent to the server is not necessarily the same as the IspecModel returned by the server. This can happen when an Ispec recalls a related Ispec. For instance, a Sales Ispec might recall a Receipt Ispec on successful completion of a sale. The transaction method always returns a new IspecModel, regardless of whether the type of the returned Ispec is the same as the argument or not. If errors occur, the transaction method returns a null and places the errors in the LINCStatus object. Refer to Response Codes for more information on the error messages returned.
Refer to LINCEnvironment in the Agile Business Suite Component Enabler Class Reference Summary for more information on the parameters, methods, and syntax of LINCEnvironment.