Planon Extension - Automatic User Account creation

Introduction

This document outlines the specification for the Create and Manage Accounts app. This app contains multiple business rules that add extra functionality between Accounts, Persons, and External Accounts.

The main features of this app are:

  • Create an Account when a Person is created or activated

  • Update Accounts based on changes to the corresponding Person

  • Link and unlink a Person to/from an Account when needed

  • Create and manage External Accounts

This document also describes the installation and configuration of the business rules. It covers the technical installation of the software component(s) and the configuration in Planon.

Prerequisites

Environment

This app is designed to work with Planon L104 and above.

Constraints

N/A

Required (free)fields

N/A

Assumptions

N/A

Features and properties

The purpose of this app is to create and update the Account BO based on the Person BO.

Feature 1: Create Account

When a Person is created, an Account is automatically added and linked to this Person. The Account is linked to the configured Account Groups. Additionally, this rule can also be registered on an update event to restore the Account when a Person is set from an inactive to an active state. A move order can also be generated when a Person is created. This can be controlled by the configuration.

Feature 2: Manage Person and Account data

When the start date or end date of the Person is updated, the Account will also be updated with the corresponding dates.

When the email address of a Person is changed, the email address can also be updated in the User Settings of the corresponding User. The User can decide which email address should be changed based on the app settings.

When the first name or last name of a Person is changed, the Account description is updated based on the setting that determines whether the first name or the last name comes first.

When the status of a Person is changed to an end status (configurable in the app settings), the end date of the Account is set to the day before. For example, if the Person is deactivated today, the Account’s end date is set to yesterday, which means the Account can no longer be accessed from today. If the start date is the same as yesterday, the start date is changed to one day earlier. In addition, the User can choose to end occupancies related to the Person and unlink the related assets.

If the end date of the Account is in the past, the app can unlink the Person and Account Groups from the Account. The User can decide whether to unlink them.

Feature 4: Create and manage External Account

This feature creates and manages External Accounts for Users.

When the email field (configurable) in the User Settings BO is changed, any existing External Accounts referring to the old email address for the configured connections are marked as non-primary. A new primary External Account is then created based on the new email address for the configured connections. This is performed only if the Account belongs to the configured Account User Groups.

How does it work?

This chapter contains a more in-depth description of the app.

Create Account

The app comes with a Business Rule that triggers on create or update of a Person Business Object. The Business Rule needs to be configured on the Person BO. The details of the configuration can be found in chapter 5.3.1

The Business Rule does the following:

  1. Creates Account BO and links the Account to the Person

  2. Update Account Settings

  3. Links Account to the configured User Groups

  4. Create External Account for the configured connections

All the required configuration details can be found under the chapter 5.2.1

Manage Person and Account Data

This needs a Business Rule that must be configured on the update of a Person Business Object. The details of the Business Rule configuration can be found in chapter 5.3.2

This Business Rule checks if the fields FirstName, LastName, Start date, End date, and Email of the Person are changed. If any of the fields are changed, the new values are updated on the Account BO or Account Settings BO

When a Person is deactivated (i.e., the status of the Person is changed to an end status (configurable)), the Business Rule does the following steps

Set end date on the corresponding accounts.

The end date of the Account is updated to the day before. That is, if the Person is deactivated today, the Account is updated with yesterday’s date. If the start date is yesterday’s date, then it is moved one day earlier.

End occupancies

A Person can have occupancies indicating the occupancy details of the spaces and workspaces. If the Person that is deactivated has any occupancies, these occupancies are ended with the current day. The User can decide whether to end occupancies, based on a setting.

The app also supports unlinking the assets from the Person that is deactivated. It clears the Person reference on the related assets.

In order to unlink the Person and Account Groups from the Person, one can use the Business Rule that needs to be configured on the Account Business Object.

The Business Rule triggers on the update of the Account BO. It checks whether the end date of the Account BO is in the past compared to the current day.

If the end date is in the past, then it removes the links between:

  • Account and Person

  • Account and Account Groups

Create and Manage External Accounts

In order to create an External Account for an Account, one can use the Business Rule coming with the app.

The Business Rule checks if the email field on the Account Settings has a value and the Account belongs to one of the configured Account Groups.

If both conditions are met, the rule creates new External Accounts with the new email for each external connection configured and marks them as primary.

All the old External Accounts of the corresponding Account under the configured connections are marked as non-primary.

Installation

This chapter describes the steps required to install this app on your Planon environment.

Installation Process

There are two ways to install the app:

  1. Using the Marketplace
  2. Manual installation

Install the app by using the marketplace

In case your environment is configured to use the Planon app store the only thing required to install the app is to add the app license in the AppCenter TSI. Planon will automatically download and install the app.

AppCenter Marketplace Installation

Manual installation

In case you want to perform a manual installation follow the steps below.

  1. Open AppCenter TSI from Planon webclient and click on install from action menu

AppCenter Installation

  1. Browse to the .ppk file

Browse ppk file

  1. Click OK to install the app and follow the installation process
  2. When the app is successfully installed, the app will appear in the AppCenter

Installed App

  1. Add the app license in Apps TSI

Add App License

Activation

Once the app has been configured, you can activate the app by pressing the Active status transition from the action panel. Always make sure that the required User groups are linked correctly and the Configure action is executed before activating the App.

AppCenter App Activation

App settings

Configure the App settings (called ‘Module settings’) by following the steps below.

  1. In the TSI ‘AppCenter’, select the app and drill down to the selection step Details.

  2. Select ‘Module settings’ in the submenu and select the App settings.

  3. On the right, you can view and edit the App settings.

Create Account

SettingExplanation
createMoveOrderCreate move Order
When set to yes, a move order and move line will be created when a new Person is added.
fillBccEmailAddressFill BCC email address
Fill the BCC email address in User Settings (true/false).
fillReplyEmailAddressFill Reply email address
Fill the Reply email address in User Settings (true/false).
get24NotationField24 Hour Notation Field (if configured)
The free field on the Personnel business object from which to get the users “Use 24hour notation” (Use24HoursDateFormat field from type CodesCodeName).
get24NotationFieldDefault24 Hour Notation Default
Default value for 24NotationField on the Account.
getAccountNameFieldAccount name Field
Field on the Personnel Business Object from which to create the User’s “User name” (AccountName) field.
getAccountSettingPrefixAccount name Prefix
Prefix to add in the Account name before creating the Account.
getDefaultMeasurementUnitMeasurementUnit Default
Default value for MeasurementUnitField on the Account.
getErrorMessageError Message
This message is shown when a User with an Account Name retrieved from a Person already exists when inserting a new Person or updating a Person to an active state.
getExtAccountAppConnectionNameC4C app connection name
The name of the C4C App Connection reference on the External Account BO. If empty, the External Account will not be created. Multiple connections can be configured, each separated by a semicolon.
getLanguageDefaultLanguage Default
The default Language for the new Account.
getLanguageFieldLanguage Field
The Language Code field on Person.
getMeasurementUnitFieldMeasurementUnit Field (if configured)
The free field on the Personnel business object from which to get the users measurement unit.
getPersonTimezoneFieldPerson TimeZone Field (if configured)
The free field on the Personnel business object which to get a user’s timezone settings from (type String).
getTimezoneFieldDefaultTimeZone Code Default
Default value for TimeZone on Account.
getUserGroupsUser groups
Default User Groups are added to the UDBO field. Multiple UDBOs are separated by a semicolon.
personActiveStatePerson active state
System name of the Person active state
standardMoveOrderCodeStandard move order Code
The standard move order to create in case the setting ‘createMoveOrder’ is set to yes.
userGroupDependantFieldSystem name of the field on Person BO based on which the User Groups are linked. When this is empty, dynamic User Group linking is skipped.
dynamicUserGroupsUse this to configure User Groups to link to the User based on the value of the field configured in the setting ‘userGroupDependantField’. Example value: “Value1=UserGroupA,UserGroupB”,“Value2=UserGroupA,UserGroupC”,“Value3=UserGroupD”. To configure this, click View Code in the top-right corner of the settings.

Manage Person And Account

