Product Information > JADE Runtime Application Guide > Chapter 1 - Running a JADE User Application > Running a Non-GUI Client Application using jadclient

Running a Non-GUI Client Application using jadclient

The jadclient executable program enables you to automate the running of non-GUI client applications. You can run a non-GUI client JADE application (defined as application type Non-GUI in the Define Application dialog) as a service under Windows Enterprise (that is, Windows 10, Windows 8, Windows 7, Windows Server 2016, Windows Server 2012, or Windows Server 2008) or you can run it from the command line, to add processing nodes to your JADE network.

To debug a non-GUI application, you must first change the application type to GUI, No Forms (by using the Application Type combo box in the Application sheet of the Define Application dialog).

The jadclient executable program uses the specified schema and app values, in conjunction with the optional signonUser and signonPassword values, to sign on to the JADE database. It performs no user logic in this sign‑on process and it signs off as soon as it has issued an Application class startApplication or startApplicationWithParameter method call, which is the process that actually runs the user logic.

The jadclient executable program will not run server applications specified in a JADE initialization file ServerApplication<application‑number> parameter when it is running an application defined in a system schema (for example, user‑defined server applications are not started when schema=RootSchema and app=JadeReorgApp).

If you are a standard user, you cannot install or remove an application as a service, as you do not have the necessary privileges. (For details, see "Service Management", in the JADE Platform Differences Guide.)

The jadclient executable starts the application specified in the app parameter. The specified application may start other application or they may be started by the ServerApplication<application‑number> parameter in the [NonGuiClient] section of the JADE initialization file. jadclient waits for all running applications to terminate before exiting back to the command line prompt, which allows application A to start B, then have A terminate but B to continue until it has performed the tasks for which it was written.

Run the non-GUI client program (for example, from a command script), specifying the following.

jadclient schema=schema-name
          app=application-name
          path=database-path
          ini=JADE-initialization-file-path
          [server=multiUser|singleUser]
          [causeEventOnSystem=[cause-event-number]]
          [host=host-server-node-name or host-IP-address]
          [port=host-port-name or host-port-number]
          [interface=client-TCP/IP-name or client-IP-address]
          [localport=client-port-name or client-port-number]
          [service=install|remove|cmdline]
          [nodeName=name-of-service]
          [nodeNameDescription="descriptive-name-of-service"]
          [noReorgRecovery=true|false]
          [delta=delta-name]
          [executeClass=class-name executeMethod=method-name]
          [executeParam=string]
          [executeSchema=schema-name]
          [executeScript=file-name]
          [executeTransient=true|false]
          [signonPassword=password]
          [signonUser=user-name]
          [endJade]
          [user-defined-parameters]

The jadclient program treats processing arguments enclosed in double (" ") or single (' ') quotation marks after the endJade parameter as single-string entries in the huge string array. The handling of strings in this huge string array is application-specific. For example, path= "program files" is treated as a two‑string entry and "path= program files" is treated as a one-string entry. How these entries are handled is determined by your application.

You can call the Node class or Process class getCommandLine method to return a string containing the current command line of the respective node or process of the receiver.

The following are examples of the command prompt that runs a non-GUI client application.

jadclient schema=ASchema app=NonGUIApp ini=c:\jade\test\jade.ini path=c:\jade\system delta=foxtrot
jadclient schema=ASchema app=CSharpGenerator ini=c:\jade\test\jade.ini path=c:\jade\system delta=foxtrot

You can run the ExtractAllExposures application from the jadclient command prompt to generate C# code for all classes in a schema. The generated code for each class contains get and set methods for every property in every class. (Note that methods and constants are not included in this generation.) The following is an example of the command prompt that generates code for the .NET interface.

jadclient path=c:\jade\system ini=c:\jade\system\jade.ini app=ExtractAllExposures schema=JadeSchema endJade FCSchema FCSchema e:\temp\fcschema

The parameters following the endJade parameter specify the schema name, the namespace, and the folder to which the .NET exposures are extracted. The ExtractAllExposures application exit code returns:

For details about .NET exposures, see "Extracting a C# Exposure", in Chapter 17 of the JADE Development Environment User’s Guide.

The following is an example of the command prompt that installs a non-GUI client application as a service.

jadclient service=install nodeName=bgapp1 nodeNameDescription="NonGuiApp in 
ASchema on c:\jade\system" schema=ASchema app=NonGUIApp ini=c:\jade\test\jade.ini 
path=c:\jade\system

The following is an example of the command prompt that removes a non-GUI client application service.

jadclient ini=c:\jade\test\jade.ini service=remove nodeName=bgapp1

The following is an example of the command prompt that externally causes an event on the JADE System object.

jadclient path=c:\jade\system ini=c:\jade\test\jade.ini causeEventOnSystem=12345

A progress report is created as the server node initializes. Standard initialization information is output to stdout and error information is output to stderr. For details about displaying and redirecting the output from JADE batch utilities, see the DisplayApplicationMessages, LogServer, and UseLogServer parameters under "JADE Log Section [JadeLog]", in the JADE Initialization File Reference.

Use the ReadWriteStdio parameter in the [NonGuiClient] section of the JADE initialization file to specify how JADE read and write instructions are handled when running the non‑GUI client application. By default, Jade Interpreter Output and User Input windows are not displayed, and the output of write statements is directed to the Windows Command window. Set the parameter to false if you want the Jade Interpreter Output and User Input windows displayed as for a standard GUI application.

If the jadclient program fails, a non-zero exit code is returned and an error message is displayed; for example, if the schema is invalid or you attempt to run a GUI application.

The jadclient program uses the parameters in the JADE initialization file [NonGuiClient] section.

If you have installed your non-GUI client application as a service, you can control it by using standard Windows features. (For details, see "Controlling Non-GUI Client Application Services", later in this chapter.)

If you are a standard user, you cannot install or remove an application as a service, as you do not have the necessary privileges. (For details, see "Service Management", in the JADE Platform Differences Guide.)

You can also initiate a non-GUI application when the server is initiated or at a specific time. For details, see "ServerApplication<application-number>" under "JADE Non-GUI Client Section [NonGuiClient]", in the JADE Initialization File Reference.

The non-GUI client program parameters are described in the following subsections. For details about using non‑GUI client (jadclient) applications to:

See also "Passing Parameters to Non-GUI Applications using jadclient", "Inserting a Schema into the Schema Hierarchy", "Reblocking Collection Class Maps", and "Ad Hoc Index Batch Interface", later in this section.

If you reimplement the Global class getAndValidateUser and isUserValid methods for user validation, consider that these methods will be called in non-GUI applications. Creating and attempting to show forms in non-GUI applications raises an exception unless the application is in exception state.