Get user properties

<< Click to Display Table of Contents >>

Navigation:  Bizagi Studio > Process wizard > Business Rules > Business rules examples >

Get user properties

Bizagi enables to create sets of information for Users, called User Properties, relevant for each end user individually. These include full name, email address, domain, roles, positions, delegated user, among others.

 

You can create additional properties for your users such as date of birth, social security number, marital status, or any other property required for your business, that is not provided by default by Bizagi.

 

User properties can be simple data type or they can be related with parameter or system entities through single-to-many or multiple-multiple relationships. You can access this information from the expressions to be used as Process information. Usually it is possible to navigate towards a user property using XPath, when this is not possible other methods can be used, such as entity-list. Here are some examples showing how to obtain these properties using XPath and using another method.

 

Obtain a simple attribute user property

Obtain a user property related to an entity through a single-to-multiple relationship type

Obtain a user property related to an entity through a multiple-multiple relationship type

Filter a user property with no XPath

 

Example

In the following example, assume we have these user properties: Identification Number, Office, Skills, among others. Where Identification Number is a simple data type, Office is a single-to-many relationship and Skills is a multiple-multiple relationship default property.

These properties can be seen in the diagram below:

 

UserProperties01

 

Obtain a simple data type user property

Suppose our organization has a Travel Request Process, where the Applicants' Identification Number is needed to book their flights.

 

UserProperties03

 

This is a simple value type of property that can be obtained using XPath, like this:

 

UserProperties02

 

The expression shown above is as follows:

RequesterIdNumber = <TravelRequest.Applicant.IdentificationNumber>;

 

 

Obtain a user property related to an entity through a single-to-multiple relationship type

Suppose that our organization has a Claims and Complaints Process, and we need to obtain the Office that the Person associated to that complain works at.

 

UserProperties04

 

Office is a single-to-multiple relationship property that can be obtained using XPath, like this:

 

UserProperties05.

 

The expression shown above is as follows:

Office = <ClaimandComplaintRequest.Person.idOffice>;

 

 

 

Obtain a user property related to an entity through a multiple-multiple relationship type

Suppose that our organization has a Claims and Complaints Process, and we need to obtain the Skills (default property) of the Person associated to that complain.

 

UserProperties04

 

Skill is a multiple-multiple relation property, in this case we have to navigate the object to obtain each value, like this:

 

UserProperties06

 

The expression shown above is as follows:

var PersonSkills = CHelper.GetValueAsCollection(Me.Context.getXPath("ClaimandComplaintRequest.Person.Skills"));

for(var i=0; i<PersonSkills.Count; i++){

 var skill = Me.newCollectionItem("ClaimandComplaintRequest.PersonSkills");

 skill.setXPath("SkillName", PersonSkills[i].getXPath("skillDisplayName"));

}

 

The Skills will be displayed like this:

 

UserProperties07

 

 

Filter a user property with no XPath

Suppose that we need to obtain the list of Subordinates for a selected Employee (type WFUSER) for our organization's Vacation Leave Request process to notify them when their boss will be out of the office.

 

UserProperties10

 

To do so, it is necessary to obtain the list of users with idBossUser equal to our selected user using the entity-list method. It has to be done this way because we need to filter all registered users to find those with matching idBossUser. If our master entity had a collection of the type WFUSER for Subordinates this filter would be done using XPath.

 

UserProperties08

 

The expression shown above is as follows:

var bossId = <VacationLeaveRequest.Employee.idUser>;
var userList = Me.getXPath("entity-list('WFUSER','idBossUser = " + bossId + "')");
for (var i = 0 ; i < userList.Count ; i ++){
  var subOrdinate = Me.newCollectionItem("VacationLeaveRequest.Subordinate");
  subOrdinate.setXPath("Name",userList[i].getXPath("fullName"));
  subOrdinate.setXPath("Email",userList[i].getXPath("contactEmail"));
}

 

The subordinates will be displayed like this:

 

UserProperties09