Skip to content
Nathan Richardson edited this page May 9, 2019 · 7 revisions

⭐ Deploy

Once flows have been designed and configured, they can be deployed to a Metl agent to be run. When a flow is deployed to an agent, its associated resources are also deployed to that agent and can be configured differently for each agent deployment. In a typical scenario, a company might have application environments for development, system test, user acceptance test and production. Similarly with Metl, you can have a development, system test, user acceptance test and production Metl agents. After a flow has been designed and configured, it can be deployed to the development agent for dev testing. The resources that are deployed on the Metl development agent can point to the external systems development resources. When the flow is ready for system testing, it can be deployed to a Metl system test agent, and the associated resources on that agent can point to the external systems system test resources, etc.

Each running instance of the Metl application can have one or more Metl agents running underneath it. As an example, development, test and production agents could all be run under a single running instance of the Metl application. More commonly each agent is deployed on a different physical server or virtual machine.

When a flow is run from the design screen, Metl uses a pre-configured agent on the current running instance of Metl called the design-time agent. This agent is like any other Metl agent except that it is created automatically.

Similar to the design screen, the deploy screen is split into different panels. The navigation panel shown below, allows viewing of the Metl agents that are configured and running for the current instance of the Metl application.

navigation panel

Agents are organized within folders. To create a new folder, click "New" - "Folder", and type the new name of the folder.

new folder

Similarly, to create a new Metl Agent, click on the folder under which you would like the agent organized, click "New" - "Agent", and type the name of the new agent.

new folder

Double clicking on an agent in the navigation panel, or selecting an agent and clicking "Edit" - "Open" will open the agent details in the content editor panel as shown below.

agent details

The Start Mode for each agent can be "AUTO" or "MANUAL". When in "AUTO" mode, all agents defined in this instance of the Metl application will be started automatically when the Metl software is run. The Hostname lists the computer’s hostname on which the agent is being run.

Agent specific parameters can be set on the Agent screen. Clicking the "Parameters" button displays a dialog box where these parameters can be maintained. These parameters are available to flow components and can be used when things (in addition to resources) need to be specified on an environment by environment basis.

agent parameters

The main list on the content editor panel of the deploy screen displays the flows and resources that have been deployed to a given agent.

agent deploys

Column Name Description

Project Name

The name of the project to which the deployed item belongs

Deployment

The name of the item that has been deployed to this agent. This can be a resource name or a flow name

Type

The type of the item that has been deployed. Either "Resource" or "Flow"

Status

The status of the deployed item. Either "DISABLED" or "ENABLED". If "ENABLED" the flow will can be run on a scheduled or manual basis from the agent. If "DISABLED" the job must be enabled before it can be run. This column is only applicable for a flow.

Log Level

The log level for the deployed item. Either "DEBUG", "INFO", "WARN", or "ERROR". Determines the log level that will be output for the flow when the flow is run on the agent. This column is only applicable for a flow.

Start Type

Determines how the flow will be started or run on the agent. Either "MANUAL", "ON_DEPLOY", or "SCHEDULED_CRON". If "MANUAL" the flow will not be invoked automatically by the system, but can be run manually by a user from the deploy screen. If "ON_DEPLOY", the flow will be run immediately after the flow has been deployed and enabled. If "SCHEDULED_CRON", the flow will be run on a scheduled cron basis that can be maintained by double clicking the flow in the list.

Start Expression

If Start Type is set to "SCHEDULED_CRON", this is the cron expression that will determine the run time of the job

Deploying a flow

To deploy a flow to an agent, click on the "Add Deployment" button and the Add deployment screen will be displayed as show below:

agent deploy flow

All projects and flows will be displayed. Selecting a flow, and clicking the "select" button will deploy the flow to the Metl agent. When a flow is first deployed to an agent, its status will be "Disabled." To enable the flow for the agent, select the flow, and click the "Enable" button. The flow status will be changed to "REQUEST_DEPLOY" and once deployed will be changed to "DEPLOYED."

Running a flow

Once a flow has been deployed to an agent and enabled, the flow can be run from the deploy screen. Select the flow to be run, and click the "RUN" button. After the flow has run, the flow’s run statistics will be displayed as follows.

Column Name Description

Component Name

The name of the component in the flow

Thread

The number of threads that were used when running the component

Status

The completion status of the component. Either "DONE", "ERROR", or "CANCEL". If "DONE", the component completed all of its work successfully. If "ERROR", the component finished in error. If "CANCEL" the component was cancelled before it could complete its work

Msgs Rcvd

The number of messages this component received during the run of the flow.

Msgs Sent

The number of messages this component sent during the run of the flow

Entities Prcd

The number of entities processed (if the component takes a model based inbound message)

Start

The start run time of the component

End

The end run time of the component

Selecting the component in the top pane will result in run information for that component being display in the bottom pane. Run information for the component can be filtered by typing a filter expression in the Filter box.

Running a flow from an enterprise scheduler

Metl has a REST API that can be used to call a deployed flow from an external enterprise scheduler. Information about the Rest API can be found here [rest-api]. The Rest service allows an HTTP GET request to run a flow and get a response back that provides the status of the flow run.

One way to initiate the REST API is to create a .bat file using cURL as shown in the example below.

curl -H "Accept: application/xml" http\://[SERVER]\:8080/metl/api/agents/[AGENT]/deployments/[FLOW_NAME]/invoke?paramName=paramValue | grep '<status>DONE</status>'
Clone this wiki locally