This article refers to the
Digital Binder ABC v4 or lower, compatible with Appway 11.1.1 or lower, which is a legacy ABC. End of Support (EOS) was scheduled in
May 2024. Recommended action: Consider adopting
Digital Binder v5 or higher.
The Digital Binder Application Business Component is a central hub for accessing and managing unstructured content in the form of files of different types and links to external resources — we use the term attachment to refer collectively to content handled by the component. The component supports users in gathering and classifying content in a collaborative fashion based on configurable collaboration workflows, attachment lifecycles and metadata profiles. Behind the scenes, the content can be archived into and restored back from the client’s trusted document management system.
Technically, the component is built along our core principles of modularity, reusability and usage through assembly, and comes with an extensive set of configuration options.
One example configuration option is the possibility to specify metadata profiles. This can be used to model company-specific record management or retention control policies. Since users classify content as part of their work patterns while using the component, the component has the benefit that record management becomes a by-product of normal user activity.
A second example configuration is the possibility to choose between different predefined approaches to store the content. Alternatively, the component can be integrated with third-party systems and configured to merely surface the functionality supported by the integrated system. In this case, content can be archived into and restored back from a client’s document management system of choice, thereby allowing users to access content from different enterprise systems in the context of their work within an Appway application.
The Digital Binder Application Business Component is available from Appway 8 together with the Digital Binder Configuration Kit, which shows how to use the component in a prototypical scenario.
This section describes the user’s tasks on the Digital Binder Application Business Component. These tasks revolve around the entire handling of attachments, such as creating attachments, providing necessary metadata, but also assigning tasks to other collaborators, for example review or approval tasks.

The attachments managed in a Digital Binder are represented as a list. For each attachment, additional information is shown, such as type, name, tags, status, collaborators, ongoing tasks, creation date, and available actions. Attachments can be browsed by filtering, sorting columns, or paging.

Three different kinds of attachments are available: placeholder, file, and link:
- Placeholders are used as empty slots for required documents when the expected file is still missing and until the file is uploaded. Placeholder attachments are represented by a dotted file icon.
- All uploaded files are represented as documents designated by a specific icon that indicates their file type – image, PDF, Word, Excel, archive or, for all other formats, a generic file.
- Links are addresses pointing to external resources and are represented by the link icon.

The Digital Binder offers the possibility to show a file preview of uploaded files.
Consider that, starting from Digital Binder 4.2.2, an optional feature (configurable via configuration property digitalbinder.user.based.file.access.enabled = true) makes the URLs of the files exposed in the Digital Binder only accessible to the current user.
If this feature is used, such files will not be stored in the preview folder, but in the folder /work/output/{userId}/.... Although the Appway Platform provides a cleanup job for the /work/output folder, you might consider putting in place some custom cleanup logic.

The status of an attachment is updated accordingly based on the stage in an attachment lifecycle and it can include values such as Created, Uploaded, Reviewed, Approved or Returned. The list of statuses is fully configurable as described in the Status Manager section. If at least one mandatory set of metadata is not defined, then the Attachment is marked as 'flagged' (red flag icon).
The collaborators and task columns are updated with the collaborators’ avatars and ongoing task information as soon as at least one ongoing task exists in relation to an attachment and until task completion. The attachments that are part of a task in progress and assigned to another user are marked as locked (gray lock icon). Task creation is described in the Collaboration and Task Management section.
By clicking on an attachment in the attachment list, the Digital Binder enters in Highlight Mode: more information about the currently highlighted attachment is shown in the sidebar.

Once in Highlight Mode, you can have multiple attachments in Selection Mode by clicking on the corresponding checkboxes: actions common for all selected items are shown (subset of all possible actions) in the sidebar and in the Attachments table toolbar.
Use the toolbar placed above the attachments list to add a file attachment:
- By clicking on the Add Attachment button and uploading a file, you create a file attachment.
- By clicking on the Create More button, you create multiple file attachments.
- By clicking on the Add Link button and adding a URL, you create a link attachment
- By clicking on the above-mentioned button without specifying a file or URL, you generate a File or Link placeholders.
- By using the Drag and Drop area inside the Attachments List, you create one or multiple file attachments.
Metadata is information describing an attachment, such as the name or the Party to which the file is related to. The metadata profiles are configurable and can vary depending on the application domain.
- Add Metadata at placeholder or link creation – Metadata information can be edited directly in the creation dialog. Attachments with missing mandatory metadata are marked with a red flag.

- Add Metadata at Drag and Drop of one ore multiple files – After the Drag and Drop of one or multiple files inside the Attachments Table, the Digital Binder suggests editing the metadata.

- Edit Metadata – Select an attachment in the list, and click the Edit Metadata button in the Details tab.

While metadata can be edited, the Details tab of a file attachment also contains information about the file properties which is immutable, such as file creator, file size, as well as creation and modification date.
In addition to metadata, tags offer an alternative way of organizing attachments. Tags are displayed in the attachment list. A set of predefined tags can be configured, in order to provide an initial number of options. Users then can select any of these tags.
Edit Tag – Select one or multiple attachments in the list, and click the Edit Add Tags button in the Details tab. Then, choose the desired tags and press the Add button.

Comments are a means of annotating and discussing across an attachment lifecycle. Comments are also used for documenting decisions, such as approval or rejection. Commented attachments are flagged with a comment icon in the attachment list.

Add Comment – Select one or multiple attachments from the attachments list, and enter the comment in the Comments tab in the sidebar.
Collaboration is one of the main features of the component. Given a task that involves gathering content required for a specific business goal, its owner has the option to involve additional users by assigning them tasks.
Note that the collaboration feature can be switched off. In this case, the elements of the interface related to collaboration will not be shown. This includes the Collaboration tab of the sidebar and the Collaborators and Tasks columns of the attachments list.
There are three modes in which users can work with the Digital Binder: Owner, Task Assignee and Reviewer mode.
The Owner mode is the default state of the component when starting off. The user that initiates the task of gathering content by using the Digital Binder is considered the Owner of the binder and has access to the full set of functionalities provided by the component, including the possibility of viewing the entire set of attachments and their respective metadata, even after the attachment has been assigned to another collaborator.
The Owner is the only user who has the necessary rights to create tasks for one or multiple attachments and assign them to entitled collaborators.
- To assign a task, the Owner needs to first select one or several items from the attachments list, and then click the Assign tasks button in the Collaboration tab in the sidebar.
- A task assignment dialog is shown subsequently. The Owner is then required to select one activity out of a list of activities applicable for the list of currently selected attachments. Upon selecting the activity, the list of assignees entitled to perform the activity is calculated and shown in a dropdown list.
- To complete the task assignment, the Owner needs to specify the task assignee, the due date, the task priority and a description of the task for the task assignee. As soon as the Save button is pressed, a task is created and dispatched to the chosen assignee.
All tasks in progress, canceled or completed, are listed in the Collaboration tab. For tasks in progress, the Owner has the possibility to reassign it to a different user, claim it back or cancel it. These actions are provided in a contextual menu associated with each task in progress.
As soon as a task has been assigned to a collaborator and until its completion, the entitlement is shown as locked in the attachment list and only a limited subset of actions is available.
Note that concurrent tasks for the same attachment are only possible if the Digital Binder is configured accordingly. Moreover, the set of activities that can be assigned by the Owner are fully configurable and can be of two types: regular or review activities as described in the
Task Assignee Mode and
Reviewer Mode sections.
After the Owner assigns a task to a collaborator, he/she can pick up the task from the Inbox and start working on it. In the case of regular activities, the task assignee experiences the Digital Binder in Task Assignee mode.

The Task Assignee is presented with the set of instructions defined by the Owner and the list of attachments assigned as part of the task. The set of actions available for task assignees is reduced in comparison to the Owner mode. For example, they are not able to manage tasks. Moreover, some actions are only available if defined accordingly in the entitlement configuration as part of your application.
To complete the task, the Task Assignee is presented with a second screen, which is shown after pressing the Next button. In this step, the Task Assignee is required to provide a description of their work to be shared with the other collaborators.

As already mentioned, the set of activities that can be assigned by the Owner are fully configurable and defined by your application. They can be of two types: regular or review activities. For review activities, the Digital Binder shows two buttons for each attachment, one to perform an Approve action and the other to perform a Return action. See the Status Manager section for details about configuring the logic associated to the Approve and Return buttons.

As shown in the figure above, when in Review mode, the user is only allowed to download the document for viewing it, leave comments for their collaborators and perform the relevant approval action. Each approval or return action has to be accompanied by a corresponding message which is also added in the Comments tab in a dedicated notation with a green checkmark or red error icon, respectively. In correlation, approved attachments are represented by a green checkmark icon, while rejected ones show a red error icon.
As in the Task Assignee mode, the user is presented with a second screen to provide a description of their work before returning to the task. The saved description is also shown in the comments list of the Digital Binder to inform the rest of collaborators. The Comments tab, therefore, contains the complete list of an attachment’s activities. As mentioned above, if the description belongs to a decision task, the chosen decision is flagged by an icon on the attachment, and on the respective description in the Comments tab.

If a task is assigned to a Group or a Role, this can be picked up from the Inbox by users which are members of that respective Role or Group. As a first step, users are presented with a Take Ownership Screen where they can leave a message for their collaborators. Once the user presses the Take Ownership button, the task is assigned to them and they can proceed with their work on the task.

Tasks can be cancelled, claimed back or reassigned to another user by the Owner of the Digital Binder. This can be done either from the contextual menu associated with each task in progress or from the Inbox. As a result, the previously assigned user no longer owns the task. To address the situation that the previous owner might still try to access the task from the Inbox, the Digital Binder comes with a temporary screen informing the user that they have lost the ownership of the task. This screen is shown for 24 hours after the task has been reassigned or cancelled.

If enabled via a dedicated configuration option, the Digital Binder Owner receives a notification alert, which is displayed as a toast in the upper right corner of the page every time a task is completed by the Task Assignee.

