Skip to end of metadata
Go to start of metadata

The Flux command line interface can be used from a shell or command prompt in order to create a Flux server, start the server, stop the server, check if the server is running, dispose/shutdown the server, run the Flux Designer, and start Flux Agents.

In conjunction with the Flux Designer, the Flux command line interface allows Flux to be used as a standalone job scheduler. End-users and administrators create and shutdown Flux using Flux's command line interface. To perform other job scheduler tasks, such as creating, editing, removing, controlling, and monitoring jobs, end-users and administrators use the Flux Designer and web user interface.

Using Flux in its standalone job scheduling mode, you can use Flux to run your office, data center, and company operations. No programming required.

A manual targeted directly at end-users and administrators who perform no programming is available in the file flux-end-users-manual.pdf.

Displaying the Flux Version

To display the version of Flux from the command line interface, run the following command from a shell or command prompt.

java --jar flux.jar

Alternately, if your jobs contain classes that are not bundled with Flux, you need to start the GUI differently.

java --classpath .;flux.jar flux.Main gui

Obtaining Help

To display help with the command line interface, run the following command from a shell or command prompt.

java --jar flux.jar help

This command displays a list of available commands. For help on a specific command, run the following command,

java --jar flux.jar help <command>

where <command> is the name of the actual command. The supported commands include:

  • agent-client Runs a command on a pre-existing Flux agent instance.
  • agent-server Creates and optionally starts a Flux agent instance.
  • client Runs a command on a pre-existing Flux engine instance.
  • help Displays help messages for each command.
  • server Creates and optionally starts a Flux engine instance.

Creating a Flux Server

To create a Flux server from the command line, run the following command while inside your Flux installation directory.

java --jar flux.jar server

This command creates a standard Flux server using the default configuration. In this configuration, Flux runs using a built-in, in-memory database.

The alternate syntax that allows you to include your own jar files on the command line is shown below.

java --classpath flux.jar;<your jars here> flux.Main server

In general, the flux.Main class has main methods that provide the API to the Flux command line.

The default server configuration creates a Flux engine instance as an RMI server on RMI registry port 1099, binding the server to the RMI registry using the server name "Flux". The RMI registry port and server name can be changed using the command line options.

The above command line syntax for creating a Flux server does not actually start the server after it is created. It just instantiates the server in the stopped state. A stopped server does not fire jobs.

The command line option start creates a Flux server in the started state, which does, in fact, allow jobs to fire.

java --classpath .;flux.jar flux.Main server start

The above command not only creates a default server, but it starts that server as well.

Creating a Flux Server from a Configuration File

The section above describes how to create (and, optionally, start) a Flux server using the default configuration settings. More practically, however, you will likely have to create a Flux server from a Flux configuration file to customize the server.

The command line syntax is straightforward.

java --jar .;flux.jar server --cp <properties_conf_file> [start]

The line above creates a Flux server from a properties configuration file called <properties_conf_file>.

Starting, Stopping, and Shutting Down a Server

After the server has been created, it can be started and stopped from a second command line prompt using the clientcommand. The client command has similar options to the server command described above. You can start a remote Flux server, stop a remote server, check if a remote server is started, and shut down a remote server all using the clientcommand.

To control an engine through the second command prompt window, use the following commands while in the Flux installation directory. All of the following commands use the default in-memory database.

  • Start: java --cp .;flux.jar flux.Main client start
  • Stop: java --cp .;flux.jar flux.Main client stop
  • Dispose: java --cp .;flux.jar flux.Main client dispose

Starting a Flux Agent

Flux Agents can be started using the Command Line Interface (CLI). To start a Flux Agent using the Command Line Interface, run the following command:

java -cp .;flux.jar flux. Main agent-server -enginehost <your engine's host> start

The above command will start a Flux Agent that registers with your Flux engine if the default configuration settings are used to start your Flux engine instance.

For more information on starting an agent using the CLI, refer to the Flux Agent Architecture section of this manual, which provides further details on creating an agent.

Note: Flux Agents require that the Flux engine they are registering with has the jbosscache.jar file in the Flux engine classpath.

Detailed Information on Command Line Options

Flux provides a robust interface accessible through the command line, but it is an often overlooked feature. This article will break down the various command and abilities available to the user using a command line. The command line has five different subsections that will be discussed here: agent-client, agent-server, server, agent, and encryptedpassword.

Basic Syntax

Nearly all tasks accomplished from the command line using Flux begin with the same root syntax as noted below.
java --cp .;flux.jar{additional jars} flux.Main {sub section}{options}{method}

