locked
WorkflowData KeyNotFoundException error RRS feed

  • Question

  • I have an update resource activity that performs a query and updates the user.

    It worked fine until I wanted to update //WorkflowData at the same time.

    I want to do:

    IIF(IsPresent([//Queries/CRMAccessMapping/XInCRM]), [//Queries/CRMAccessMapping/XInCRM], False)  -> [//Target/XInCRM]

    IIF(IsPresent([//Queries/CRMAccessMapping/XInCRM]), False, True) -> [//WorkflowData/MatchFound]

    This gives me the error:

    Microsoft.ResourceManagement.WorkflowDataExchangeException: System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary.

    If I change the target of the second update to be [//Target/Description] is works ok, so it looks like the update resource activity can't update the target and put something in the workflow data in the same activity? The solution seems to be to have two update resource activities, one for //Target and one for //WorkflowData but that doesn't feel right.

    Friday, April 8, 2016 10:48 AM

Answers

  • I'm not able to repro this in my FIM lab and can't guess what could cause it to the point that I even doubt the error message is coming from this activity. For test, can you try with this as the sole activity and sole update expression in the entire workflow? What is the full error stack?
    Friday, April 8, 2016 4:39 PM

All replies

  • Having a resource update activity just updating //WorkflowData as the only update gives the same error.

    This is MIMWAL build 2.16.0320.0, and I'm using MIM build 4.3.2124.0

    Friday, April 8, 2016 10:58 AM
  • Are you trying to read the value back in the same activity in which you are setting it up?
    Friday, April 8, 2016 11:56 AM
  • No. I wanted to use it in the next activity to determine whether to send an email notification or not.
    Friday, April 8, 2016 12:05 PM
  • I this is indeed failing, then it will be a P1 regression in the latest build. Can you share screenshot of your activity?
    Friday, April 8, 2016 1:19 PM
  • Here is the one I was having trouble with originally:

    This one is the same as except  it just sets the workflow data:

    Friday, April 8, 2016 1:28 PM
  • I'm not able to repro this in my FIM lab and can't guess what could cause it to the point that I even doubt the error message is coming from this activity. For test, can you try with this as the sole activity and sole update expression in the entire workflow? What is the full error stack?
    Friday, April 8, 2016 4:39 PM
  • You are right, it was the second activity that had an error. The way I was testing it meant the second activity wasn't being run when I wasn't setting the workflow data at all.

    It all works perfectly when I fixed the second activity.

    Thanks for your help.

    Monday, April 11, 2016 8:17 AM
  • Cool. The second activity that threw error, was it a WAL activity? If yes, please can you share a screenshot? I've not seen this error from any WAL activity.
    Monday, April 11, 2016 1:02 PM
  • Yes, it was the Run PowerShell Script activity. I had a typo in one of the values for a named parameter:

    I had lower case x instead of an upper case X in the value expression:

    Monday, April 11, 2016 1:09 PM