Custom Workflow-Enumerate Resource Activity
Hi all I create a EnumerateResourcesActivity, add a SequenceActivity to it and to the SequenceActivity I add a CodeActivity this is my designer.cs.i didnt add any WebUIS interface. then i generate XOML file for these workflow activity as FetchingData fda = new FetchingData(); SequentialWorkflow wf = new SequentialWorkflow(); wf.Activities.Add(fda); XmlWriterSettings xml = new XmlWriterSettings(); xml.OmitXmlDeclaration = true; using (XmlWriter writer = XmlWriter.Create("MyCustomWorkFlow.xoml", xml)) { WorkflowMarkupSerializer ser = new WorkflowMarkupSerializer(); ser.Serialize(writer, wf); } and in Intialize component i have written as this.CanModifyActivities = true; this.codeActivity = new System.Workflow.Activities.CodeActivity(); this.sequenceActivity = new System.Workflow.Activities.SequenceActivity(); this.enumResourcesActivity = new Microsoft.ResourceManagement.Workflow.Activities.EnumerateResourcesActivity(); // // codeActivity // this.codeActivity.Name = "codeActivity"; this.codeActivity.ExecuteCode += new System.EventHandler(this.codeActivity1_ExecuteCode); // // sequenceActivity // this.sequenceActivity.Activities.Add(this.codeActivity); this.sequenceActivity.Name = "sequenceActivity"; // // enumResourcesActivity // //this.enumResourcesActivity.ActorId = new System.Guid("00000000-0000-0000-0000-000000000000"); //this.enumResourcesActivity.Name = "enumResourcesActivity"; //this.enumResourcesActivity.PageSize = 100; //this.enumResourcesActivity.Selection = null; //this.enumResourcesActivity.SortingAttributes = null; //this.enumResourcesActivity.TotalResultsCount = 0; //this.enumResourcesActivity.XPathFilter = null; this.enumResourcesActivity.PageSize = 100; this.enumResourcesActivity.XPathFilter = "/Person"; this.enumResourcesActivity.Activities.Add(this.sequenceActivity); // // FetchingData // //this.Activities.Add(this.enumResourcesActivity); in code behind SequenceActivity s = (SequenceActivity)((CodeActivity)sender).Parent; ResourceType resource = EnumerateResourcesActivity.GetCurrentIterationItem(s) as ResourceType; this.Log(resource); These are the code i used to retrieve the attribute value from fimportal to custom workflow,but still i am struggling to fetch the values.I am new to custom workflow,May be i am wrong in some point. Please Guide me to proceed further.
October 26th, 2010 1:13am

Hi! Since you're setting the Selection attribute to null you wont get any attributes. If you instead set it to a string array with the attributes you wish to fetch you'll get the attributes back... EnumerateResourcesActivity.Selection = new string[]{"DisplayName", "AccountName"}; ...Then you'll be able to read the attribute like this: string accountName = resource["AccountName"]; Check out the Selection property here: //HenrikHenrik Nilsson, ILM/FIM MVP Blog: Company: Cortego (
Free Windows Admin Tool Kit Click here and download it now
October 26th, 2010 1:27am

Thanks for your quick reply. while i am trying to fetch accountname after assigning the selection attributes and also to property for that selection array. i am facing the following issue "Composite activity cannot transition to closed status when there are active child context still exist for child activity" Waiting for your reply to proceed further. Thanks in Advance Hira
October 26th, 2010 2:37am

I can't see a reason from your code why you are facing the problem but make sure you don't call Activity.Closed = true or context.CloseActivity() or something like that... //HenrikHenrik Nilsson, ILM/FIM MVP Blog: Company: Cortego (
Free Windows Admin Tool Kit Click here and download it now
October 26th, 2010 6:11am

Hi Thanks . But i am not using any close activity.but still i am facing the problem,i am not sure whether my XOML generator coding is wrong. Please help us. Thanks in Advance Hira
October 26th, 2010 7:10am

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

Other recent topics Other recent topics