Creating Processes - Best Practices
Pre-Symphona:
Before starting to work on your process, map out the flow of data or steps on a piece of paper or an app like Figma. This way you know exactly what direction or steps you will need to use to get the desired result.
Filtering Input Parameters:
If you are retrieving input parameters from the user, use an evaluate expression step to make sure there are no additional characters within the parameter. Any Javascript (Nashorn Engine) function will work.
Grouping Sections:
If you have a section that does a specific task, using the Group tile to create a highlighted section for organization is good practice. That way, you can locate sections easier within your flow.
Minimizing Number of Steps:
The less steps your process has, the faster it will run. Try to combine SQL statements, setting parameter values, using subprocesses to make your processes streamlined.
Using Subprocesses:
If there are groups or sections within your processes that appear multiple times across multiple flows, creating a separate process to use as a subprocess within your system would be best. One example of this would be creating a subprocess to send emails and update your DB. You can add a subprocess to each process to make final changes that are shared with multiple processes.
If your process is running too long, also splitting the process up into multiple processes linked with the Trigger Sub Process step, the entire flow can run faster.
When to use Evaluate Expression:
Here are some examples or use cases when to use the Evaluate Expression step:
- Sanitizing inputs (system accepts extra spaces, new lines, and any characters under the “Anything” Parameter Type)
- Pulling SQL values
- After an SQL statement, you can pull the value like this:
- SQLParameter is your output parameter from the SQL query
- Column_Name is the SELECT value in your SQL query
- When working with Field Values and Field keys, you can pull responses like this:
- Example SQL query:
- TicketInfo[?(@.field_key=='Address')].field_value[0] (it will be highlighted like this, disregard)
- TicketInfo is your output parameter from the SQL query
- [?(@.field_key=='Address')].field_value is the JavaScript code to match the values between field key and field value.
- Be sure that all of it is within the highlighted parameter, press backspace and then type it in
- The [0] is the variable we want to pull from the array of one item.
- Any manipulation of number (add, subtract, multiply, divide, and more)
- Any manipulation of characters (substring, concat, toUpper, and more)
{JSON_PATH:$[0].Column_Name}SQLParameter
SELECT field_key, field_value FROM "CityTable" WHERE orderNumber = 'Ticket_ID' AND field_key IN ('Address', ‘City”,’Country’)
- Creating Processes - Best Practices
- Pre-Symphona:
- Filtering Input Parameters:
- Grouping Sections:
- Minimizing Number of Steps:
- Using Subprocesses:
- When to use Evaluate Expression: