Skip to content

flow lifecycle

assimbly edited this page May 24, 2022 · 3 revisions

The lifecycle of a flow

A flow has five phases:

  1. Create
  2. Configure
  3. Start/Restart
  4. Stop/Pause
  5. Remove

First step is to design the flow in the "Create" phase. To "Run" the designed flow in Camel, the flow needs to be configured and started. After start it can be stopped, paused or restarted. When the flow is not needed anymore you can delete it.

FromEndpoint

Creating a flow

There are two ways to create a flow

1. GUI

  • Go to Flows --> Manage
  • Click on Action --> Create connector / Create service
  • Configure the connector or service

2. Editor

  • Use a text editor (like Notepad++ or Visual Studio Code) and create an XML file.
  • The XML file can be either in Assimbly format or in Camel XML format
  • Save the file

Importing/Exporting

You can also create the XML in an editor and then import the flow (Administration --> Deployment --> Import). Then you can run it from the GUI. Reversed you can create a flow in the GUI then export the flow (Administration --> Deployment --> Import) and run it from the API or Directory.

Running a flow

Running a flow goes in two steps:

  1. Configure the flow
  2. Start the flow

In the first step the flow is configured and loaded into Camel. The second step is making the flow active. These steps can mostly be done in one action. There are various way to do this:

1. GUI

  • On the flows page click on the start button of a flow

2. API

  • Go to the Swagger page: "Administration --> API" or * Use a REST client?

  • POST to the following /api/integration/{integrationId}/flow/test/{flowId} The Flow (as XML) must be in the request body.

For example:

/api/integration/1/flow/test/33

Note: If there is only one instance, the flow integrationid is always "1".

You can also run a flow through the API in two steps:

/api/integration/{integrationId}/setflowconfiguration/{flowId} /api/integration/{integrationId}/flow/start/{flowId}

3. Directory

The XML flow can be installed through the deploy directory. This directory is located at:

{user.home}/.assimbly/deploy

The Assimbly directory is printed in the log after startup. Files in the deploy directory

  • Copy or save the XML file to the deploy directory
  • You may check the logs if the file is installed correctly.

Note: The API can also install/uninstall a file from the Deploy directory.

Removing a flow

Removing a flow means that a flow is deleted from the application. Backup (for example by exporting) the flow file if you want to use it later.

1. GUI

  • Go to the Swagger page: "Administration --> API" or * Use a REST client?
  • Go to flows page and stop the flow (if not already stopped).
  • Click on the trash bin on the flows page
  • Confirm that you delete the flow

2. API

  • Stop the flow

/api/integration/{integrationId}/flow/start/{flowId}

  • If the flow is imported / available in the GUI. You can remove the flow:

/api/flows/{id}

Note: this will only remove the flow (the endpoint need to be deleted separately.

3. Directory

  • Go to the deploy directory and delete the file.
Clone this wiki locally