Generic parameters are variables or settings that are used to control the behavior of a software application or system. These parameters are designed to be flexible and adaptable, allowing users to customize the software to their specific needs.
Through the FlowX Designer, you can create, edit, import, or export these generic parameters. You can also assign the relevant environment(s) to these parameters, ensuring they are applied exactly where they are needed.
Generic parameters can be defined and used in many scenarios. Here are a few examples of useful generic parameters:
Parameter | Description |
---|---|
baseURL | This parameter can be used to define the base URL of an API or website, which can be utilized across multiple environments |
redirectURL | This parameter can be used to define the URL to which a user should be redirected after completing a certain action or process. This can save time and effort by avoiding the need to hardcode multiple redirect URLs. |
envFilePath | This parameter can be used to define the path of the environment file that stores a document uploaded |
To add a new generic parameter, follow the next steps:
To configure a generic parameter you need to fill in the following details:
For example, if you want to set a baseURL
generic parameter (the URL will be different, depending on the environmaent).
Imagine that you need to create a process in which you need to upload an image or a document. We will define a generic parameter called envfilePath
that will represent the path where the document/image will be uploaded.
The minimum requirement to build an upload doc/image process:
Set a business rule action on the task node with the following properties:
This MVEL business rule assigns a value to a key, envFilePath
(our defined generic parameter) in the “output” map object. The value assigned to the key is retrieved from another object, additionalData.applicationConfiguration
, using the “get” method and passing the key envFilePath
as the parameter.
In other words, this rule extracts the value of the envFilePath
generic parameter from the additionalData.applicationConfiguration
object and assigns it to the envFilePath
key in the “output” map object.
It is important to note that the additionalData.applicationConfiguration
object and the “output” map object must be previously defined and accessible in the current context for this rule to work.
On this node we will define the following:
Child actions can be marked as callbacks to be run after a reply from an external system is received. They will need to be set when defining the interaction with the external system (the Kafka send action).
For example, a callback function might be used to handle a user’s interaction with a web page, such as upload a file. When the user performs the action, the callback function is executed, allowing the web application to respond appropriately.
Set an Upload file action on the task node with the following properties:
ai.flowx.in.devmain.document.persist.v1
In this example we used an environment called devmain
, topic naming convention is different depending on what environment you are working.
BULK
1234_${processInstanceId}
callbacksForAction
- the value of this key is a string that specifies a callback action associated with the Upload document
destination ID (node). This is part of an event-driven system (Kafka send action) where this callback will be called once the uploadDocument
action is completed.envfilePath
and uploadedDocument
.downloadPath
property of the uploadedDocument
input is not null and not an empty string. If it’s not, then it proceeds to the next steps.envfilePath
and the downloadPath
to form the full file path (filePath) where the uploaded document is expected to be located.uploadedDocument
input by adding a new property called filePath
with the value of filePath
.uploadedDocument
object into the output object as a key-value pair, with the key being “uploadedDocument”.In summary, the code seems to be processing an uploaded document by checking its download path, constructing a full file path, and updating the document object with the new file path. Finally, it outputs the updated document object.
filePath
: This is a key in the object which holds the value ${uploadedDocument.filePath}
. The syntax ${...}
suggests that it’s a variable placeholder that will be replaced with the actual value at runtime.After configuring all the nodes and parameters, run the process: