Versions Compared

Key

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

Type Converters allow you to convert one data type to another within a workflow. An example of using a type converter would be converting the login name of a Person (string) to PersonID (integer). This article demonstrates using a type converter in this way.

Adding a type converter to a workflow

  1. Open the workflow to which you want to add a type converter

  2. Right-click on the Workflow Designer and select Workflow Binding Type Converters.

  3. Name the Type Converter appropriately and click Add.

    Image Added

  4. Click Close to close the Type Converters window.

  5. Locate the class for the Type Converter in the Code Tree and double-click on the ConvertTo() method to open the C# Editor for it.

    Image Added

  6. In the C# Editor, replace the default code for the method with code that retrieves a value of type string and returns a value of type int. In this example, we specifically, enter code to do the following:  

    1. Retrieve the Person object by the login name passed to the type converter

    2. Return the PersonID from the retrieved Person object.

    Code Block
    Person p = Person.GetByLogin(value.String());
    return p.PersonID;

Now that the policy is created, the next step is to define the conditions needed for users to be added to the policy target. You do this by adding rules to it.

...