SettingExplanation
endPersonStatusWhen a Person’s status changes to this status, update the End Date on the Account and trigger additional logic.
unlinkAssetsSet to Yes to clear the Person reference field on Person assets.
endOccupanciesSet to Yes to set an end date on Person occupancies.
updateReplyEmailAddressWhen this is set to yes, the reply email address on the Account Settings is updated when updating the email address of the Person related to the Account.
updateSenderEmailAddressWhen this is set to yes, the sender email address on the Account Settings is updated when updating the email address of the Person related to the Account.
updateBBCEmailAddressWhen this is set to yes, the BCC email address on the Account Settings is updated when updating the email address of the Person related to the Account.
updateContactEmailAddressWhen this is set to yes, the contact email address on the Account Settings is updated when updating the email address of the Person related to the Account.
useFirstNameIntheBeginningIf set to yes, the first name is used at the beginning of the Account description.
accountNameFieldAccount name Field
Field on the Personnel Business Object from which to update User’s “User name” (AccountName) field on the linked User.
SettingExplanation
unlinkAccountGroupsUnlink AccountGroups (yes or no)
Whether or not to unlink the AccountGroups from the Account when the Account is disabled.
unlinkPersonUnlink Person (yes or no)
Whether or not to unlink the Person from the Account when the Account is disabled.

Create and manage external account

SettingExplanation
extAccountAppConnectionNameC4C App Connection Name. The name of the C4C App Connection reference on the External Account BO. If empty, the External Account will not be created.
userSettingEmailFieldEmail field in the User Settings BO, where this Business Rule should retrieve the email address from.
(Default value: ExchangeEmailAddress)
userGroupsSystem name of user groups to which users are linked who need the external accounts

Planon Configuration

  • Log in to Planon ProCenter using the supervisor account (or any account with sufficient rights to ‘UI Configuration’).

  • Go to TSI Field definer.

Configuration for Create Account

  1. Select the Business Object with system Person.

  2. Set the status of the Business Object to Under Construction.

  3. Select the UDBO for which the Account needs to be created.

  4. Go to the selection level ‘Details’ and select the selection step ‘Extensions’.

  5. Click ‘Add’ in the Action Menu and create the action with the following details.

PropertyValue
Class nameplanonsoftware.apps.CreateAccount
Event typeAI, AfterDBInsert and/or AU, AfterDBUpdate
SequenceDesired execute sequence number for example: 10
  1. Go back to the selection level ‘Business objects’.

  2. Set the status of the Business Object to ‘Completed’ via the Action Menu.

Configuration for Manage Person And Account Data

  1. Select the Business Object with system Person.

  2. Set the status of the Business Object to Under Construction.

  3. Select the UDBO for which the Account and Person need to be managed.

  4. Go to the selection level ‘Details’ and select the selection step ‘Extensions’.

  5. Click ‘Add’ in the Action Menu and create the action with the following details.

PropertyValue
Class nameplanonsoftware.apps.ManagePersonAndAccountData
Event typeAU, AfterDBUpdate
SequenceDesired execute sequence number for example: 12
  1. Go back to the selection level ‘Business objects’.

  2. Set the status of the Business Object to ‘Completed’ via the Action Menu.

Configuration for UnlinkPerson and Account Groups

  1. Select the Business Object with system Account.

  2. Set the status of the Business Object to Under Construction.

  3. Go to the selection level ‘Details’ and select the selection step ‘Extensions’.

  4. Click ‘Add’ in the Action Menu and create the action with the following details.

PropertyValue
Class nameplanonsoftware.apps.UnlinkPersonAndAccountGroup
Event typeBU, BeforeDBUpdate
SequenceDesired execute sequence number for example: 10
  1. Go back to the selection level ‘Business objects’.

  2. Set the status of the Business Object to ‘Completed’ via the Action Menu.

Configuration for Create And Manage External Account

  1. Select the Business Object with system UserSettings.

  2. Set the status of the Business Object to Under Construction.

  3. Go to the selection level ‘Details’ and select the selection step ‘Extensions’.

  4. Click ‘Add’ in the Action Menu and create the action with the following details.

PropertyValue
Class nameplanonsoftware.apps.CreateAndManageExternalAccount
Event typeAU, AfterDBUpdate
SequenceDesired execute sequence number for example: 10
  1. Go back to the selection level ‘Business objects’ and set the status to ‘Completed’.

Troubleshooting

Error handling

  • Errors are recorded in the server logs:
    • Tomcat log for web components
      • Webpages
      • PSS modules
      • Stepview
      • TSI Action
      • JAX-RS webservices
    • Wildfly log for server-side components
      • Business rules
      • Scheduled tasks
      • Workers
      • Event Connector
  • UI components (TSI Actions) also display errors in the interface