The Digital Binder Application Business Component is delivered as two Packages: Digital Binder, and Smart Attachments:
- The Digital Binder Package is sealed and contains all the Business Objects that represent the component such as the Data Model, Processes, Screen Includes, etc.
- The Smart Attachments Package provides a library to manage basic aspects related to attachments — either files or links — and their metadata properties.
The Digital Binder Package interface is partially shown in the following image: A Visible Screen that contains the core part of the component and an extensible Data Model that can be used to configure the component and define the application-specific logic.

The Digital Binder comes as a Screen Widget which is used by adding it in an application Screen as a Screen Include. Start by dragging it onto an application Screen and then configure it by assigning instances of the Data Classes which are part of the underlying data model of the component.
This screen must be included into a Swimlane assigned to the owner to enforce security and allow creating collaboration tasks (see the Take Ownership section).

The Task Generator Process is a Sub-Process which handles the task generation for the Digital Binder. The Task Generator Process needs to be included into the main Process Instance of the application using the Digital Binder. This step is not required if the collaboration layer is not enabled.
See the Collaboration Layer section for information on how the Digital Binder and the Collaboration Layer work together.
This section explains the main elements of the Data Model. In subsequent sections, we then explain the complete Data Model in more details and how to use it.

-
DigitalBinder:DigitalBinder
This is the main Data Class of the component. It contains the list of attachments and information about the owner. Moreover, it can be configured by passing in instances of the Entitlements Manager, Activity Configuration Manager, Status Manager and Feature Configuration Profile. The Digital Binder Widget needs an instance of type DigitalBinder to work properly. It is possible to have more than one Digital Binder instance in a Process, but each of them can have only one owner (owners can be different).
If the application needs to customize the predefined tags, it is enough to set them using the setPredefinedTags function of the Digital Binder object just after the instance creation. Such function accepts an Indexed Collection of DigitalBinder:KeyValuePair containing the desired <tag-id, tag-label> couples.
-
DigitalBinder:DigitalBinderHelper
This Data Class is used by the main Digital Binder Widget to perform Screen and Process related operations (e.g., handle selection, filtering, and so on). An instance of the DigitalBinder must be provided as a parameter when creating the object. It is important that each Screen using the main Digital Binder Widget in a Process uses a dedicated instance of DigitalBinderHelper.
-
DigitalBinder:FeatureConfigurationProfile
The constructor of the DigitalBinder object requires an instance of this Data Class. It manages a series of properties which configure the Digital Binder Widget and enable it to work properly. For example, this Data Class contains a flag to switch on/off the Collaboration Layer. See the Configuration section for details.
-
DigitalBinder:StatusManager
The StatusManager Data Class is the core element required to model the attachment lifecycle as a Finite State Machine. The Solution is responsible for implementing an own state machine, while the Digital Binder core implementation provides the callback calls (for instance, when an attachment is created or a file is uploaded within it). If the business logic is implemented properly, the concrete implementation of a StatusManager object calculates the next status transition (if necessary), thus driving the lifecycle of the attachments.
-
DigitalBinder:AttachmentMetaData
Metadata can be defined for the two types of attachments handled by the Digital Binder — files and links — by extending the DigitalBinder:AttachmentMetaData Data Class, and each attachment type can have its own attachment medatada Data Class (see the FeatureConfigurationProfile Object section). Metadata is essentially a set of properties defined in the Data Class extending the DigitalBinder:AttachmentMetaData Data Class. A predefined set of metadata is provided and includes properties related to handling the visibility of a metadata field or whether the metadata field is mandatory or not. To make the indexing of such metadata easier, each instance of AttachmentMetaData needs to be coupled with an AttachmentMetaDataEnum. See the SmartAttachments Package section for details.

-
DigitalBinder:EntitlementManager
Each attachment entity contains its own entitlement configuration which manages who is eligible to view, edit, upload or review it. The EntitlementManager class is the object that needs to be implemented in your application to define the business logic that configures the right entitlements for the attachment at runtime. It is mainly used when the Collaboration Layer is active and allows to drive the entitlement logic for the different features shown in the Digital Binder Widget depending on the logged in user.
-
DigitalBinder:ActivityConfigurationManager
When the Collaboration Layer is enabled, the DigitalBinder instance uses an object of type ActivityConfigurationManager (an instance of this Data Class has to be provided by your application) to retrieve the possible activities the owner can assign for the attachments they had selected previously. Moreover, this module is responsible for defining the logic that, given a certain chosen activity, provides the list of possible assignees (either users or roles/groups). It is up to the logic defined in your application whether an activity is of type review or not.
-
DigitalBinder:CollaborationTask
When a task is generated by the Owner, in addition to a classic Process Token, the component stores an instance of type CollaborationTask, which holds information such as the list of attachments related to the task, the Task Assignee or the task priority. The ongoing tasks shown in a Digital Binder are always retrieved by using the Workitem filtering layer from the WorkitemFinder Extension.
The Collaboration Layer is the technical enabler of the collaboration feature provided by the component: assigning and managing tasks related to attachments. It can be switched on or off depending on whether collaboration is required by your application or not.
The role of the Collaboration Layer is to provide a mechanism to create new tasks from the main Digital Binder Screen Widget and to give the Owner of the main Digital Binder task a way to monitor the status of the tasks. Moreover, several actions are available to orchestrate the work, e.g., claiming back a task, cancelling a task and re-assigning a task to a different user.
This part of the component entails several elements that need to be properly configured to work correctly. For example, it uses Appway’s messaging and signaling system, it is integrated with the workflow token engine and it uses the WorkitemFinder Extension for Workitem filtering.
In order to decouple the Digital Binder Screen Widget from the hosting Process, the spawning of tasks is delegated to a Sub-Process that needs to be included into the root Process. See the Collaboration Layer dedicated section for further details.
This section describes how to perform the basic configuration of the Digital Binder.
The Digital Binder uses Appway local files as a default approach to store file attachments. To change this behavior, it is sufficient to redefine the configuration property named:
digitalbinder.file.attachment.type
The allowed values for this property are types that are subclasses of SmartAttachments:FileAttachment (see SmartAttachments Package section). The default value is SmartAttachments:LocalFileAttachment. Once defined, it is valid for all Digital Binder instances of the application.
Example of a customization:
digitalbinder.file.attachment.type = SmartAttachments:databaseAttachment
As expected, this configuration stores the uploaded files as database files instead of local files.
Alternatively, you can choose to persist Digital Binder file attachments by integrating with one of the following technologies:
In order to configure application-related features, it is necessary to create an object of type DigitalBinder:FeatureConfigurationProfile and pass it as an input parameter when instantiating a DigitalBinder object.
This profile object allows configuring the features described in the following subsections:

Property to be set: virtualLinkEnabled (Boolean)
| Value | Effect |
|---|
| true | The Digital Binder Widget shows the Add Link button in the top-right corner, allowing users to add new link attachments to the attachments list. |
| false | The Digital Binder Widget does not show the Add Link button in the top-right corner. In this case, users are not provided the option to add link attachments. |
Property to be set: runtimeAddFilePlaceholderEnabled (Boolean)
| Value | Effect |
|---|
| true | Users can insert a file attachment without a file attached. You can also remove a file from an existing attachment. |
| false | File attachment creation requires file upload. You can replace the attached file for existing attachments, but not suppress it. |
Property to be set: collaborationEnabled (Boolean)
| Value | Effect |
|---|
| true | The Digital Binder Widget shows the task-related columns on the table, provides the Collaboration tab and it is possible for the Owner of the Digital Binder to send and manage attachment-related tasks. |
| false | The Digital Binder Widget does not show the task-related columns on the table, hides the Collaboration tab and it is not possible for the Owner of the Digital Binder to send and manage attachment-related tasks. |
Property to be set: fileAttachmentType (String)
This property sets the type of storage used to store the files on the server. The value is the long name (Package and Business Object) of the Data Class that handles the storage. This Data Class derives from SmartAttachments:FileAttachment. This property value is defaulted to the Appway Platform configuration property digitalbinder.file.attachment.type.
Property to be set: fileAttachmentMetadataBeanType (String)
This property must contain the type to be used when creating the metadata container for a File Attachment object. The provided Data Class ID must be a subclass of the DigitalBinder:AttachmentMetaData Data Class. DigitalBinder:AttachmentMetaData is also the default type for this property, following the default assignment (in the NEW function of the FeatureConfigurationProfile DataClass)::
DigitalBinder:AttachmentMetaData $bean := new DigitalBinder:AttachmentMetaData;
$this.fileAttachmentMetadataBeanType := $bean.getType();
For instance, the Digital Binder Configuration Kit sets its own metadata object type in the following way:
DigitalBinder:FeatureConfigurationProfile $conf := NewObject(DigitalBinder:FeatureConfigurationProfile);
DigitalBinderConfigurationKit:DigitalBinderMetadata $metadata := NewObject(DigitalBinderConfigurationKit:DigitalBinderMetadata);
$conf.fileAttachmentMetadataBeanType := $metadata.getType();
Property to be set: linkAttachmentMetadataBeanType (String)
This property must contain the type to be used when creating the metadata container for a Virtual Link object. The type must be a subclass of the DigitalBinder:AttachmentMetaData Data Class, which is also the default type for this property, as resulting from the default assignment:
DigitalBinder:AttachmentMetaData $bean := new DigitalBinder:AttachmentMetaData;
$this.linkAttachmentMetadataBeanType := $bean.getType();
For instance, the Digital Binder Configuration Kit sets its own metadata object type in the following way:
DigitalBinder:FeatureConfigurationProfile $conf := NewObject(DigitalBinder:FeatureConfigurationProfile);
DigitalBinderConfigurationKit:DigitalBinderMetadata $metadata := NewObject(DigitalBinderConfigurationKit:DigitalBinderMetadata);
$conf.linkAttachmentMetadataBeanType := $metadata.getType();
When the user adds a File Attachment Placeholder (if the feature is enabled), the New Placeholder popup window shows a list of metadata that can be set. To customize the metadata properties to be provided to the popup, set the following property:
metadataForFileAttachmentCreation (Indexed String)
This Indexed Collection of String needs to contain the property IDs of the metadata required to be shown in the New Placeholder popup window.
For indexing properties of the metadata objects it is useful to leverage the metadata enumeration Data Class described in the SmartAttachments Package section.
When the user adds a Virtual Link (if the feature is enabled), the popup window shows a list of metadata that can be set upfront. To customize the metadata properties to be provided to the popup, set the following property:
metadataForLinkAttachmentCreation (Indexed String)
This Indexed Collection of String needs to contain the property IDs of the metadata required to be shown in the Add Link popup window.
For indexing properties of the metadata objects it is useful to leverage the metadata enumeration Data Class described in the SmartAttachments Package section.
The Digital Binder can be configured to show live notification alerts every time a task is completed by the Task Assignee. The Digital Binder owner receives notification alerts if these are enabled by using the property notifyOwnerOnTaskCompleted (Boolean).
The notification is based on the Workspace Notifications framework and requires installing a routing function on the Appway Platform (see the System Configuration Properties section).
Digital Binder allows developers to add menu entries to execute custom operations on some attachments. A custom menu entry can be created by implementing the DigitalBinder:CustomMenuEntry Data Class and its abstract methods execute and isEnabled.

- The execute function represents the business logic to execute when the custom menu entry is triggered by the user’s click on the respective menu entry.
- The isEnabled function determines whether the custom menu entry is active and can be triggered by users.
For a sample implementation of a custom menu entry, see the DigitalBinderConfigurationKit:CustomMenuEntryArchive Data Class:
- After creating a custom menu entry, register it to make it visible in the Digital Binder UI.
- To do so, simply instantiate the custom menu entry and register it in the Digital Binder Helper as follows:
$digitalBinderHelper := NewObject(DigitalBinder:DigitalBinderHelper, $digitalBinder);
DigitalBinder:CustomMenuEntry $entry := NewObject(
DigitalBinderConfigurationKit:CustomMenuEntryArchive,
'[LABEL:DigitalBinderConfigurationKit:action.archive]'
);
$digitalBinderHelper.addCustomMenuEntry($entry);
- Once registered, custom menu entries are displayed along with the default menu entries for one or more attachments.

By default, all file types are accepted. However, you can restrict file types by creating a Catalog called AttachmentMediaTypes. The Catalog should contain an id column. Then, add a row for each media type supported. For example:
text/*application/pdfimage/*
Important! This configuration can only be applied system-wide to all Digital Binders in your Application.
You can apply custom validation to metadata fields using regular expressions. The Data Class used is DigitalBinder:TextFieldWithValidation.
This Data Class has the following attributes:
value — The value of the metadataregex — The regular expression to be used to validate against the valueerrorMessage — The error message to be displayed when the validation fails.
Note: If using metadata validation with regex, make sure you modify the DigitalBinder:mandatory.data.missing Label Business Object and associated translations.
Example:
DigitalBinder:TextfieldWithValidation $myField := NewObject(DigitalBinder:TextfieldWithValidation, '^[0-9]*$', 'Please only enter numbers');
If your metadata reference list for a dropdown component is very large, you can use a lazy loading approach to improve performance. The The Data Class used is DigitalBinder:SearchableCatalog. This Data Class has the following attributes:
catalogReference — The underlying catalog containing the required data to fetch.value — The value of this metadata.
Example:
DigitalBinder:SearchableCatalog $bpNumberField := NewObject(DigitalBinder:SearchableCatalog, Catalog:NewReference('DigitalBinderConfigurationKit:BPNumber'));
Catalog Reference Constraints
The catalog reference passed to the DigitalBinder:SearchableCatalog Data Class should have the following assigned variables:
filter (String) — The text typed by the user when filtering the entries in the dropdown component.start (Integer) — The starting point of the returned data. If this value is zero, no entries are skipped when returned.limit (Integer) — The maximum number of entries to return. This is used in conjunction with the start variable, such as 'fetch me $limit number of records and skip $start entries').value (String) — The current value of the metadata. This is the same as the attribute value of DigitalBinder:SearchableCatalog.
Consider that:
- The catalog should return no more than the number defined by the
limit variable. - If
value is not empty and start is zero, the record with the ID of value should always be included in the returned results.
The Digital Binder is capable of tracking and driving the lifecycle of the attachments in terms of their status. Each item has metadata property to store the current status, represented by the status of the DigitalBinder:AttachmentMetaData class. However, the logic of status IDs, labels, transitions and event handling is handled by the Status Manager. The component contains a base Data Class called DigitalBinder:StatusManager that must be extended to provide the required information and logic. The following diagram shows how the Status Manager works:
The following diagram shows how the Status Manager works:

The events are generated as a result of invoking the function checkAndUpdateStatus of the Status Manager. The function accepts as a parameter the attachment that is subject of a change and a named collection of parameters as inputs (see the Status Manager Predefined Events section).
Following is the sequence of function calls that are executed every time the Status Manager is triggered:
- checkAndUpdateStatus (part of the DigitalBinder:StatusManager implementation) – It calculates the next status as defined in the configuration of the finite state machine and performs the transition, if a transition is required.
Function checkAndUpdateStatus(SmartAttachments:SmartAttachment $attachment, Named Any $params := {}:Any) : Nothing Begin
String $newStatus := $this.calculateNextStatus($attachment, $params);
If NotEmpty($newStatus) Then
$this.updateAttachmentStatus($newStatus, $attachment, $params);
End
End
- calculateNextStatus (must be implemented by your application) – It is used to calculate the next status and is the entry point for the entire logic of the State Machine.
Note: If there is no need to perform a status transition, the function must return null. If you return the current status, then this triggers a transition to the same state.
- updateAttachmentStatus (already implemented) – It updates the status of the attachment with the new status if the next status (see calculateNextStatus above) is not null.
- statusChangedCallback (default implementation is empty, your application can override it if needed) – This function (or its override) is always called when a status update is executed. For example, it can be used to send notifications or perform any actions required after a status change.
The implementation of the Status Manager Data Class in your application also needs the following functions:
- getStatusesList – It must return an Indexed Collection of
DigitalBinder:KeyValuePair. This collection must contain the whole list of possible statuses in the form statusID – statusLabel. This function can be used, for instance, to populate the filter by status in the Attachments table. - getStatusLabel – Given a status ID, this function must return the related label.
- getApprovedStatusId – When the Widget is in Review mode, the Approve button is provided (see the Reviewer mode section for details). This function must return the status ID of the state reached by the attachment when the user performs the Approve Action.
For example, the Digital Binder Configuration Kit contains the following example implementation:
Function getApprovedStatusId() : String Begin
Return DigitalBinderConfigurationKit:StatusEnum.APPROVED();
End
This information is used to drive the Screen logic, e.g., to show the right buttons (Approve and Return, as opposed to Change Decision) depending on the attachment internal status.
- getReturnedStatusId – It works similarly to the
getApprovedStatusId function. This function, however, must return the status ID related to the returned state of the attachment.
As already mentioned, the Status Manager is triggered by a call of the checkAndUpdateStatus function. The function accepts, as arguments, the attachment that is subject to a change event and a Named Collection of parameters that are used to model the transitions of the state machine. An example of the function call can be:
$digitalBinder.statusManager.checkAndUpdateStatus($attachment, {DigitalBinder:StatusManager.ACTION_KEY()=DigitalBinder:StatusManager.APPROVE_ACTION()}:Any)
The Status Manager base class provides several static functions to access and test predefined parameters, for instance the action value is always accessible by $params[DigitalBinder:StatusManager.ACTION_KEY()] containing one of the action values, e.g. DigitalBinder:StatusManager.CREATED_ACTION().
You can check whether the event is, e.g., an Activity Started event getting the activity ID in the following way:
If $params[DigitalBinder:StatusManager.ACTION_KEY()] == DigitalBinder:StatusManager.ACTIVITY_STARTED_ACTION() Then
String $activityId := $params[DigitalBinder:StatusManager.ACTIVITY_KEY()];
End
For the ‘out-of-the-box’ events, the following collection of parameters that can be verified by using predefined key values has been defined:
| Event | Description | Event | Activity |
|---|
| Attachment Created | Raised every time an attachment is created, either as a placeholder or directly by uploading one or more files. | CREATE_ACTION | - |
| Attachment Uploaded | Generated when the user uploads a file by using the Upload button associated with an existing file attachment. | UPLOAD_ACTION | - |
| Attachment Metadata Stored | Raised when the user clicks on the Save button in the sidebar metadata editor. | SAVE_METADATA_ACTION | - |
| Attachment Sent for Review | Generated when a task related to a Review mode activity is created for the attachment provided as an argument. | SENT_FOR_REVIEW | - |
| Attachment Approved | Notified when an attachment has been approved. | APPROVE_ACTION | - |
| Attachment Returned | Notified when an attachment has been returned. | RETURN_ACTION | - |
| Activity Started | Raised when a Task Process begins. | ACTIVITY_STARTED_ACTION | Activity ID |
| Activity Completed | Raised when a Task Process ends. | ACTIVITY_COMPLETED_ACTION | Activity ID |
| Activity Canceled | Raised when a Task Process is canceled by the Owner. | ACTIVITY_CANCELED_ACTION | Activity ID |
This section contains an example of the Status Manager implementation. The scenario is a simplified use of the Digital Binder, with no Virtual Links and only four possible statuses for an attachment:

For the sake of simplicity, MyPackage:MyStatusManager provides static functions for getting status IDs, and contains a Named Collection of DigitalBinder:KeyValuePair storing the complete set of available statuses.
The constructor must be redefined in order to accept a Digital Binder instance as a parameter:
Function NEW(DigitalBinder:DigitalBinder $digitalBinder := null) : Nothing Begin
SUPER(DigitalBinder:StatusManager, $this).NEW($digitalBinder);
$this.statuses := {}:DigitalBinder:KeyValuePair;
…
Following is a list of Status Manager overridden functions:
getStatusesList
Function getStatusesList() : Indexed DigitalBinder:KeyValuePair Begin
Return CLONE(VALUES($this.statuses));
End
getStatusLabel
Function getStatusLabel(String $statusId) : String Begin
If NOT($this.statuses.containsKey($statusId)) Then
Return null;
End
Return $this.statuses[$statusId].value;
End
getApprovedStatusId
Function getApprovedStatusId() : String Begin
Return MyPackage:MyStatusManager.ACCEPTED_ST();
End
getReturnedStatusId
Function getReturnedStatusId() : String Begin
Return MyPackage:MyStatusManager.REJECTED_ST();
End
calculateNextStatus
Function calculateNextStatus(SmartAttachments:SmartAttachment $attachment, Named Any $params := null) : String Begin
If TOSTRING($params[DigitalBinder:StatusManager.ACTION_KEY()]) == DigitalBinder:StatusManager.CREATE_ACTION() Then
If EMPTY(CAST(SmartAttachments:FileAttachment, $attachment).getFilePath()) Then
Return MyPackage:MyStatusManager.EMPTY_ST();
End
Return MyPackage:MyStatusManager.UPLOADED_ST();
End
If TOSTRING($params[DigitalBinder:StatusManager.ACTION_KEY()]) == DigitalBinder:StatusManager.UPLOAD_ACTION() Then
If DigitalBinder:StatusManager.getCurrentStatus($attachment) == MyPackage:MyStatusManager.EMPTY_ST() Then
Return MyPackage:MyStatusManager.UPLOADED_ST();
End
Return null;
End
If TOSTRING($params[DigitalBinder:StatusManager.ACTION_KEY()]) == DigitalBinder:StatusManager.APPROVE_ACTION() Then
If DigitalBinder:StatusManager.getCurrentStatus($attachment) == MyPackage:MyStatusManager.UPLOADED_ST() Then
Return MyPackage:MyStatusManager.ACCEPTED_ST();
End
Return null;
End
If TOSTRING($params[DigitalBinder:StatusManager.ACTION_KEY()]) == DigitalBinder:StatusManager.RETURN_ACTION() Then
If DigitalBinder:StatusManager.getCurrentStatus($attachment) == MyPackage:MyStatusManager.UPLOADED_ST() Then
Return MyPackage:MyStatusManager.REJECTED_ST();
End
Return null;
End
End
Once the Data Class has been implemented, an instance of this Status Manager must be registered during the Digital Binder object configuration:
MyPackage:MyStatusManager $myStMngr := NewObject(MyPackage:MyStatusManager);
$myDigitalBinder.setStatusManager($myStMngr);
If enabled, the Collaboration Layer manages all the features related to activity definitions and task handling (generation and orchestration). It can be logically separated in two parts:
- Activity Configuration – Performed at design time, it comprises the implementation required to configure the business logic for activities and task assignment.
- Task Orchestration – Performed at runtime, it comprises the logic for task generation and orchestration (re-assignment, canceling, and so on).
All the tasks generated through the Digital Binder are normal Workitems which users can also access through the Inbox. However, the main Widget (when in Owner mode) reports the current situation in terms of ongoing/canceled/closed tasks in the Collaboration tab restricting the scope of overall Inbox tasks to the ones related to the Digital Binder.
The Activity Configuration Manager is the module that contains the logic about the definition of the possible activities assignable for one or more attachments at a certain point in time and, given an allowed activity, defines the list of possible assignees (either users or group/roles) for it.
Your application must implement its own version of the Activity Configuration Manager by extending the DigitalBinder:ActivityConfigurationManager Data Class.
To understand how this module is used by the Widget, refer to the interaction described in the following figure:

- The user selects one or more items in the document list, opens the Collaboration tab and clicks on the Assign task button.
- The Widget requests the Activity Configuration Manager of the current Digital Binder object to calculate the list of available activities for the selected attachments (the Task will be assigned to dropdown list is still disabled at this point).
- The user picks one of the activities from the list.
- The Widget requests the module to calculate and provide the list of possible assignees given the selected attachments and activity. As a result, the dropdown list is enabled and it displays the list of elements obtained. If the user then selects a different activity from the available ones, the ‘assignee’ dropdown list items are calculated again.
The logic behind the available activities and the calculation of possible assignees is completely up to your application. To configure it, the following list of functions need to be redefined when creating the activity configuration manager:
- getWholeActivityList – It must return an Indexed Collection of
DigitalBinder:KeyValuePair, which is the actual list of all the possible activities used in your application, in the form activity ID – activity Label - getActivityLabel – Given an activity ID as an input, the function must return the related label.
- getAvailableActivitiesForDocument – This is the function called in step (1) of the previous diagram, it gets the selected SmartAttachment as an input and returns the available activities in the form of an Indexed Collection of key-value pairs as outputs.
- getAvailableAssigneeForActivity – This is the function called in step (4) of the previous diagram, it gets an activity ID and a SmartAttachment as inputs and returns the list of available assignees for such activity as an output. This list is still in the form of an Indexed Collection of key-value pairs but, in this case, the values entered as keys must be valid user/role/group ids (e.g. rob.smith, ROLE:Manager, GROUP:ComplianceTeam)
In addition to the above functions, a valid Activity Configuration Manager implementation is required to redefine the following functions:
- isLockingActivity – This function is used to check whether the activity ID provided as an input is a locking activity (see the Entitlement Management section for more information). All the activities are locking activities by default. Therefore, the function returns
true, unless your application redefines the default implementation. - isReviewModeActivity – This function must return true if the activity provided as an input triggers the Review mode when the task is opened by the user. It returns
false by default.
- getPriorities – This function has a default implementation and provides the default collection (Indexed DigitalBinder:KeyValuePair) of priorities the user can select when assigning a task. The function can be redefined to provide a custom set of priorities. To customize the labels of the default priorities, it is enough to change them in the DigitalBinder Package.
- getTaskScreenTitle – (to be redefined in the application). It is used to properly define the title of the task screens.
- getTaskScreenSubTitle – (to be redefined in the application). It is used to define the title of the task screens properly.
- dressTokenForInbox – (empty by default). It is meant to be redefined if custom attributes on the task token need to be set. These attributes can then be used in the Inbox, or wherever required (please see Digital Binder Tasks in the Inbox section).
It is worth mentioning what happens when users select more than one item from the list to assign a task related to them. The base Activity Configuration Manager class provides the following two (already implemented) functions:
-
getCommonAvailableActivities – Given a collection of attachments, this function calculates the available activities list for each of them (using the getAvailableActivitiesForDocument function in your application) and returns only the common elements (set intersection) as outputs. See the following example:

The common activities list, calculated by getting the three attachments reported above as inputs, is [ A3, A5 ].
-
getCommonAvailableAssignee – Given an activity ID and a collection of attachments as an input, this function returns the set intersection of the available assignees calculated for each attachment using the getAvailableAssigneeForActivity function as an output. The same approach as in the previous function is applied.
The Task Generation mechanism must create standard Appway Workitems, so that the assignee can access the related tasks from the Inbox.
To avoid dealing with Process logic and Process Actions in the application using the Digital Binder Widget, the token generation mechanism is based on a message exchange, via the Process Message Queue, between the Digital Binder Screen Include/Model and a component called Task Generator.
The Task Generator is a Sub-Process, called DigitalBinder:TaskGenerator, which must be included into the main Process of an application and fed with a single token.

The Task Generator Sub-Process accepts, as an assigned variable, an Indexed Collection of DigitalBinder objects for which it needs to generate tasks. However, this assignment is not mandatory because a Digital Binder can register itself on the Task Generator instance. Therefore, if the Digital Binder object is created after the initialization of the task generation Sub-Process, the only mandatory requirement is to register it by calling the dedicated function of the Digital Binder:
$myDigitalBinder.selfRegisterOnTaskGenerator().
Note that the Task Generator can serve several Digital Binder instances at the same time. Therefore, it must be included only once in the main Process.
In order for it to work properly and catch the task generation requests coming from the Digital Binder Widget, the Task Generator needs a dedicated Process Message Queue. The name for such a queue is DigitalBinderTaskGeneration.
In Digital Binder 2.0.0 and lower, the default name for such a queue is still DigitalBinderTaskGeneration, but your application can set a different name. To do so, the following configuration property needs to be set: digitalbinder.task.generation.queue=SOLUTION_TASK_GENERATION_QUEUE_NAME.
Consider that the creation of the queues is not automatic when importing Packages, therefore it must be executed on your application environment manually.
When the Task Generator spawns a new task, the task is processed by a Sub-Process called DigitalBinder:TaskProcess described in the following image.

The numbered path corresponds to a normal flow of a Task Process execution, assuming that the task Owner is not making any assignment changes at runtime, e.g., claim back the task or reassign it to another user. The steps are as follows:
- The Process Token is configured to be recognizable as Digital Binder-related (Process attribute settings are defined).
- The entitlements are configured for each of the attachments in scope for the task (see the Entitlement Management section). This script task also creates the starting task event notification for the Status Manager by invoking the checkAndUpdateStatus function of the Status Manager and providing the following parameters:
{DigitalBinder:StatusManager.ACTION_KEY()=DigitalBinder:StatusManager.ACTIVITY_STARTED_ACTION(), DigitalBinder:StatusManager.ACTIVITY_KEY()=$taskInfo.activityId}:Any. - This is the main step of a Task Process. The assignee ‘lands’ on this Screen when opening the task from the Inbox. This predefined screen contains the Digital Binder Widget operating in Task or Review Mode, depending on the configuration of the activity that led to generating the task.
- After the assignee performs the requested activities on the main Screen, he/she clicks on the Next button and reaches a summary screen, where a description of the work done has to be entered before formally closing the task.
- The completion of the task is stored in the model, thus updating its state and generating the relevant event for the Status Manager:
{DigitalBinder:StatusManager.ACTION_KEY()=DigitalBinder:StatusManager.ACTIVITY_COMPLETED_ACTION(), DigitalBinder:StatusManager.ACTIVITY_KEY()=$taskInfo.activityId}:Any
The attachment is unlocked and its entitlements are updated to account for the fact that the task has been completed.
For further information on task cancellation and re-assignment, see the Runtime Assignment Handling section.
To provide a basic level of customization for the embedded Screens, two functions are provided as part of the ActivityConfiguration Data Class — to set the title and the subtitle of the Screens shown in the Task Assignee and Reviewer Modes use:
- ActivityConfigurationManager:GetTaskScreenTitle
- ActivityConfigurationManager:GetTaskScreenSubTitle
These functions need to be overridden to provide the desired textual content for titles and subtitles, respectively.
It is possible to define a custom activity when assigning a task to a user, if needed. To do so, the component requires the implementation of two methods in the ActivityConfigurationManager Data Class. Following is an example:
Function isCustomActivity(String $activityId) : Boolean Begin
…[LOGIC BASED ON $activityId IF NEEDED] …
Return true;
End
Function getCustomActivityProcess(DigitalBinder:CollaborationTask $taskInfo) : Process:Reference Begin
…[LOGIC BASED ON $taskInfo IF NEEDED]
Return Process:NewReference('DigitalBinderConfigurationKit:CustomActivity');
End
As the custom process is injected into the DigitalBinder:TaskProcess process dynamically, it needs to inherit part or all of the variables defined by the container process.
After a generated task has been assigned, the assignment can be changed by the Owner at runtime (or by users in certain cases) through several operations provided by the Digital Binder component. The following subsections describe all available operations.
The Digital Binder Owner can cancel an ongoing task through the Collaboration tab:

When the Owner clicks on Cancel Task and confirms the action on the popup dialog, the system sends a standard Appway Signal to the task-related Sub-Process Instance, thus causing the token to move. The following actions take place:
- The token is moved from the main task Screen.
- Entitlements are restored to ‘pre-task’ configuration.
- The Status Manager receives an event of type ACTIVITY_CANCELED_ACTION.
- The current assignee lands on a screen warning him/her the task has been canceled.
- If the assignee does not click on Close in the messaging Screen, the token is moved forward automatically after 24 hours.
- The task Sub-Process Instance ends.
If the current assignee needs to be changed at runtime, the Owner can use the Re-assign Action. The system displays the task editing panel, where the user can set a new assignee for the task and change all the information, with the exception of the activity type.


Once the Owner has performed the necessary changes and clicks on the Send button, the following actions take place:
- A Process message containing the information on the new assignee is sent to the TaskProcess Instance. A dedicated Process Message Queue, which must exist in the system and be properly configured, is used for this operation. The name of the queue is DigitalBinderTaskSpecific.
In Digital Binder 2.0.0 and lower, the default name of the queue is still DigitalBinderTaskSpecific. However, this name can be customized by creating another queue and setting its name through the following configuration property: digitalbinder.task.specific.queue = SOLUTION_TASK_SPECIFIC_QUEUE_NAME.
- The TaskProcess Instance gets the message and updates the current assignee for the task and for the Swimlane expression.
- The previous assignee is taken to a messaging Screen where he/she gets notified that the task has been reassigned by the Owner.
- If the previous assignee does not click on Close in the messaging Screen, the token is moved forward automatically after 24 hours.
The Owner has the possibility to claim back (self-reassign) all the ‘normal’ tasks. However, claiming back a review/approval task is not possible, which helps safeguard the segregation of duties.
If a task is claimed back, it does not mean the Owner can perform the activity him/herself: self-reassigning a task means ‘parking’ the task while waiting to reassign it or cancel it.
If the task is canceled, entitlements are recomputed,the attachment is unlocked, and the Owner can perform any action on the related attachments.
The mechanism used to claim back a task is the same used for re-assigning it with the only difference that the new assignee is the Owner of the Digital Binder object by default.
When the task is assigned to a Group/Role, the Digital Binder does not allow all users to see the content of the task. Instead it provides the possibility to take ownership of the task from the Inbox. The Task itself is unlocked after passing through an intermediate step: a Take Ownership Screen.

The user needs to provide a description and click on the Take Ownership button to trigger a Process Action that performs the following steps:
- Checks whether the user belongs to the current group/role assignee to be able to continue.
- Updated the task assignment with the current user.
- Updates the Swimlane expression.
- Reloads the Screen: the user can now see the Digital Binder content.
Each SmartAttachment object, either a file or a virtual link, contains its own entitlement configuration. This is an instance of the SmartAttachments:EntitlementConfiguration Data Class (or a type inheriting from it).
An entitlement configuration can keep information about four different access rights to the attachment:
- viewers – Users, groups or roles eligible to visualize the attachment.
- editors – Users, groups or roles eligible to edit attachments.e.g. by editing its metadata properties.
- uploaders – Users, groups or roles eligible to upload the file content.
- reviewers – User, groups or roles eligible to review the attachment (meaning approving/returning an attachment).
is passed in the values for the above categories as Indexed Collections of type String. If a collection is empty, nobody has the specific access right. To provide eligibility to everybody, the static method SmartAttachments:EntitlementConfiguration.ANYONE()can be used.
For a more fine-grained access control, the getEntitlementConfiguration must be used (see below).
Given a user ID and an attachment, its entitlements can be tested at runtime using the following functions of the SmartAttachments:EntitlementConfiguration Data Class:
| Function | Condition |
|---|
isUserEligibleToView isUserEligibleToEdit isUserEligibleToUpload isUserEligibleToReview | true if one of the following is true: - The provided user ID is contained in the category collection. - The provided user belongs to one of the roles reported in the category collection. - The provided user belongs to one of the groups reported in the category collection. |
To implement the required logic in terms of entitlements for a solution, a Data Class extending the DigitalBinder:EntitlementManager needs to be implemented. The DigitalBinder:EntitlementManager contains the following two functions:
- getEntitlementConfiguration – You can redefine the function to define the custom logic required by your application. The function accepts an attachment ID as an input, a Digital Binder object, and a task object (optional).
Without the task object parameter, this method is expected to return the entitlements for the attachment within the main Digital Binder screen (refer to the Digital Binder Owner Exception section for owner entitlements).
With the task object parameter, this method is expected to return the entitlements for this task on this attachment.
By default, it returns an instance of the SmartAttachment:EntitlementConfiguration Data Class that is configured to allow everyone to perform any actions on an attachment (all categories are empty).
-
setEntitlementConfiguration – This function is already implemented and does not need to be redefined. The Digital Binder component calls this function on its Entitlement Manager whenever the configuration for one or more attachments needs to be recalculated and updated (see the Task Process section): at the creation of an attachment, or when a task is created, reassigned, cancelled or completed.
It calls the getEntitlementConfiguration function for the attachment and for each ongoing task on this attachment.
-
Attachment IDs (Indexed String)
-
Digital Binder (DigitalBinder:DigitalBinder)
If you implement your own version of the Entitlement Manager, then you must register it with the Digital Binder when initializing it:
…
$digitalBinder.entitlementManager := NewObject(DigitalBinderStarterKit:EntitlementManager);
…
As described above, the Digital Binder Widget uses the entitlements to configure the permitted interactions for the current user. An exception to this mechanism is the Owner role, meaning that the Widget first checks whether the current user is the Owner and personalizes the UI. Consequently, it shows/hides Owner-related activities (e.g. the ‘Delete’ Action is only available to the Owner).
For this reason, when the Owner claims a task back, he/she cannot perform activities in Task Mode, as in this case the items would still be locked (in the case of a locking activity). To be able to work on such items, the Owner can either reassign the task to someone else or cancel the task to revert to the normal working mode.
The Digital Binder component allows customizing the set of attributes for the tokens generated by the Task Generator Sub-Process. As soon as the Task Process starts, it stores a predefined set of attributes used to relate the tokens with the Digital Binder object and, in addition, it calls the DressTokenForInbox function:
…
Try
$digitalBinder.activityConfigurationManager.dressTokenForInbox(ProcessToken().getId(), $taskInfo,
$digitalBinder);
…
The base implementation is empty. You can override it in your own implementation of the activity configuration manager to define your desired logic. The goal is to give you the possibility to store the attributes that you need to use in the Inbox to represent Digital Binder tasks.
As described into the Task Process section, the Digital Binder implements its own logic, Process Message-based, to perform task reassignment.
This logic needs to be used to enable task reassignment also from other parts of the solution or from other modules, such as the Inbox. For this purpose, the Digital Binder exposes the following Script Function that can be used in a solution’s own Inbox implementation:
DigitalBinder:GetReassignmentWorkitemFromTask: it takes a Workitem that needs to be related to a Digital Binder Task as an input (see next section to know how to check and ensure this criterion) and returns a Workitem ID. When displaying the Workitem, the user is redirected to to an existing Screen Task that reports the task summary and provides a dropdown list to select the next assignee. The assignee dropdown is automatically populated using the Activity Configuration Manager logic. After selecting a new assignee and clicking on the Reassign button, the current user is redirected to its own portal and the task is reassigned accordingly.
The following image shows the reassignment screen:

In order to support the information displayed in the Inbox, the component offers the DigitalBinder:IsDigitalBinderTask Script Function. Given a Workitem provided as an input, it returns true if this is related to a Digital Binder Task, false otherwise.
It can be used, for example, to drive the right reassignment logic from a Task’s action bar.
The DigitalBinder Data Class provides two functions that can be used as a 'factory' for placeholders. When using these functions, the Digital Binder creates the required file placeholders or link placeholders, thus making sure that the right configuration is used. Details such as metadata configuration or attachment runtime types are automatically inferred based on the internal configuration of the DigitalBinder instance.
The signatures of the two functions are as follows:
createEmptyFilePlaceholder(Boolean $addToTheDigitalBinder := true) : SmartAttachments:FileAttachmentcreateEmptyLinkPlaceholder(Boolean $addToDigitalBinder := true) : SmartAttachments:VirtualLinkAttachment
The functions accept a Boolean argument:
- When this is set to
false, the returned SmartAttachment is not added into the DigitalBinder instance used to create it. - Otherwise, and by default, the
FileAttachment or VirtualLinkAttachment, respectively, are automatically available in the attachment list.
The DigitalBinderLoader Data Class is useful when it is necessary to reconstruct a Digital Binder instance (in terms of attachment list) from a supported source e.g. filesystem, database, external CMS, and so on. The Digital Binder Loader is an 'abstract' Data Class that implements all the logic required to populate a Digital Binder instance. It has to be extended by a concrete Data Class that defines the specific attachment retrieval logic.
Call the load function of the loader instance to populate the Digital Binder. The following steps are performed when the function is called:
init(): This function is empty in the base Class implementation and can be overridden, if required.setupAttachmentsList(): This is the entry point for the specific retrieval logic and must be implemented in the concrete Data Class. When this step is executed, the loader expects to have enqueued all the files and link attachments that are to be loaded. For this purpose, the base Class provides two functions:
- enqueueFileAttachment (String $filePath, Named Any $metadata := {}:Any)
- enqueueVirtualLinkAttachment (String $link, Named Any $metadata := {}:Any)
The $metadada collection is optional and, if provided, it is mapped to the metadata information of each enqueued attachment.
loadFileAttachments(): This is already implemented in the base Data Class. Each enqueued file attachment is processed to create a Smart Attachment and then added into the Digital Binder attachments list. Important: Please, make sure to provide a copy of each file and do not point to the original file with the $filePath argument in the enqueue function, since this is deleted after the Smart Attachment creation.
loadLinkAttachments() : This is already implemented, with each enqueued link attachment being processed and turned into a Smart Attachment of type Virtual Link and then added to the Digital Binder.
Therefore, in order to implement a valid and working Digital Binder loader it is required to:
- Provide an implementation of the NEW function in a Data Class that extends the Digital Binder Loader Data Class. A valid Digital Binder instance needs to be provided as an input, and it is mandatory to call SUPER(DigitalBinder:DigitalBinderLoader, $this).NEW($digitalBinder) to make sure it is used properly.
- Override the init function (if needed).
- Override the setupAttachmentsList by implementing the logic required to enqueue all the attachments to be imported. The internal logic of the loader relies on local files to load the attachments. For this reason, it is necessary to provide the files on a reachable filesystem location. This is required even if the Digital Binder uses a different storage strategy (e.g., database), since this is actually a temporary storage of the file content just before importing them.
The DigitalBinderConfigurationKit Package contains an example of Digital Binder Loader that reconstructs a Digital Binder instance from local files (the files are created on demand for the sake of the example).
This feature is available for Digital Binder 2.0 and higher.
You can mark an attachment as mandatory.
The attachment is implemented at the metadata level inside the DigitalBinder:AttachmentMetaData Data Class, and a new metadata property has been added: isMarkedMandatory.
In order to make it easier to mark/unmark an attachment, the Data Class provides the following functions:
- markAsMandatory
- unmarkAsMandatory
As usual, the metadata item can be retrieved usingDigitalBinder:AttachmentMetaDataEnum. ISMARKEDMANDATORY().
The runtime meaning of this marker is responsible for the final solution. At the core level, it just allows marking the attachment and show it on the Digital Binder widget:

Important: the text shown on the marker is a Label, therefore it can be customized to bring a different message to the user, e.g. 'required', 'important', and so on. The Label Business Object to tune is DigitalBinder:mandatory.attachment.marker.
Usually, in a Digital Binder running instance, only the Owner can delete an attachment. However, in some cases, the Owner should not be able to delete one or more elements either temporarily or permanently.
To prevent the Owner from deleting any elements, set the isDeletionAllowed metadata property, provided by the DigitalBinder:AttachmentMetaData Data Class to true. The Delete action is then hidden from the Owner and for the specified attachment in the Digital Binder widget.
The SmartAttachments Package provides a library to manage the low-level and basic aspects related to working with attachments — either files or links. A Smart Attachment is an entity made of three elements:
- The entity itself, which is a Smart Attachment instance - a SmartAttachment exists even if the content (file or link) is not yet defined.
- The content, either a file or a link.
- The metainformation represented as metadata properties.
The following sections provide details on the attachments currently available and how to create and configure them, how to handle metadata and the required Package configuration.
The attachment types available ‘out-of-the-box’ are described in the following class diagram and described subsequently:

- SmartAttachment (abstract) – Base class implementing the common model for the smart attachments. This model holds the entitlement configuration as an instance of EntitlementConfiguration, the metadata represented as the AttachmentMetadataBean and the attachment ID.
The attachment ID is generated in the NEW function. Therefore, it is important to always invoke the NEW function of the superclass when extending a Data Class that is part of the SmartAttachment hierarchy.
This Data Class contains two interface functions that must be redefined by subclasses:
- cleanup – Responsible for freeing the resources when the attachment is no longer required or when the file content needs to be replaced (e.g. remove old file).
- getAttachmentURL – The attachment consumers use this function to get the right link to download a file or to go to a virtual link.
- VirtualLinkAttachment (concrete) –This Data Class allows creating virtual link attachments, which are attachments that contain a link instead of real binary content.
- FileAttachment (abstract) – Base class for file attachments. It provides the following properties:
- fileName – The name of the file, it can be a custom name defined when storing the file.
- filePath – Path to the file.
- fileSize – Size of the file (Long).
In terms of functions, the following are most often used:
-
buildFilePath – This function, already implemented, builds the path where the file is stored when uploaded. The path is built using the following pattern, BASE_FOLDER/PROC_INST_ID/ATTACH_ID/fileName, where the structural elements are:
-
BASE_FOLDER – The global base folder used for smart attachment uploads. The default value is ‘work/tmp/uploads’ relative path to the datahome. This folder can be customized by setting the smartattachments.fileAttachment.uploadBaseFolder configuration property as desired.
-
PROC_INST_ID – If available, the current Process Instance ID (used to isolate folders from Process Instances).
-
ATTACH_ID – A folder with the attachment ID as a name is created to isolate attachments from each other.
-
fileName – Current value of the fileName property. E.g.: DATA_HOME/work/tmp/uploads/1539414030719/602ad129-b15d-441e-bfd0-e7cc2b493756/myFile.txt
-
getAttachmentURL – Coming from the superclass, it provides the following value as outputs:
FILESYSTEMURL($this.filePath) & '?forceSaveAs=' & $this.fileName;
-
storeUploadedFile – Abstract function that must be implemented in the subclasses to handle the storage of a recently uploaded file in order to turn the httpFileUpload content into the specific file container (e.g. local file). This function accepts an optional parameter, customFileName, to apply a custom name to the file being created (if needed).
-
LocalFileAttachment (concrete) – This Data Class implements attachments that store the file content into Appway Local Files.
-
RemoteFileAttachment (abstract) – This Data Class is the base abstract implementation for attachments with content stored outside Appway (e.g. Database, DMS, Cloud Storage, and so on). It provides part of the implementation for content retrieval and storage for the httpFileUpload. The mechanism is based on local files:
- When uploading a file, the storeUploadedFile function of the Data Class creates a temporary local file based on the httpFileUpload content and calls the remote attachment implementation to get the file content and store it remotely.
- When retrieving file content, the implementation has to provide the remote information and the binary is stored into a local file. The Data Class provides a valid pointer to it.
The abstract functions that need to be implemented by a subclass to have a working remote attachment are:
- _insertAttachment – Given a local file as an input, this function is used to store the file content remotely. It is called in the storeUploadedFile function.
- _selectAttachment – Performs the download of the content into a temporary local file. It is called in getFilePath to provide the file path that can be used for URI building
- _isAttachmentPresentAlready – Checks and returns
true if previous content is already available for this attachment. Usually, it is used to check whether an update or a cleanup operation are required before uploading the new binary content remotely. - _deleteAttachment – This function is called by the cleanup function.
-
DatabaseAttachment (concrete) – This remote file attachment allows to transparently store the attachment contents into a database. To have it working in this version of the Data Class, provide the following:
- A valid Data Source ID and a proper setting of the
smartattachments.databaseAttachment.datasourceID configuration property, for instance: smartattachments.databaseAttachment.datasourceID=MySQL - A database table with the following structure:
- name – attachments
- column – id (VARCHAR)
- column – data (BLOB)
All the operations to query and manage the BLOB content are performed using standard JDBC operations.
-
BlobAttachment (concrete) – This remote file attachment allows you to transparently store the attachment contents into a Blob Storage. The silo name to be used is configured through the property blob.smart.attachment.silo.name.
Each smart attachment instance requires, when created, an object of type SmartAttachment:AttachmentMetadataBean as a parameter. This Data Class implements the base concept of the metadata container. Each property is defined as a normal property of the Data Class itself, but there are some additional features that allow setting (even at runtime) whether a metadata property is mandatory, visible, or even read-only.
The Data Class offers the following functions to interact with a metadata bean:
| Function | Description |
|---|
checkItemType | Given a property name and type, it returns true if the property is of that type, false otherwise. |
getItemLabel | Given a property name, it returns the registered label for it. |
getMetadataItem | Given a metadata property name, it returns the value stored in the property. |
getMetadataItemNames | Returns the names of all the available properties. |
getVisibleMetadataNames | Returns all the names of the properties configured as visible. |
isItemMandatory | Returns true if the property is set to be mandatory. |
isItemReadonly | Returns true if the property is set to be read-only. |
isItemVisible | Returns true if the property is set to be visible. |
setItemEditable | Sets the given property as editable (not read-only). |
setItemHidden | Sets the given property as not visible. |
setItemLabel | Registers the label related to the given property. |
setItemMandatory | Sets the given property as mandatory. |
setItemReadonly | Sets the given property as read-only. |
setItemVisible | Sets the given property as visible. |
setItemTooltip | Sets the label to be shown as a tooltip for the given property. |
When extending the SmartAttachments:AttachmentMetadataBean, you need to invoke the constructor of the superclass in your NEW function to create the underlying data structures for metadata handling correctly.
To make the access to metadata properties easier, you can use a convenience enumeration that can be generated for an attachment metadata bean implementation instead of using raw names.
As an example, suppose you need to have the following metadata properties (not provided by the base class):
- category (String)
- department (String)
Follow these steps:
- Create a new Data Class inheriting from the base SmartAttachments:AttachmentMetadataBean:

- Define the two new properties and save the Data Class:

- Open an Interactive Script Editor and run the following code:
SmartAttachments:GenerateEnumeration(NewObject(MyPackage:MyAttachmentMetadataBean)) - A new Data Class containing convenience functions to get the ‘id’ of the available properties is now available (each enumeration generated contains all the properties inherited from the ancestor beans).


You can now set the properties (e.g. visible) and the category to be mandatory in the NEW function of the newly created metadata bean
Function NEW() : Nothing Begin
SUPER(SmartAttachments:AttachmentMetadataBean, $this).NEW();
$this.setItemVisible(MyPackage:MyAttachmentMetadataBeanEnum.CATEGORY());
$this.setItemVisible(MyPackage:MyAttachmentMetadataBeanEnum.DEPARTMENT());
$this.setItemMandatory(MyPackage:MyAttachmentMetadataBeanEnum.CATEGORY());
End
The SmartAttachments Package provides a convenience Data Class to create smart attachment instances at runtime, choosing the right implementation needed by your application.
The Data Class is called SmartAttachments:SmartAttachmentsFactory and contains the following two static functions:
createFileAttachment(
String $fileAttachmentType,
SmartAttachments:AttachmentMetadataBean $metadata,
SmartAttachments:EntitlementConfiguration $entitlements :=
new SmartAttachments:EntitlementConfiguration) :
SmartAttachments:FileAttachment
createVirtualLinkAttachment(
SmartAttachments:AttachmentMetadataBean $metadata,
SmartAttachments:EntitlementConfiguration $entitlements :=
new SmartAttachments:EntitlementConfiguration) :
SmartAttachments:VirtualLinkAttachment
It is not mandatory to use the factory for smart attachment creation, but it can prove useful when the file attachment type is custom-defined in your application, either at runtime or design time.
In addition to the smart attachment basic data model, the Package provides a useful Data Class (SmartAttachments:SmartAttachmentList) that implements the concept of the Smart Attachment list container.
It contains two properties:
- attachments (Named SmartAttachments:SmartAttachment) – A collection that stores the attachments in a key-value way, where the key is the attachment ID.
- defaultFileAttachmentType (String) – Set via constructor argument, it contains the default type to be used when the collection is asked to push a new empty file attachment. If it is not provided when creating the instance, the default value is the LocalFileAttachment type.
The Data Class provides the following ready-to-be-used functions:
addAttachment – Adds/updates the provided attachment into the collection.removeAttachment, removeAttachmentById – Both functions remove the provided attachment, or the one identified by the provided ID, from the collection.pushDefaultFileAttachment – Creates an empty smart attachment instance, of the type defined in defaultFileAttachmentType, and adds it to the collection.
The SmartAttachments Package contains a small set of Business Objects that support a filtering mechanism to be applied on a generic Indexed Collection of Smart Attachments.
This part of the Package is meant to be extendable to fulfill the specific needs of your applications. In other words, the Package provides the engine for filtering and allows your applications to implement their own set of filters.
The following Data Classes are provided:
- BaseFilter – Base abstract Data Class for a filter. The inheriting implementation must redefine the following functions:
accept – Given an attachment, it returns true if it passes the filter.addFilter – To be implemented in the case of a composite filter (e.g. AND, OR and NOT filters provide it). The function must get a filter object as an input and place it into the filterChain (collection of filters implemented as an indexed collection of BaseFilter objects into the BaseFilter Data Class itself)removeFilter – It removes a filter (if any) from the filter chain.
- ANDFilter (composite filter) – Its
accept function returns true if all the filters in its filter chain return true - ORFilter (composite filter) – Its
accept function returns true if at least one of the contained filters returns true. - NOTFilter – It contains a single filter in it and returns the logic NOT of the contained filter’s accept result.
Once the required filter structure is properly defined, it can be applied to a collection of smart attachments to get the attachments suitable for the filter logic as outputs. The necessary function is:
SmartAttachments:FilterSmartAttachments(
Indexed SmartAttachments:SmartAttachment $attachments,
SmartAttachments:BaseFilter $filter) :
Indexed SmartAttachments:SmartAttachment
The SmartAttachments Package, alongside the filtering engine, also offers a small internal module to support the sorting of an Indexed Collection of smart attachments.
The whole mechanism is based on the SORT Appway standard function, which is used by passing the needed ‘comparator’ (a Script Function Business Object) by default to perform the desired sorting.
The Package provides two ready-to-be-used sorting criteria:
- Sorting by Creation Date (Script Function:
CompareAttachmentsByCreationDate) - Sorting by File Name (Script Function:
CompareAttachmentsByFileName)
The available sorting criteria are provided by the DigitalBinder object, if it has been correctly registered after creating it by using the registerSorting(SmartAttachments:Sorting $sorting) function.
The two sorting criteria reported above are already registered by the default implementation. If not required, they can be unregistered using the unregisterSorting(String $sortingId) function.
In order to control the sorting direction, an enumeration Data Class containing the two following encoded values is provided:
SmartAttachments:SortingDirectionEnum.ASCENDING()
SmartAttachments:SortingDirectionEnum.DESCENDING()
The sorting object Data Class provides the following functions:
| Function | Description |
|---|
getComparator | Returns the Script Function ID that needs to be used as a comparator for the sorting criterion. |
getDescription | Returns the sorting criterion description. |
getDirection | Returns the current sorting criterion direction. |
isDirectionAscending | Returns true if the current direction is ascending. |
isDirectionDescending | Returns true if the current direction is descending. |
toggleDirection | Switches the current direction to the other one. |
initBySortingRecord | Static function used to build a sorting object from a Catalog record (used internally when the system loads all the available sortings). |
The last step is actually to sort an Indexed Collection of attachments using the dedicated function:
SmartAttachments:SortSmartAttachments(
Indexed SmartAttachments:SmartAttachment $attachments,
SmartAttachments:Sorting $sortingConfiguration) :
Indexed SmartAttachments:SmartAttachment
Given the collection to be sorted and the sorting object to be used, this function returns the sorted collection as an output.
Following are the steps to be taken if your application needs to define, e.g., a sorting strategy based on file size:
- Define a comparator:
Function MyPackage:ComparatorByFileSize(SmartAttachments:SmartAttachment $sa1, SmartAttachments:SmartAttachment $sa2) : Integer Begin
Long $fileSizeAtt1 := 0;
Long $fileSizeAtt2 := 0;
If $sa1 isa SmartAttachments:FileAttachment Then
$fileSizeAtt1 := CAST(SmartAttachments:FileAttachment, $sa1).getFileSize();
End
If $sa2 isa SmartAttachments:FileAttachment Then
$fileSizeAtt2 := CAST(SmartAttachments:FileAttachment, $sa2).getFileSize();
End
Return $fileSizeAtt1 - $fileSizeAtt2;
End
- Register the sorting criteria just after the DigitalBinder object creation:
$digitalBinder.registerSorting(new SmartAttachments:Sorting(fileSize, 'File size', GETBUSINESSOBJECT('ScriptFunction', MyPackage:ComparatorByFileSize ')));

As a result, the GetSortings function loads a sorting object for the newly defined one, and it can be used to sort attachments accordingly.
This section provides details about the Digital Binder implementation aspects that are achieved by using the SmartAttachments Package.
- The
DigitalBinder:DigitalBinder Data Class inherits from SmartAttachments:SmartAttachmentList. - The Digital Binder component implements its own Attachment Metadata Bean (
DigitalBinder:AttachmentMetaData) providing additional metadata properties and features. The following properties are defined by this bean:
- category [mandatory]
- isLocked [hidden]
- name [visible]
- status [hidden]
- tags [hidden]
- type [visible]
The bean also provides the possibility to define and get placeholders to be used, for example, in input text fields. They can be handled using the setItemPlaceholder and getItemPlaceholder functions.
The latest version of the Digital Binder only supports the following medatada property types:
StringDateBooleanDigitalBinder:ListOfValues
The last type is used to provide metadata handled through a Dropdown List Screen Component. A ListOfValues object contains an Indexed Collection of DigitalBinder:KeyValuePair (called pairs in a property) and a value String property that is used for binding.
The DigitalBinder:CatalogBasedListOfValues makes the creation of such lists of values easier, e.g. by using Catalogs. It is enough to invoke the constructor with the correct arguments:
NEW(BusinessObject $catalog,
Named Any $variableAssignments := null,
String $keyColumn := 'id',
String $valueColumn := 'description')
The pairs collection is populated using the records of the Catalog, creating pairs of the form $keyColumn and $valueColumn based on the Catalog contents, e.g.:
$this.category := NewObject(DigitalBinder:CatalogBasedListOfValues, GETBUSINESSOBJECT('Catalogue', 'DigitalBinder:Category'), null, 'id', 'description')
Either generic lists of values or Catalog-based values should be initialized in the attachment metadata bean constructor.
- The Digital Binder component defines additional filters for smart attachments, used in the list widget, and defined only internally in the Package.
- By setting
isMultiSelect to true, it is possible to support multiple values. In this case, a value Indexed Collection of String property (inside DigitalBinder:KeyValuePair) is used for the binding.
This section describes the steps required when installing the Digital Binder for the first time.
The Digital Binder consists of the following Packages provided in the component bundle. Make sure that all the Packages are installed on your system:
- Digital Binder
- Smart Attachments
In addition, the Design System Package needs to be installed:
- Digital Binder 1.x requires Design System Package 5.0.1+
- Digital Binder 2.x requires Design System Package 5.1.2+
- Digital Binder 3.x requires Design System Package 6.0.0+
The Digital Binder requires:
- WorkitemFinder Extension 3.0.0 and higher
- Default Icons Extension 2.0.1 and higher.
After importing all the Packages provided with the Digital Binder Application Business Component in your Appway installation, you need to configure the Message Queues required by the Component.
In the Appway Studio, select Solution Maintenance > Process Messages and create two message queues:
- Name: DigitalBinderTaskGeneration. The Description and Max Size can be left empty. The Persistent checkbox needs to be selected. The Temporary checkbox can be left deselected.
- Name: DigitalBinderTaskSpecific. The Description and Max Size can be left empty. The Persistent checkbox needs to be selected. The Temporary checkbox can be left deselected.
This step has to be done only once, with the first installation. This step is not required when upgrading the Package to a new version.
The Digital Binder requires the following configuration property to be defined:
digitalbinder.file.attachment.type is the Type of Attachment to be used (the default is Local File Attachment)
In Digital Binder 2.0.0 and lower, the following configuration properties also need to be defined:
digitalbinder.task.generation.queue is the name of the Task Generation Message Queue.digitalbinder.task.specific.queue is the name of the Task Specific Message Queue.
Go to System Configuration > Configuration Properties > Edit Content Configuration to add the required properties, for example:
digitalbinder.file.attachment.type=SmartAttachments:LocalFileAttachment
To view notifications within the Digital Binder, the following Platform configuration is required so that the message is routed to the specific Notification Inbox related to the Digital Binder instance:
nm.usermessaging.notification.inbox.function.id=DigitalBinder:ChooseNotificationInbox
The layout of the Digital Binder is divided in two areas:
- The list of attachments to be created on the left.
- A sidebar showing more details of the attachments on the right.
The two-column layout gives users the overview of the attachments while they are manipulating the selected items.

The digital binder is intended to be used in full width screen in order to get an optimal overview of the tasks at hand. These tasks are around the entire handling of attachments, such as creating attachments, providing necessary metadata, but also assigning tasks to other collaborators, for example review or approval tasks.
All the Digital Binder Style Business Objects are placed in the (sealed) Digital Binder Package and they cannot be edited directly.
To achieve the desired styling, or to align the Digital Binder to a solution branding, all the Style Business Objects and Style Value Business Objects provided need to be cloned in a new or in an existing Style Package with the Style Package Tools.
The Configuration Kit is an example of configuring a Business Component, and bundles pre-created data objects, logic, or screen flows necessary to support a prototypical scenario.
The Digital Binder Configuration Kit addresses the prototypical scenario of gathering and classifying documents, in a setup involving numerous collaborators.
Please, consider that the Configuration Kit provided by Appway is just an example of how a Solution works. If you wish to use the Configuration Kit as a starting point for configuring your Solution, you may do so, but make sure you create a copy of the Configuration Kit and apply your changes to this copy. Otherwise, all your customizations will be overwritten when you upgrade to a new Configuration Kit.
The Digital Binder Configuration Kit covers the complete set of functionalities of the Digital Binder. Let’s follow a concrete scenario to demonstrate its capabilities.
Let’s assume there is a mortgage application of a buyer couple called Marco and Veronique Smith. Two credit officers, Igor Ubinov and Maria Miller, are in charge of collecting the required attachments, and finally having them checked for compliance by their line manager, Terry Lee. The required documents are: a balance sheet, a salary sheet of each buyer, and a copy of the passport for the identification of each buyer.
There are multiple ways of going through the workflow of approving attachments. A possible workflow is explained in the example:
- The credit officer Igor Ubinov creates placeholders for the required attachments, since he does not have the documents, and specifies the content. Once this is done, he assigns the task of uploading the documents to his colleague Maria Miller, who is the clients’ contact person.
- The credit officer Maria Miller gets notified about the task, picks it up in her Inbox, and uploads the documents. She then sets the task to complete, confirming to Igor that the documents are now ready to be approved.
- Igor gets notified about the upload, so he reviews the documents to check whether they are ready for approval. Since they all seem to be in order, he assigns the task “For approval” to his line manager, Terry Lee.
- The line manager Terry Lee receives the task of approving the attachments. He opens the task to check the documents. Since everything is fine, he can approve all documents.
The Digital Binder Inbox covers various aspects:
- Filters
- Task display
- Task actions
By default, the Inbox is configured with ownership filters: My Tasks, My Groups, My Roles, My Requests. This setup allows the Owner to track his/her ongoing tasks.
In the image below, you see an example of Inbox showing a task assigned to the Owner of the main Digital Binder task, as well as a task assigned to another role:

The Inbox provides support to customize the text elements shown on a Task Entity. This customization is performed by replacing the Inbox:TaskEntityDataProvider Data Class and specifying the static methods contained in it:
- The process name and phase shown on the upper corner can be defined in the
getProcessName() and getPhaseName() methods. - The main title is defined with the
getTitle() method. - The metadata line can be defined with the
getMetaData() method.
All data displayed in the Inbox has to be read from the Process Instance or Token attributes. The Digital Binder core sets and updates some Token attributes on Assigned Tasks: Activity label, Status, Due date (short format string), Originator (user ID). Some more attributes can be added as explained in the Digital Binder Tasks in the Inbox section.
The DigitalBinderConfigurationKit adds example Process Instance attributes containing information and statistics related to the Digital Binder instance:
DigitalBinderConfigurationKit:StatusManager.checkAndUpdateStatus()DigitalBinderConfigurationKit:StatusManager.statusChangedCallback()
Let’s see how we can achieve the example customization shown in the Inbox image above:
1.The default name of the Process in the upper is Workflow ID. The example could be further improved by using a Catalog and Labels.
2.The Phase name needs to show the activity type if this is a Task assigned from the Digital Binder. The following code snippet can be used for this purpose:
If $w.getWorkflowId() == 'DigitalBinder:TaskProcess' Then
String $activityLabelAttr := TOSTRING(ProcessTokenGetAttribute($w.getId(), 'DigitalBinderTaskActivityLabel'));
If NotEmpty($activityLabelAttr) Then
Return $activityLabelAttr;
End
Return 'Task';
End
3.The Task title has to be:
- For the owner: the name of the case, which is usually stored in a Process Instance attribute 'CustomerName'
- For an assignee: some information on the activity type. The following code snippet can be used for an Assignee Task:
If $processId == 'DigitalBinder:TaskProcess' Then
String $originator := TOSTRING(ProcessTokenGetAttribute($w.getId(), 'DigitalBinderTaskOriginator'));
If NotEmpty($originator) Then
$originator := USER($originator).getFullName();
End
String $taskType := TOSTRING(ProcessTokenGetAttribute($w.getId(), 'DigitalBinderTaskActivityLabel'));
Return STRINGFORMAT('DigitalBinder - %s - assigned by %s', $taskType, $originator);
End
4.The Metadata line for the owner is showing the overall status of the attachments and tasks of the Digital Binder instance. For the Assignee Task, the status of the attachments is also displayed, but only the detailed status of the Task at hand is shown:
If $processId.startsWith('DigitalBinder') Then
Indexed String $info := []:String;
String $taskInfo;
String $attachmentStatsAttr := TOSTRING(ProcessInstanceGetAttribute($w.getWorkflowInstanceId(), 'attachmentStats'));
If NotEmpty($attachmentStatsAttr) Then
DigitalBinderConfigurationKit:AttachmentStats $attStats := TranslateFrom($attachmentStatsAttr, 'DigitalBinderConfigurationKit:AttachmentStats', 'json');
If $attStats != null Then
$info.addElement(STRINGFORMAT('%d attachments (%d ready, %d approved, %d returned)', $attStats.totalNumber, $attStats.attachmentsPerStatus['ready'], $attStats.attachmentsPerStatus['approved'], $attStats.attachmentsPerStatus['returned']));
End
End
If $processId == 'DigitalBinder:TaskProcess' Then
// Task assignee view: task status and due date
String $taskStatus := TOSTRING(ProcessTokenGetAttribute($w.getId(), 'DigitalBinderTaskStatus'));
If NotEmpty($taskStatus) Then
$taskStatus := STRINGFORMAT('Task %s', $taskStatus);
End
String $taskDueDate := TOSTRING(ProcessTokenGetAttribute($w.getId(), 'DigitalBinderTaskDueDate'));
If NotEmpty($taskDueDate) Then
$taskDueDate := STRINGFORMAT(', due on %s', $taskDueDate);
End
$info.addElement($taskStatus & $taskDueDate);
Else
// Owner overview on all tasks
String $activityStatsAttr := TOSTRING(ProcessInstanceGetAttribute($w.getWorkflowInstanceId(), 'activityStats'));
If NotEmpty($activityStatsAttr) Then
DigitalBinderConfigurationKit:ActivityStats $activityStats := TranslateFrom($activityStatsAttr, 'DigitalBinderConfigurationKit:ActivityStats', 'json');
If $activityStats != null Then
$info.addElement(STRINGFORMAT('%d tasks (%d ongoing, %d completed)', $activityStats.totalNumber, $activityStats.perStatus['inprogress'], $activityStats.perStatus['done']));
End
End
End
Return JOINLIST($info, ' / ');
End
Task actions are customized by replacing the Inbox:TaskEntityActions Screen Include.
Default actions are:
- Watch
- Add to Outlook
- Reassign task
- Delete
Among these, the Reassign task and Delete require special care:
- The Reassign task button has to use the mechanism explained in the Digital Binder Tasks in the Inbox section. The easiest implementation is adding a URL action to the button with following properties:
- Enabled:
DigitalBinder:IsDigitalBinderTask($workitem) - URL:
'/internal/process/' & DigitalBinder:GetReassignmentWorkitemFromTask($workitem)
- The Delete button has to be disabled or masked for all Tasks generated by a Digital Binder, otherwise the full Digital Binder case could be deleted by an assignee. Implement this logic by inserting the Delete button within an If Screen Component, or add a Stop Action using the condition
not (DigitalBinder:IsDigitalBinderTask($workitem) or InboxConfiguration:TaskEntityDataProvider.getReadOnly($workitem))