...
This process is useful for cases where the standard “Share” action that can be used to share objects with other users is not sufficient. This “Share” action does not only share objects with selected users, it also notifies them about the shared document and requires a confirmation for the process to be completed. The process can be also used as a template for further customization of sharing use cases, if they are to be used in projects.
Process Start
This process is configured to be only startable with an object. Configure the startable object types in the Main Activity configuration.
To initiate this process, you must have Edit rights for the object type you want to share. Select the “Share” “Share object and notify V4” action, add the users or user groups you want to share this document with and write a comment:
Version 1 and 24 Image RemovedImage Added | Version 3 Image Removed |
---|
To start the process, click OK. The custom sharing logic is contained within the BeforeStartEvent which gives the users or user groups specified Read rights for the shared document.
With version 3, the The start form assures that the process can only be started if the given object type is shareable. If not, the OK button is inactive and an error message below the check box Object type is shareable will be displayed.
...
Each recipient must accept the task, read the document and confirm the task when finished. As soon as each user has confirmed, the process ends or the initiator will be notified about that based on the value of the variable notifyInitiator.
Language
This process model is available in English and German.
Administering the Sharing Process
Download the zip file below. Extract the Sharing directory into the location of your projects, which usually is ..\user\documents.model at the bottom of this page.
Open the project in the designer and copy the Sharing process model into your project. Then validate the process and if nothing is reported, deploy it.
...
Version 1 and 2
...
.
...
Version 1,2 and 3
...
The model looks like this:
| 1 | Image Removed
Version 2 Image Removed | Version 3 Image Removed |
---|
Version 1: The process model consists of one parallel container with an activity notice. This activity notice has to be confirmed by the recipients you specify at the beginning of the process.
Version 2: The initiator gets a notice as well when each addressed person has confirmed their task. And a deadline of two days in the future is set for the sharing confirmation task.
Version 3: The start form usually prevents the start, if the object type is not shareable. Otherwise the main activity BeforeStartEvent script reacts on the condition and leads to a notification which the initiator gets into his inbox afterwards.
Main Activity Settings
Image Removed
Image Added |
---|
Main Activity Settings
Image Added
The process is configured to be only startable with an object. Configure the startable object types in the Main Activity configuration.
This process is available for each user and process. Change the Initiators and the Main object type to restrict its behavior.
The process subject is set by the title and type of the object the process is started for, as shown below in the BeforeStartEvent of the main activity.:
Version 4 Code Block |
---|
language | js |
---|
title | BeforeStartEvent Script |
---|
linenumbers | true |
---|
|
|
---|
...
...
processFile = $.file.get() |
|
---|
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
the array processFile
var dmsObject = processFile[0]; // |
|
---|
...
...
...
...
...
...
...
...
...
subject
$.variable('objecttitle').value = dmsObject.title;
$. |
|
---|
...
variable('objecttypename').value = dmsObject.type;
// share the object with the organisational units set in usersgroups
// take into account that this code will echange the current sharing values of the object type
var putBody = {
|
|
---|
...
query: {
expression: [dmsObject.id],
type: dmsObject.type
|
|
---|
...
...
...
...
...
,
children: false,
mode: "ADD"
}
};
var usersgroups = $.variable(' |
|
---|
...
...
;
for(var i = 0; i < usersgroups.length; i++){
var usergroupname = $.http
. |
|
---|
...
...
...
...
...
...
' + usersgroups[i].value)
.execute()
.data.name;
putBody.share.with.push(usergroupname);
}
var response = $.http
.put()
.path('/service/dms/batch')
.body(putBody)
.execute();
if(!response.reason) {
$.variable('canbeshared').value = true;
} else { |
|
---|
...
...
$.variable('canbeshared').value = false;
}
$.done(); |
|
---|
Sending Tasks to all Recipients
To send a task to each member of the configured group, the container for parallel execution has to be configured like this:
Image RemovedImage Added
The script to control the Participant type is the BeforeStartEvent of the multi-instance container:
Code Block |
---|
language | js |
---|
title | BeforeStartEvent of sharemulti |
---|
|
// Set all participants
var usersgroups = $.variable('usersgroups').value;
for(var i = 0; i < usersgroups.length; i++){
var usergroup = usersgroups[i].value;
var recipient = new $.OrgObject();
recipient.id = $.variable('usergroup').value;
$.activity('this').performers.push(recipient);
}
$.done(); |
Configuring 'notice'
...
The object types of objects to be shared must be configured first:
Image RemovedImage Added
Check Allow sharing. Please note that this feature will slightly impact the performance of the system.
...
Process Model Version History
Version | Date | Compatible core-service version | Author | Description | Download |
---|
4 | September 06, 2023 | 8.0 or newer | A-Team | - Process can only be started with an dms object
- You can activate or deactivate the notifcation about all confirmations on the start form via an input parameter
- Refactoring of script code
| View file |
---|
name | Sharing.SharingV4.bpmdef |
---|
height | 150 |
---|
|
|
3 | March 22, 2019 |
| Martin Bartonitz | 6. - Start form prevents process start in case of none-shareable object types. The object type and the attribute shareable is shown in the start form as well.
7. - Main activity BeforeEventScripts handles none-shareable object types as well. If the start form does not prevent the process start, the initiators get a notification in their inbox.
|
|
2 | March 21, 2019 |
| Martin Bartonitz | 4. - Notice for initiator about all confirmations
5. - Deadline for the sharing notification including e-mail notification for reached deadline
|
|
1 | March 19, 2019 |
| Martin Bartonitz | Start with basics: - Fill out group and comment during process start
- Set display rights in BeforeStartEvent of the main activity
- Inform each member of the group
|
|
...