File Store Binds
Business rules can use the following binds to create and access 'process' and 'temporary' files.
Each bind is defined in the sections below.
For details and available methods, refer to the Technical Documentation, available at [system]/sdk or accessible from the Start Page, and click the Javadoc 'html' link under the 'Scripting API' section.
Configuration
To use any bind:
-
Create a business rule as defined in the Creating a Business Rule, Function, or Library topic.
-
Edit the business rule as defined in the Editing a Business Rule or Function topic.
-
In the Edit Operation dialog, add the bind to a business rule, as defined in the Adding a Bind topic.
-
In the Edit Operation dialog, optionally add Messages, as defined in the Localized Messages for JavaScript Business Rules topic.
-
In the Edit Operation dialog, add JavaScript to call the bind.
Process Store
Process files, such as reports and custom format extracts required by business rules, can be created via JavaScript and are accessible with the Process Store bind.
Process file contents are retained in blob storage between executions and are deleted after an inactivity period of 30 days.
Below is an example of a very simple business action that creates or appends a text file with IDs of nodes (e.g., as part of a bulk update or an event processor) to use as the basis for a report.
Temporary Store
Temporary files, such as files required for reading or writing from business rules, can be created via JavaScript and are accessible from the Temporary Store.
Temporary files are deleted automatically when the business rule processing is complete.
Below is an example of a very simple business action that writes the current node ID to a text file.
The business rule defining the Temporary Store bind determines the scope of the temporary content created from it.
Considerations
Consider the following differences:
-
A Temporary Store bind configured on a business rule.
-
A temporary process content blob and data is written to it.
-
The business rule that calls the business function is actively waiting for the function to return.
-
The temporary content blob is passed to a business function (either a JavaScript or External business function).
-
The temporary content blob is read from within the business function.
-
-
A Temporary Store bind configured on a business function.
-
A temporary process content blob and data is written to it.
-
The lifecycle of the temporary content is limited to the scope of the Temporary Store bind from which it was created.
-
The temporary content blob cannot be passed back to the caller of the function.
-
When the business function exits the temporary content is deleted.
-