K2 BLACKPEARL PRODUCT DOCUMENTATION: USER GUIDE
Adding Custom Properties

How to add custom properties to the Active Directory Event Wizard

In order to deal with custom situations where 'non-default' Active Directory (AD) properties will be used, a developer can add custom properties to the Active Directory Event Wizard and use them within the process.

For example, Denallix is starting to roll out OCS in their organization. Stephan wants to put together a simple process that allows a request to be submitted for OCS access, approved by their manager, and then automatically grant the user access to OCS. Stephan knows that it is just a series of properties in Active Directory that enable this integration, so he builds a simple K2 process and uses the “Update User” action of the Active Directory Event Wizard to set these properties. At first, Stephan does not see the AD properties he is looking for in the wizard. After reading the documentation, Stephan looks at the AD Service Object Instance to see which additional properties have been configured. This is where he notices that his properties are not listed, which is why they are not showing up in the wizard. Stephan adds the following properties:

These are the AD properties that Stephan’s organization sets when enabling a user to use OCS. (NOTE: This is not all of the properties, but just some that apply to OCS. Any AD property should be able to be added in this fashion, not just the ones listed above) He adds the properties as indicated in the section below, and saves his changes.

Now, when Stephan goes into the Update User action, he sees these new properties listed. He then sets the properties to the organization’s defaults, and deploys the process.

Creating the Additional Properties

The rest of this topic explains how to create a custom property to use in the Active Directory Event Wizard

 1) Create an XML snippet that describes the properties to be added. For example:

Copy Code 

              <customProperties>

 <customProperty serviceObjectName="ADUser">

    <schemaAttributeName>l</schemaAttributeName>

    <displayName>Location</displayName>

    <description>The Location of the user</description>

    <soType>text</soType>

 </customProperty>

 <customProperty serviceObjectName="ADUser">

    <schemaAttributeName>renewalDate</schemaAttributeName>

    <displayName>Renewal Date</displayName>

    <description>Date of renewal</description>

    <soType>datetime</soType>

 </customProperty>

</customProperties>

Node How to use it
serviceObjectName The system name of the ServiceObject to add the custom properties to
schemaAttributeName The actual attribute name that you added to the Active Directory Schema
displayName The display name of the ServiceObejct Property
description The description of the ServiceObject Property
soType The SmartObject property type. Valid types are:
autoguid,
autonumber,
datetime,
decimal,
file,
guid,
hyperlink,
image,
memo,
multivalue,
number,
text,
xml,
yesno

2) Update the Service Instance:

  1. Open the SmartObject Service Tester (c:\Program Files\K2 blackpearl\Bin\SmartObject Service Tester.exe)
  2. Expand the ServiceObject(s) Explorer -> AccountManagement
  3. Right-Click on the Account Management Service and select Edit Service Instance
  4. Paste the custom properties XML into the CustomProperties field and click Next and Update

3) Update the SmartObject:

  1. Expand the SmartObject(s) Explorer -> All SmartObjects
  2. Right-click on AD User and select ToSodx
  3. Specify a filename and location for it to be saved
  4. Open K2 Designer for Visual Studio or K2 Studio
  5. Create a new K2 Project
  6. Add the existing .sodx to the K2 Project
  7. Edit the Create method, select the advanced mode and click Next until you reach the ServiceObject Methods page.
  8. Select the Service Object Method and click Edit
  9. Find the added property and click on Assign
  10. Select the relevant SmartObject property, or create a new one by clicking on Create
  11. Click on Ok, finish the wizard
  12. Then deploy the SmartObject

 

 


K2 blackpearl Help 4.6.10 (4.12060.1690.0)