Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 25 Next »

Description

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 object and notify V4” action, add the users or user groups you want to share this document with and write a comment:

To start the process, click OK. The custom sharing logic is contained within the BeforeStartEvent of the main activity which gives the users or user groups specified Read rights for the shared document.

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.

Inbox

Each member of the group receives the task 'Confirm sharing' in his inbox. 

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, which can be set on the start form.

Language

This process model is available in English and German.

Administering the Sharing Process

Download the example 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 model: You should see one warning. That is because the process model is configured to be only startable with an object but not object type is allowed for starting the process. Configure the startable object types in the Main Activity configuration to get rid of that. 

After that you can deploy the model on your system.


The model looks like this:


Main Activity Settings

 

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

BeforeStartEvent Script
var processFile = $.file.get();            // get all process file objects into the array processFile
var dmsObject = processFile[0];            // take the first element 

// set process 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
	},
 	share: {
		with: [],
		children: false,
		mode: "ADD"
	}
};

var usersgroups = $.variable('usersgroups').value;
for(var i = 0; i < usersgroups.length; i++){
	var usergroupname = $.http
	.get()
	.path('/service/organization/id/' + 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:


The script to set the Participants is the BeforeStartEvent of the multi-instance container:

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 = usergroup;
	$.activity('this').performers.push(recipient);
}

$.done();

Configuring 'notice'

The Participant type attribute must be set to 'Multi-instance controlled', in accordance with the settings of the parallel container (see above).

Each user will also receive an e-mail notification, if an e-mail address is provided in his user profile and the e-mail server is configured.

The standard Forward button is renamed to Confirm, as can be seen in the Actions attribute.

Prerequisites

The object types of objects to be shared must be configured first:

Check Allow sharing. Please note that this feature will slightly impact the performance of the system.

It is not necessary for users to have the Display right for the object type concerned, but they must have the Available right.

After sharing the object with a user, the Display right for this object is assigned to him.

Process Model Version History

VersionDate

Compatible

core-service

version

AuthorDescriptionDownload
4September 06, 20238.0 or newerA-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

3March 22, 2019
Martin Bartonitz
  • 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.
  • 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.

2March 21, 2019
Martin Bartonitz
  • Notice for initiator about all confirmations
  • Deadline for the sharing notification including e-mail notification for reached deadline

1March 19, 2019
Martin Bartonitz

Start with basics:

  1. Fill out group and comment during process start
  2. Set display rights in BeforeStartEvent of the main activity
  3. Inform each member of the group










  • No labels