Introduction
The external flow is a concept that allows embedding and starting a flow from a different project, without the use of Portal Messages. See Decoupling Pattern 8: External Flow Container for more information.
Definitions
Host Runtime | The runtime which contains a project that has an AQ_ExternalFlow_ container implementation running. |
Target Runtime | The runtime which contains a project with a flow that can be started by an AQ_ExternalFlow_ container implementation. |
Source Profile | The domain model of the source. |
Target Profile | The domain model of the target. |
Interface Profile | The domain model of the interface |
Datastore | The location where the serialized profile is stored. |
Requirements
In order to use this functionality you need to enable Blueriq External Flow Component.
Configuration
To configure the External Flow Container to work on the runtime you have to do the following:
- Enable
external-flow
profile in bootstrap.properties
.
Using other datastore implementation then Redis
Blueriq provides IExternalFlowStore interface which can be used to interact with a generic datastore. A default implementation is already provided in the Blueriq External Flow Component. If other datastore implementation is desired you can follow these instructions.
Modeling an External Flow
Decoupling Pattern 8: External Flow Container
Flow type: external
Container type: AQ_ExternalFlow
Module type: Contract module
External Flow Endpoints
See External Flow Endpoints.
External Sessions Lifecycle
External sessions are created when different runtimes start an external flow on the current runtime. The external sessions are closed when the http session has expired or it was idle. When the user logs out from the host project or the host session simply expired, the external session has no knowledge of that and will remain open even if not used.
To mitigate the problem an mechanism was introduced that uses the same redis connection (check configuration section) to store information about the host session, and the target runtime will check for all of its host sessions if any of them are closed or are still opened. Every time it finds one that was closed, then it will also close the external sessions that were created by that host session.
Authentication & Authorisation
When an external flow is executed on a different runtime than the one that the current project is open, there needs to be a way in order for the roles of the currently logged in user to be validated on the target runtime where the external flow resides to. In order to support this, the authentication details of the main project are saved in the External flow Data Store and when the external flow is executed, the authentication is retrieved on the runtime where the external flow resides on, and is set up as if the same user has logged in on that runtime.
Security
When running an external flow from an AQ_ExternalFlow container, requests could be made between different domains. Therefore, for the external flows to work, you need to configure the Cross-Origin Resource Sharing mechanism. For more information, see : Security: Cross-Origin Resource Sharing