Automatically filling an attribute based on an attribute of another object
Hi everyone, I have two objects that I am dealing with in FIM: Company (as a resource): it has an attribute called "companyemaildomain" and CompanyUser (as a resource): it has the "company" attribute that is not the resource "company" of course. When a user creates a new "Company" resource, he should fill the "companyemaildomain" attribute for this company, for example "mycompany.com" for the company "mycompany". When a new "companyuser" resource is created, the "Company" attribute is filled by the user by selecting it from an "UOCidentitypicker" that searches all existing companies. What i want is that for every companyuser, when the company attribute it filled, i want to automatically be able to retrieve the companyemaildomain for that company and use it for the companyuser (either filling it in an attribute for the user or directly using it in a sync rule.) actually i want to do this because i want the companyemaildomain to be used in the DN attribute flow of the user to Active Directory because the OU name is the companyemaildomain. I hope I was clear enough and that anyone can help with this. MM
June 9th, 2010 10:08am

Cool! Sounds like a great solution when dealing with multiple companies! Unfortunately you wont be able to solve it in either RCDC's that lacks event handling or sync rules since it doesn't give you a way to resolve the company resource. Your best bet is to use a custom workflow that resolves the Company resource using the ReadResourceActivity or the EnumerateResourceActivity. The custom workflow either writes the dependant attributes directly to the user or creates the attribute or attributes as Workflow Parameters that you pass in to the Sync Rule. //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 9th, 2010 11:42am

Henrik, do you have an example of the above? thanksMM
September 22nd, 2010 10:08am

Not really but there's a whole bunch of different examples out there on how to create custom workflows like for example this or examples on my and Carol's blog s. Basically what you should do is: 1. Get the resourceId for the company resource from the user being created or edited. The best bet for doing this is by using the CurrentRequestActivity and look through the RequestParameter collection for getting the reference value for the company attribute. Since you should do this in an action workflow you could also use a ReadResourceActvity to get value from the user resource that has already been written to the DB just before the workflow is kicked of. 2. When you have got the resourceID to the company resource you need to use a ReadResourceActivity to get the attribute values from it. 3. The values found could either be written to the WorkflowDictionary on the parent SequentialWorkflow and later picked up by a sync-rule using workflow parameters or by a function evaluator activity using the [//WorkflowData/AttributeName] syntax or they could be written directly to the user resource by using the UpdateResourceActivity . //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
September 22nd, 2010 10:54am

Dear Mr. Henrik, Thank you for a very helpful advanced hint, I want to ask a related question if I may, using the ReadResourceActivity you need to specify: ActorID ResourceID My question is: using custom a workflow, how to link the ActorID or the ResourceID with the object being created or edited, and does VS 2010 support those kinds of activities? because while creating this project using VS 2010, the addition of the FIM ResourceManagement dll to the toolbox generates an error that says, "There are no components in "path\2010\Service\Microsoft.ResourceManagement.dll" that can be placed on the toolbox..." knowing that in VS 2008 that same Dll will add a toolbox tab full of FIM Activities... Thank you, God bless you
September 27th, 2010 4:12pm

Hi! You don't have to care about the ActorID, this is set automatically to the user currently performing the request. Under certain circumstances you might want a group or some other resource to be the Actor but I guess that's not what you're after. To get the ResourceID for the current resource you could use this little piece of code that returns the parent workflow: // Try to get parent workflow. SequentialWorkflow containingWorkflow = null; if (!SequentialWorkflow.TryGetContainingWorkflow(this, out containingWorkflow)) { throw new InvalidOperationException("Could not get parent workflow!"); } When you have the parent workflow that is of the type SequentialWorkflow you can retrieve the ResourceID for the current object being created or edited from the TargetID property. Yes, VS2010 supports these activities but make sure you project is targeted .Net Framework 3.5 and not 4.0. I've had no problems adding the activities to the VS2010 toolbox. //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
September 27th, 2010 4:55pm

See How to use the FIM ReadResourceActivity, in VB.NET.http://www.wapshere.com/missmiis
September 28th, 2010 9:02am

Been there, done that. Thanks anyways.
Free Windows Admin Tool Kit Click here and download it now
September 28th, 2010 9:15am

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

Other recent topics Other recent topics