Programming
Last updated
Was this helpful?
Last updated
Was this helpful?
Flow scripting is necessary to use for processing data when you work with “non-deep" connectors like REST/SOAP, MAXIMO, MS Dynamics etc. See further script examples in the .
When working with Connector Type "Database" machine steps, it is possible to get the outputs of the executed script assigned to the Target Variable of the machine step. The Target Variable field would be disabled for Database Call Type "Script" machine steps by default. To activate this field, first you need to define the output variables in side code.
A good example would be if you are creating a Purchase Order using a script, you will need the created PO No extracted to inform the customer of the new PO. This can be done only be defining a "out" variable at the end.
A full iteration (all included records) is processed as one database transaction, and COMMIT is executed at the end. An error raised on any row causes a stop and rollback of the whole database transaction.
All views and API calls used in Machine Steps needs to be prefixed using the application owner in order to flow to work. Usually "IFSAPP" is the application owner, making our code logics looking like below example.
Define variable names with underscore between words and at the end, i.e. customer_order_no_
Use proper indentation when you write your statements.
Always use database values or decode/encode instead of client values in where conditions. Otherwise the flow may fail when using with a environment using a different language as the default language.
Every time use ONLY API calls New, Remove, Modify methods or any other IFS pre-defined methods. Never use data insert, update, delete statements.
Do not just copy the variable names (p0, p1, p2, p3, etc) from IFS debugger. Use variable names matching to IFS backend column names for uniformity and easy identification.
Never use Commit. Flow does it when exiting a Cog Wheel.
Never use Tables (_TAB) to select data. Instead, always use views to get data.
However, if the customer wishes, they can change the application owner account to a different user other than IFSAPP and disable the IFSAPP account for security reasons. If this happens, all developed flows using IFSAPP will stop working. Further, if you are planning to develop a flow as a template, it should have the ability to work for any support any application owner setup. This needs to be achieved by defining a to enter the application owner and using that parameter as the prefix inside the code as shown on below screenshots.