restoreString
Restores a String previously stored with storeString or storeStringSet. The restored String may optionally be parsed into a different type of value.
If you wish to restore several values, instead of multiple restoreString
commands you may be able to make use of restoreStringSet instead to reduce the command count.
Attributes
var | ||
---|---|---|
Required | Value type | EL-evaluated |
Yes | String | No |
Defines the name of the variable that will hold the restored String or the result of it being parsed as defined by |
key | ||
---|---|---|
Required | Value type | EL-evaluated |
Yes | String | Yes |
Name of the stored String to restore. Corresponds with the |
parser | ||
---|---|---|
Required | Value type | EL-evaluated |
No | String | No |
Defining a value for this attribute causes the restored String to be parsed into a different kind of value. This should match with the The following values may be used:
If left undefined, the restored String will appear in the variable context as just a String. |
readFrom | ||
---|---|---|
Required | Value type | EL-evaluated |
No | File | Yes |
The resolved File value is where the String to be restored is expected to be stored in. The File may be a Document application, an Office template or a PDF document. If this attribute is not defined, the String is restored from the Document application or Office template in which this command exists in. |
Examples
The storeString
and restoreString
commands are most commonly used to have a PDF file produced by the logic to act as a storage for data related to the life cycle of whatever process the PDF is part of. In this model storeString
stores something into the PDF, such as selection the user did during the Flow. The PDF is then saved somewhere where the Flow can find it on the next run.
<storeString key="selectedAttachment" value="${selectedAttachmentId}" storeTo="${exportedPDF}">
When the Flow is run again, it finds the PDF and restoreString
reads the selection from it, allowing the logic to make use of this data, such as have the past selection to be pre-selected on a Screen.
<restoreString var="selectedAttachmentId" key="selectedAttachment" readFrom="${existingPDF}">