Initializing help system before first use

Attachment Management using VDL Actions

VDL Actions make it easier to create apps that can upload, download, and manage the attachments associated with the Scenario or the App.

Creating a Tagged Attachment

The <vdl-action-attachment-create> Action opens a dialog box that you can use to create a tagged attachment. The following example opens the dialog with a welcome message and assigns the relevant approval document tag.

View Designer

Code editor
    <vdl-page>
        <vdl-header draggable="true">
            <vdl-action-group draggable="true" name="createAtt">
                <vdl-action-attachment-create tag="approval-document"></vdl-action-attachment-create>
                <vdl-action-message text="'hello ' + value"></vdl-action-message>
            </vdl-action-group>
        </vdl-header>
        <vdl-section>
            <vdl-row>
                <vdl-column>
                    <vdl-button label="Upload" vdl-event="click:actions.createAtt"></vdl-button>
                </vdl-column>
            </vdl-row>
        </vdl-section>
    </vdl-page>

You can also add a custom message to the create dialog by adding a message parameter.

Code editor
<vdl-action-group name="createAtt">
    <vdl-action-attachment-create tag="approval-document" message="A Custom Create Message"></vdl-action-attachment-create>
    <vdl-action-message text="='hello ' + value"></vdl-action-message>
</vdl-action-group>

The attachment dialog will normally operate with scenario-wide scope. This scope can be specified, using the scope tag, to upload attachments that are only available in the app.

View Designer

Code editor
<vdl-action-group name="createAtt">
            <vdl-action-attachment-create tag="approval-document" message="Create an App Attachment" scope="scenario"></vdl-action-attachment-create>
            <vdl-action-message text="='Finished'"></vdl-action-message>
        </vdl-action-group>

The upload dialog defaults to use the first scenario on the shelf. You can add a scenario parameter to specify which scenario to use as the target for the upload. In the following example, the second scenario is specified.

Code editor
<vdl-page>
        <vdl-header draggable="true">
            <vdl-action-group draggable="true" name="uploadAtt">
                <vdl-action-attachment-create message="Create an App Attachment" scenario="1" tag="approval-document"></vdl-action-attachment-create>
                <vdl-action-message text="Finished"></vdl-action-message>
            </vdl-action-group>
        </vdl-header>
        <vdl-section>
            <vdl-row>
                <vdl-column>
                    <vdl-button label="Upload" vdl-event="click:actions.uploadAtt"></vdl-button>
                </vdl-column>
            </vdl-row>
        </vdl-section>
    </vdl-page>

Uploading a Tagged Attachment

This VDL Action is configured with a tag type. When a document is dragged into the Upload dialog window, the associated tag is added to the upload.

Code editor
<vdl-action-group name="uploadAtt">
    <vdl-action-attachment-upload tag="approval-document"></vdl-action-attachment-upload>
    <vdl-action-message text="='hello ' + value"></vdl-action-message>
</vdl-action-group>

It is possible to include a custom message in the upload dialog, using the message parameter.

View Designer

Code editor
    <vdl-page>
        <vdl-header draggable="true">
            <vdl-action-group draggable="true" name="uploadAtt">
                <vdl-action-attachment-create tag="approval-document" message="Create an App Attachment" scenario="1"></vdl-action-attachment-create>
                <vdl-action-message text="='hello ' + value"></vdl-action-message>
            </vdl-action-group>
        </vdl-header>
        <vdl-section></vdl-section>
    </vdl-page>

You can restrict the scope of the upload to the App by using the scope parameter as shown in the example below.

Code editor
<vdl-action-group name="uploadDemo3">
            <vdl-action-attachment-upload tag="approval-document" message="Upload an App Attachment" scope="app"></vdl-action-attachment-upload>
            <vdl-action-message text="='Finished'"></vdl-action-message>
        </vdl-action-group>

Downloading a Tagged Attachment

The following example uses a vdl action to download an attachment that has the tag input-sheet. The action defaults to use the first scenario on the shelf. If no attachment is found in the scenario, the action then searches the app.

View Designer

Code editor
    <vdl-page>
        <vdl-header draggable="true">
            <vdl-action-group draggable="true" name="AttDownload">
                <vdl-action-attachment-download tag="result-sheet"></vdl-action-attachment-download>
            </vdl-action-group>
        </vdl-header>
        <vdl-section>
            <vdl-row>
                <vdl-column>
                    <vdl-button vdl-event="click:actions.AttDownload"></vdl-button>
                </vdl-column>
            </vdl-row>
        </vdl-section>
    </vdl-page>

You can specify which scenario to search, by supplying a value for the scenario parameter. This example also checks there is more than one scenario.

Code editor
    <vdl-page>
        <vdl-header draggable="true">
            <vdl-action-group draggable="true" name="AttDownload">
                <vdl-action-attachment-download tag="result-sheet" vdl-if="=scenarios.length>1" scenario="1"></vdl-action-attachment-download>
            </vdl-action-group>
        </vdl-header>
        <vdl-section>
            <vdl-row>
                <vdl-column>
                    <vdl-button vdl-event="click:actions.AttDownload"></vdl-button>
                </vdl-column>
            </vdl-row>
        </vdl-section>
    </vdl-page>

Managing Attachments

The vdl-action-attachment-manage defaults to operate with scenario level scope. The following example opens the Scenario Attachments dialog.

View Designer

Code editor
    <vdl-page>
        <vdl-header draggable="true">
            <vdl-action-group draggable="true" name="AttManage">
                <vdl-action-attachment-manage message="Manage your attachments"></vdl-action-attachment-manage>
            </vdl-action-group>
        </vdl-header>
        <vdl-section>
            <vdl-row>
                <vdl-column>
                    <vdl-button vdl-event="click:actions.AttManage"></vdl-button>
                </vdl-column>
            </vdl-row>
        </vdl-section>
    </vdl-page>

You can also set the scope of the attachment dialog to app level. The following example opens the app attachments management dialog.

Code editor
<vdl-action-group draggable="true" name="AttManage">
    <vdl-action-attachment-manage scope="app" message="Manage your attachments"></vdl-action-attachment-manage>
</vdl-action-group>

Editing Attachments

The vdl-action-attachment-edit Action allows the user to open the scenario attachment editor. By specifying the filename parameter, the example here will only open the file named bacon.csv.
Note If the editor attribute is not specified, the scenario attachment is opened with the default editor.
View Designer

Code editor
    <vdl-page>
        <vdl-header draggable="true">
            <vdl-action-group draggable="true" name="AttEdit">
                <vdl-action-attachment-edit editor="DecisionTableAttachmentEditor" filename="bacon.csv"></vdl-action-attachment-edit>
            </vdl-action-group>
        </vdl-header>
        <vdl-section>
            <vdl-row>
                <vdl-column>
                    <vdl-button vdl-event="click:actions.AttEdit"></vdl-button>
                </vdl-column>
            </vdl-row>
        </vdl-section>
    </vdl-page>

Alternatively, you could specify the tag to restrict which files can be opened.

Code editor
<vdl-action-group name="demo1" description="Opens the scenario attachment editor">
    <vdl-action-attachment-edit tag="bacon" editor="DecisionTableAttachmentEditor"></vdl-action-attachment-edit>
</vdl-action-group>

You can add a scope parameter to open the App attachments dialog.

Code editor
<vdl-action-group name="demo2" description="Opens the app attachment editor">
    <vdl-action-attachment-edit scope="app" tag="bacon" editor="TextAttachmentEditor"></vdl-action-attachment-edit>
</vdl-action-group>

Editing Attachment Properties

The vdl-action-attachment-edit-properties VDL Action will open the attachment properties dialog. It is possible to edit the scenario properties at Scenario or App level. The scope defaults to Scenario level if it is not specified as a parameter.

View Designer

Code editor
    <vdl-page>
        <vdl-header draggable="true">
            <vdl-action-group draggable="true" name="AttEditProp">
                <vdl-action-attachment-edit-properties filename="bacon.csv"></vdl-action-attachment-edit-properties>
            </vdl-action-group>
        </vdl-header>
        <vdl-section>
            <vdl-row>
                <vdl-column>
                    <vdl-button vdl-event="click:actions.AttEditProp"></vdl-button>
                </vdl-column>
            </vdl-row>
        </vdl-section>
    </vdl-page>

Using the scope parameter opens the attachment editor for App level attachments.

Code editor
    <vdl-page>
        <vdl-header draggable="true">
            <vdl-action-group draggable="true" name="AttEditProp">
                <vdl-action-attachment-edit-properties filename="bacon.csv" scope="app"></vdl-action-attachment-edit-properties>
            </vdl-action-group>
        </vdl-header>
        <vdl-section>
            <vdl-row>
                <vdl-column>
                    <vdl-button vdl-event="click:actions.AttEditProp"></vdl-button>
                </vdl-column>
            </vdl-row>
        </vdl-section>
    </vdl-page>

Editing a specific field in the Attachment Properties (Scenario and App)

The following code sample uses the field parameter to specify which field you want to edit. By adding the filename attribute to the vdl action, you specify the filename of the attachment to open with the editor. The scope is not defined so the action defaults to Scenario attachments.

Code editor
    <vdl-page>
        <vdl-header draggable="true">
            <vdl-action-group draggable="true" name="AttEditProp">
                <vdl-action-attachment-edit-properties field="description"
                filename="input.txt"
                message="This is a message">
                </vdl-action-attachment-edit-properties>
            </vdl-action-group>
        </vdl-header>
        <vdl-section>
            <vdl-row>
                <vdl-column>
                    <vdl-button vdl-event="click:actions.AttEditProp"></vdl-button>
                </vdl-column>
            </vdl-row>
        </vdl-section>
    </vdl-page>

You can specify the scope to edit the app level attachment property.

Code editor
    <vdl-page>
        <vdl-header draggable="true">
            <vdl-action-group draggable="true" name="AttEditProp">
                <vdl-action-attachment-edit-properties
                    field="description"
                    filename="input.txt"
                    message="This is a message"
                    scope="app">
                </vdl-action-attachment-edit-properties>
            </vdl-action-group>
        </vdl-header>
        <vdl-section>
            <vdl-row>
                <vdl-column>
                    <vdl-button vdl-event="click:actions.AttEditProp"></vdl-button>
                </vdl-column>
            </vdl-row>
        </vdl-section>
    </vdl-page>

© 2001-2020 Fair Isaac Corporation. All rights reserved. This documentation is the property of Fair Isaac Corporation (“FICO”). Receipt or possession of this documentation does not convey rights to disclose, reproduce, make derivative works, use, or allow others to use it except solely for internal evaluation purposes to determine whether to purchase a license to the software described in this documentation, or as otherwise set forth in a written software license agreement between you and FICO (or a FICO affiliate). Use of this documentation and the software described in it must conform strictly to the foregoing permitted uses, and no other use is permitted.