ReadResourceActivity issue in custom workflow
Hello, I was playing with some custom workflow activities and I ran into a strange issue. I've placed a ReadResourceActivity inside of while activity loop and I found that it stopped with error right after the execution of this activity. In request history I can see an error talking about "Invalid requestor specified for Get Operation" which is strange because I've used administrator and also fimservice account as requestor. This activity works pretty well in the default sequenceactivity but has some problems in a while activity. Please can somebody confirm, that it is a some sort of bug or I'm doing something wrong.
June 4th, 2010 6:11pm

The usual problem you end up when adding a child activity to any kind of repeating activity is that you reference the "template" activity tree. An important aspect of WF is that an activity must not be executed more than once and WF solves this by creating new instances of the "template" activity tree within a repeating activity for each iteration and the "template" wont be executed at all. If you instead get the actual child instance for the iteration you'll probably solve the problem. Edit: I've got a description on how to get the a reference to the iteration in this blog post: http://idmcrisis.com/post/2009/11/16/EnumerateResourcesActivity-the-follow-up.aspx It describes this for the FIM EnumerateResourcesActivity but the While activity works the same way. //Henrik Henrik Nilsson, ILM/FIM MVP Blog: http://www.idmcrisis.com Company: Cortego (http://www.cortego.se)
Free Windows Admin Tool Kit Click here and download it now
June 5th, 2010 10:12am

The EnumerateResourcesActivity worked pretty well, but I think that using a readResourceActivity is fitting my goal more effectively. I want to evaluate a multivalue reference attribute and store the displayNames of these reference resources into another string attribute. Using enumeration of resources has to go through all of the resources set in XPATH filter while using readResourceActivity can read these reference resources directly. (I know ObjectIDs of these resources by reading a multivalue reference attribute).
June 6th, 2010 10:12pm

The thing is it doesn't matter what iterating activity you use, I just wanted to point out the possible problem that might be the one you have and that occurs when you reference the template instance instead of the actual iteration instances of your child activities. You choose whatever iteration activity you like and but the EnumerateResourcesActivity will probably be more effective since the web service will be called only once (I think) and by using the ReadResourceActivity it will have to be called for every iteration. //HenrikHenrik Nilsson, ILM/FIM MVP Blog: http://www.idmcrisis.com Company: Cortego (http://www.cortego.se)
Free Windows Admin Tool Kit Click here and download it now
June 6th, 2010 10:27pm

OK, probably you are right that EnumerateResourcesActivity will be more effective. I also nearly forgot that I'm able to construct an XPATH filter, that will select all reference resources stored in a multivalued reference attribute, so I will iterate only related resources. Nevertheless, I still don't quite understand the problem with executing an activity more than once. Is there any more info about this (I like having things clear to me ;o))
June 14th, 2010 3:56pm

Hi! No...Not really unless maybe there's some info on the standard WF activities that comes with .Net... You could also have a look at this article and specifically the part on the Loops and Repeated Activities that works in a similar way as the EnumerateResourcesActivity: http://msdn.microsoft.com/en-us/magazine/cc163529.aspx Since a WF activity may never be instantiated more than once within a workflow instance the iterating activities creates and executes instances for each iteration with the original children as a templates. In the case with EnumerateResourcesActivity whose GetCurrentIterationItem method must be fed with the direct child activity for the current iteration it's common you think you could use the original child activity that only acts as a template for iteration instances and that will not give you the resource instead it'll likely give you an exception. In order to get the immediate child for the current iteration you can use the sender parameter passed in to for example a child code activity like I've shown in my blog post. //Henrik Henrik Nilsson, ILM/FIM MVP Blog: http://www.idmcrisis.com Company: Cortego (http://www.cortego.se)
Free Windows Admin Tool Kit Click here and download it now
June 14th, 2010 6:33pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics