Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Code-based Sets are queries that can result in collections of people or collections of other resource types protected by EmpowerID. Each code-based Set requires a Set Runtime, which is a custom implementation of the EmpowerID API that allows C# code to be used to return a collection of EmpowerID object types. You create code-based Sets in Workflow Studio.

Insert excerpt
IL:New Resource Snippets
IL:New Resource Snippets
nameAllAccess
nopaneltrue

This article demonstrates how to create a code-based set by creating one that returns all people with the title of “Helpdesk Technician.”

Create a code-based Set

  1. Log into Workflow Studio.

...

  1. Select the Workspace node from Solution Explorer (located to the left of the Workflow Studio IDE)

...

  1. .

  2. In the Workspace tree, right-click the folder of your choice and select New Extension or Library > Class Library (.NET Framework).

    Image Modified

  3. Select the Properties tab located to the right of the C# Editor and click the Supports button (…).

    Image Modified

  4. Select SetRuntime and then click OK.

    Image Modified

...

  1. Click the Save button in the toolbar just above the C# Editor

...

  1. .

  2. Name the class something that represents its purpose and click Save.

    Image Modified

  3. In the C# Editor, do the following:

    1. Set the base class for the class to ISetRuntime.

    2. Stub a method for the GetResults() method of the TheDotNetFactory.Framework.People.Components.SetCompilation class and add code to the method that does the following:

      • Creates a new instance of the TheDotNetFactory.Framework.People.Components.Person class, using the Find() method to find EmpowerID Person objects with

...

      • the title of "Helpdesk Technician."

      • Creates a new instance of the TheDotNetFactory.Framework.People.Components.SetCompilation class.

      • Loops through the new instance of the Person class,

...

      • adding each person returned by the Find() method to the new instance of the SetCompilation class, and

...

      • writing the PersonGUID DisplayName of the SetCompilation class to the FriendlyName property for each person.

      • Returns the results of the collection.

        Here is what the code for the class looks like:

        Code Block
        public class HelpDeskTechniciansSetRuntime :ISetRuntime
        {
        	public E.TList<SetCompilation> GetResults()
        	{
        		int totalCount = -1;
        		E.TList<Person> people = Person.Find
        			 ("Title = Helpdesk Technician", 0, int.MaxValue, out totalCount);
        		E.TList<SetCompilation> results = new E.TList<SetCompilation>();
        		foreach (Person p in people)
        		{
        			results.Add(new SetCompilation() 
        			{SystemIdentifier = p.PersonGUID.ToString(),DisplayName = p.FriendlyName});
        		}
        		return results;			 
        	}
        }

  1. Save your changes and close the CS file.

Publish the code-based Set

...

  1. Double-click the class library file on the source control tree to open it in Visual Studio.

    If this is the first time opening a class library file

...

  1. this way, you will be prompted to select the default app with which to open the file. Select Visual Studio.

    Image Modified

  2. In Visual Studio, build the Set Runtime solution.

    After Visual Studio builds the solution, you should see a .pub file for the project in your local file system in the WFS > _PublishedItems folder

...

  1. . You publish this file to your system to make the Set Runtime available to EmpowerID as a manageable object that can be used in delegation.

    Image Modified


  2. Log in to the EmpowerID web application as a user with the appropriate access to run the PublishWorkflowStudioItem workflow and navigate to the URL for the workflow. The URL should be https://YourEmpowerIDWebServer.com/UI/#w/PublishWorkflowStudioItem.

    Image Modified

     

  3. Click Choose File, navigate to the _PublishedItems folder, and select the pub file for theSet Runtime. 

  4. Click Submit.

    Image Modified

Next, create a SetGroup for the Set.

Create a SetGroup for the Set

  1. On the navbar, expand Role Management and select Query-Based Collections (SetGroup).

  2. Select the Actions tab and then select Create a Query-Based Collection (SetGroup).

    Image Modified

  3. Enter the following information in the Create Query-Based Collection form:

    • Name – Name of the collection

    • Display Name –  Display name of the collection

    • Description – Description of the collection

    • Is a collection of person objects – Select if the collection contains persons

    • Location –  Creation location

      Image Modified

  4. When ready, click Submit and then click OK to close the Operation Execution Summary.

    Image Modified

  5. Search for and select the Set Runtime you just published.

Insert excerpt
IL:External Stylesheet
IL:External Stylesheet
nopaneltrue