none
Use Granfeldts Create Object to create dynamic groups RRS feed

  • Question

  • Trying to use Sorens Granfeldts, Create Object WF activity to create dynamic groups.

    In a standard function evaluator activity I generate the Filter as [//WorkflowData/Filter]
    The "string" I set it to is:
    <Filter xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" Dialect="http://schemas.microsoft.com/2006/11/XPathFilterDialect" xmlns="http://schemas.xmlsoap.org/ws/2004/09/enumeration">/Person[ObjectID = /*[ObjectID = '8dfcb5e8-ff01-400c-8ca7-2a0002d2d2d4']/ComputedMember]</Filter>

    In the CreateObject activity I then just have [//WorkflowData/Filter],Filter among the initial values.

    The creation works if I remove this attribute so the rest of the attributes seems to be working.

    The creation fails however end I get the error below in the Forefront Identity Manager event log.

    System.NullReferenceException: Object reference not set to an instance of an object.
       at Microsoft.ResourceManagement.WFActivities.Resolver.GetDisplayStringFromGuid(Guid id, String[] expansionAttributes)
       at Microsoft.ResourceManagement.WFActivities.Resolver.ReplaceGuidWithTemplatedString(Match m)
       at System.Text.RegularExpressions.RegexReplacement.Replace(MatchEvaluator evaluator, Regex regex, String input, Int32 count, Int32 startat)
       at System.Text.RegularExpressions.Regex.Replace(String input, MatchEvaluator evaluator)
       at Microsoft.ResourceManagement.WFActivities.Resolver.GetStringAttributeValue(Object attribute)
       at Microsoft.ResourceManagement.WFActivities.Resolver.ResolveEvaluatorWithoutAntiXSS(String match, ResolverOptions resolveOptions)
       at Microsoft.ResourceManagement.WFActivities.Resolver.ResolveEvaluatorForWithAntiXSS(String match, ResolverOptions resolveOptions)
       at Microsoft.ResourceManagement.WFActivities.Resolver.ReplaceMatches(String input, Boolean useAntiXssEncoding, ResolverOptions resolveOptions)
       at Microsoft.ResourceManagement.Workflow.Hosting.ResolverEvaluationServiceImpl.ResolveLookupGrammar(Guid requestId, Guid targetId, Guid actorId, Dictionary`2 workflowDictionary, Boolean encodeForHTML, String expression)
       at Microsoft.ResourceManagement.Workflow.Activities.ResolveGrammarActivity.Execute(ActivityExecutionContext executionContext)
       at System.Workflow.ComponentModel.ActivityExecutor`1.Execute(T activity, ActivityExecutionContext executionContext)
       at System.Workflow.ComponentModel.ActivityExecutor`1.Execute(Activity activity, ActivityExecutionContext executionContext)
       at System.Workflow.ComponentModel.ActivityExecutorOperation.Run(IWorkflowCoreRuntime workflowCoreRuntime)
       at System.Workflow.Runtime.Scheduler.Run()

    Have anyone used this WF activity to create dynamic groups and can tell how to set the Filter?

    Friday, June 27, 2014 12:09 PM

Answers

  • Hey Kent!

    I did the same thing, with Søren`s Create Object WF. I did it like this on the filter part:

    <Filter xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" Dialect="http://schemas.microsoft.com/2006/11/XPathFilterDialect" xmlns="http://schemas.xmlsoap.org/ws/2004/09/enumeration">/Person[(Department = '[//Target/ObjectID]')]</Filter>,Filter
    The whole thing looks like this:
    (I use Function evaluator to generate a AccountName for groups based on a clean version of DisplayName).
    [//Target/DisplayName],DisplayName
    SEC_[//WorkFlowData/CleanAccountName],AccountName
    [//Target/Manager],Owner
    Security,Type
    DOMAIN_STRING,Domain
    Universal,Scope
    [//Target/DisplayName]_SecGroup,Description
    [//Target/Manager],DisplayedOwner
    None,MembershipAddWorkflow
    True,MembershipLocked
    [//Target/CleanAccountName],MailNickname
    <Filter xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" Dialect="http://schemas.microsoft.com/2006/11/XPathFilterDialect" xmlns="http://schemas.xmlsoap.org/ws/2004/09/enumeration">/Person[(Department = '[//Target/ObjectID]')]</Filter>,Filter

    Regards, Remi www.iamblogg.com

    Friday, June 27, 2014 4:48 PM

All replies

  • Hey Kent!

    I did the same thing, with Søren`s Create Object WF. I did it like this on the filter part:

    <Filter xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" Dialect="http://schemas.microsoft.com/2006/11/XPathFilterDialect" xmlns="http://schemas.xmlsoap.org/ws/2004/09/enumeration">/Person[(Department = '[//Target/ObjectID]')]</Filter>,Filter
    The whole thing looks like this:
    (I use Function evaluator to generate a AccountName for groups based on a clean version of DisplayName).
    [//Target/DisplayName],DisplayName
    SEC_[//WorkFlowData/CleanAccountName],AccountName
    [//Target/Manager],Owner
    Security,Type
    DOMAIN_STRING,Domain
    Universal,Scope
    [//Target/DisplayName]_SecGroup,Description
    [//Target/Manager],DisplayedOwner
    None,MembershipAddWorkflow
    True,MembershipLocked
    [//Target/CleanAccountName],MailNickname
    <Filter xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" Dialect="http://schemas.microsoft.com/2006/11/XPathFilterDialect" xmlns="http://schemas.xmlsoap.org/ws/2004/09/enumeration">/Person[(Department = '[//Target/ObjectID]')]</Filter>,Filter

    Regards, Remi www.iamblogg.com

    Friday, June 27, 2014 4:48 PM
  • :-) I didn't think that looong xml string would work so I didn't even try that! Will give it a shoot but if it worked for you it should work for me.

    [Update]

    Worked like a charm! :-) Me Happy!

    I don't understand why I didn't try the "easy" way before doing it  using workflow data.

    Friday, June 27, 2014 4:53 PM
  • Appreciate this is a few years old now but is there any way to get this to work in a MIMWAL Update resources activity?  I've tried the Filter above but can't get it to work as it says a constant string can't contain workflow lookup variables

    Rob

    Wednesday, April 10, 2019 7:15 AM
  • Hi,

    Yes, that should be possible. We do this using MIMWAL in some solution. We use the following MIMWAL activity to create groups:

    https://github.com/Microsoft/MIMWAL/wiki/Create-Resource-Activity

    Br,

    Leo


    Did my post help? Please use "Mark as answer" or "Propose as answer". Thank you!

    Wednesday, April 10, 2019 7:35 AM