none
NullReferenceException in ResolveGrammarActivity

    Question

  • Has anyone tried to use the workflow dictionary in a grammar resolver? I know this used to work in ILM 2 RC0, but in FIM 2010 RC1, I'm getting a NullReferenceException. Here's the deal; I can write a parameter to the workflow dictionary, but when I try to use that in a ResolveGrammarActivity, I get the exception. Here's an example of adding myself to the workflow dictionary (WorkflowData):
     
     

    So far, so good. Now I try passing [//WorkflowData/JoeZamora] into the grammar resolver. Here's my debug log:
    2010-01-25 17:18:10,477 --6-- DEBUG [Ensynch.FIM.Workflow.Activities.ChangeAttributeActivity]
    
    Source Class : System.Workflow.ComponentModel.Activity
    Source Instance : 7. Remove Joe from Group Members
    Source Method : RaiseEvent
    Current user : INFO\svc.fimws
    
    Passing these data into the ResolveGrammarActivity:
    NewGrammarExpression : [//WorkflowData/JoeZamora]
    NewResolvedExpression :
    NewWorkflowDictionaryKey :
    
    2010-01-25 17:18:10,535 --6-- ERROR [Ensynch.FIM.Workflow.Activities.ChangeAttributeActivity]
    
    Source Class : System.Workflow.ComponentModel.ActivityExecutor`1[T]
    Source Instance : 7. Remove Joe from Group Members
    Source Method : HandleFault
    Current user : INFO\svc.fimws
    
    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(Match m)
    at Microsoft.ResourceManagement.WFActivities.Resolver.ResolveEvaluatorForBodyWithAntiXSS(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.ResolveBody(String input)
    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()
    

    Hmmm, not a very helpful message. I'm pretty sure this is a bug, because ordinarily you try to handle NullReferenceExceptions in code that's exposed to the public.
    Tuesday, January 26, 2010 2:43 AM

Answers

  • Hi Joe,
    I am having some (possibly related) problems as well with WorkflowData, as described in this post: New manager approval .
    Cheers,
    Paolo


    Paolo Tedesco - http://cern.ch/idm
    • Marked as answer by Joe Zamora Friday, October 29, 2010 4:38 PM
    Tuesday, January 26, 2010 3:02 PM

All replies