Each subsection contains its own help listing by appending
"--help" to the command. For example, to view the help information for servers, use the command

java --cp .;flux.jar flux.Main server --help

Agent-Server

The agent-server subsection on the command line deals with the creation of a new agent. With no options specified, the command will use all the defaults. 
The following configuration options are available for use with the agent-server:

  • -registryport {port number}- The port number the agent should be bound to in the RMI directory. This defaults to 1099.
  • -registrybindname {name} - The name the agent should be stored in the RMI directory. This defaults to FluxAgent.
  • -engineregistryport{port number} - The RMI port number for the engine you are attempt to create an agent for. This defaults to 1099
  • -enginehostname {IP/hostname}- The hostname or IP address for the engine that you are trying to establish an agent for. This defaults to localhost.
  • -pool {pool name} - The name of the agent pool you want to add the agent to. There is no default
  • -configurationfile {path to file} - The filepath to the configuration file you want to use when creating this agent. With a properly constructed configuration file, no other options need to be specified. Information about configuration options can beThere is no default.
  • -engineusername {username} - Username to log in to the Flux engine with. This is required if you are attempting to add an agent a secure Flux server. This has no default
  • -enginepassword {password} - The password used to log in to a secured Flux engine. If security is enabled, either this or encryptedenginepassword is required. This has no default
  • -encryptedenginepassword {encrypted password} - The password, that was encrypted by Flux’s password encrypting program, used for logging in to a Flux engine. If security is enables, either this or enginepassword is required. There is no default // Only one method is available for use, the start method is available for use.

Example usage:
java -cp .;flux.jar flux.Main agent-server -configurationfile /flux-7-x-y/config/agent-config.properties start

Agent-Client

The agent-client subsection allows the user to send commands to an already created agent. It requires the user provide only a method to invoke on the agent, but the following configuration options are available. If no options are specified, the defaults will be used.

  • -registryport{port number}- The port number the agent should be bound to in the RMI directory. This defaults to 1099.
  • -registrybindname{name} - The name the agent should be stored in the RMI directory. This defaults to FluxAgent.
  • -engineregistryport{port number} - The RMI port number for the engine you are attempt to create an agent for. This defaults to 1099
  • -enginehostname{IP/hostname} - The hostname or IP address for the engine that you are trying to establish an agent for. This defaults to localhost.
  • -pool {pool name} - The name of the agent pool you want to add the agent to. There is no default
  • -configurationfile {path to file} - The filepath to the configuration file you want to use when creating this agent. With a properly constructed configuration file, no other options need to be specified. There is no default.
  • -engineusername {username} - Username to log in to the Flux engine with. This is required if you are attempting to add an agent a secure Flux server. This has no default
  • -enginepassword {password} - The password used to log in to a secured Flux engine. If security is enabled, either this or encryptedenginepassword is required. This has no default
  • -encryptedenginepassword {encrypted password} - The password, that was encrypted by Flux's password encrypting program, used for logging in to a Flux engine. If security is enables, either this or enginepassword is required. There is no default

The agent-client subsection has the following methods available for use:

  • start - Starts an Agent instance. Ex: java -cp .;flux.jar flux.Main agent-client -enginehostname comp1 -engineusername myUser -enginepassword myPassword start This starts an agent instance for the secured engine running on comp1.
  • stop - Stops the specified agent instance. Ex: java -cp .;flux.jar flux.Main agent-client -configuration c:/flux-7-11-0/config/agent-config.properties stop This stops an agent based on the information stored in the c:/flux-7-11-0/config/agent-config.properties file.
  • interrupt - This sends the interrupt signal to whatever work is currently running on the agent. Ex: java -cp .;flux.jar flux.Main agent-client -encryptedenginepassword 6vQZjh4KhTw= -engineusername admin interrupt This interrupts the engine running on localhost host will all the default settings.

The engine is secured with the username admin and userpassword encrypted. Mastering creating agents from the command line will allow Flux to be deployed within your system with much more versatility.

Client

The client sub-section of the command line deals with directly manipulating a running Flux engine. It is able to perform many tasks that are normally available only through the web application or designer; such as adding jobs, expediting tasks (firing a manual trigger), as well as receiving general information on the state of flow charts running on your engine.

The following optional configuration options are available when invoking a client command:

  • -host {IP/hostname} - The host which is currently running the Flux engine you are trying to establish a connection to. Defaults to localhost
  • -registrypost {port} - The port which the Flux engine is registered to in the RMI directory. Defaults to 1099.
  • -serverhost {host} - The hostname that the Flux engine is bound is in the RMI registry. Defaults to Flux.
  • -cp {path to file} - The path to the configuration file for your fluxEngine. This can replace any other configuration option.
  • -username {username}- The username of a user within the system that has proper permissions to perform operations on flowcharts. Required when dealing with a secured engine.
  • -password {password}- Password for the user. Required when attempting to negotiate with a secured engine.
  • -encryptedpassword {password} - If your password was encrypted using the Flux password encrypted (see the "encrypt-password" section of this article).

Being that this subsection deals directly with managing jobs and an engine, there a many methods available to invoke.

  • start - Permits the engine to begin firing jobs. Ex. java -cp .;flux.jar flux.Main client -host localhost -username admin -password admin start
  • stop - Stops the engine from proceeding with any work. The engine will still remain in the rmi port until disposed of. Ex. java -cp .;flux.jar flux.Main client -cp c:\flux-7-11-0\config\engine-config.properties stop
  • isrunning - Reports whether or not an engine is running given the information specified. Ex. java -cp .;flux.jar flux.Main client -host indigo isrunning
  • size {namespace} - Reports how many jobs are in the specified namespace Ex. java -cp .;flux.jar flux.Main client -username administrator -encryptedpassword 6vQZjh4KhTw= size /
  • expedite {namespace} Expedites (fires all manual triggers currently pending) all flowcharts in the given namespace. Ex. java -cp .;flux.jar flux.Main client -host comp2 -registryport 1098 expedite /unix/
  • resume {namespace} Resumes all flowcharts in the given namespace Ex. java -cp .;flux.jar flux.Main client -host myhost -servername myflux -registryport 1111 resume /
  • pause {namespace} Pauses all flowcharts in the given namespace Ex. java -cp .;flux.jar flux.Main client pause /heavy/
  • remove {namespace} Removes all flowcharts in the given namespace. Ex. java -cp .;flux.jar flux.Main client -encryptedpassword 9vPZjh4KhTw=
  • interrupt {namespace} - Sends the interrupt signal to all flowcharts currently running in the given namespace Ex. java -cp.;flux.jar flux.Main client interrupt /
  • export {job file} - Exports the given job to the engine specified in the configuration options. Ex. java -cp .;flux.jar flux.Main client export thisflowchart.fcch4. Server

The server subsection of the command line interface deals directly with the creation of a Flux engine, and is therefore contains many of the most frequently invoked commands. Most of the configuration options for an engine are provided in a configuration file, so the options specified at the command line are fairly limited. Refer below for a comprehensive list.

  • -registryport {port} - Specifies the port the engine is bound to in the RMI registry.
  • -servername {server} - Name that the engine will bind to in the RMI registry.
  • -cp {path to file}- The configuration file for the engine. Inside the file the bulk of the engine’s configuration options will be set. This includes, but is not limited to, database settings, security settings, and rmi settings.
  • -username {username} The username used to log in to the engine. This is required if security is enabled.
  • -password {password} The password used in conjunction with the username to log in to the engine. This is required is security is enabled.
  • -encryptedpassword {password} If you encrypted your password using the encryptpassword subsection of the command line interface, you will need to use this configuration option to pass it in. This is required if you are using security and want to obscure your password.

Only the start method is available when using the server subsection. An example follows:

java -cp .;flux.jar;jdbc_driver.jar;lib/otherjars.jar flux.Main server -cp config/my-config.properties -username admin -password -admin start

Encrypted Password

Flux provides a command line tool to encrypt your passwords so anyone with access to the machine will not easily be able to discover the Flux admin's password. It is simple to use, as it requires only one piece of information, your password, on the command line and outputs an encrypted password suitable to be passed into the -encryptedpassword argument for any of the other command line subsections. Use the example below as a blueprint for how to make your own.

java -cp .;flux.jar flux.Main encryptpassword your password here

And after some number crunching, the following should be output for your use:

Encrypted password is e71iWuZK0qBPn8TowvLYfg==

  • No labels

4 Comments

  1. Anonymous

    How to execute flow chart using command line Interaface?

    Can I pass runtime parameter from text file to flow chart? If yes could please explain.

    1. You can use the "export" command to execute a workflow from the command line. More information on the export process can be found at:

      Running Flow Charts

  2. Anonymous

    I have tried exporting the map to the engine and it did, but it has been added in the root folder of the namespace. Not sure on how to mention the namespace as part of the export command to a export command.

    1. The export command will use the namespace of the workflow that is added at design time, per Creating Flow Charts. The command-line interface doesn't support overriding the workflow name from the command line, so it would need to specified within the workflow.

      I hope this helps! Let us know if we can clarify anything for you.

Write a comment…