none
dynamically remove an activity from WorkflowDesigner ? RRS feed

  • Question

  • Hi my friends, how can i dynamically remove an activity from WorkflowDesigner ?
    i have collection of my activities

    ModelService ms = _workflowDesigner.Context.Services.GetService<ModelService>();
    IEnumerable<ModelItem> activityCollection = ms.Find(ms.Root, typeof(FlowDecision));
    foreach (var a in activityCollection)
    {
        if (a.Properties["Condition"].Value == null)
       {
             // delete a; how can i do this ?
       }
    }

    Monday, July 9, 2012 10:30 AM

Answers

  • Hi, thanks for answer, i solved it like this
    var imp = ms.Root.Properties["Implementation"].Value;
                            if (imp != null)
                                imp.Properties["Nodes"].Collection.Remove(a);
    Wednesday, July 11, 2012 5:48 AM

All replies

  • Hi,

    Try this:

    ms.Root.Properties["Nodes"].Collection.Remove(a);

    Wednesday, July 11, 2012 5:01 AM
  • Hi, thanks for answer, i solved it like this
    var imp = ms.Root.Properties["Implementation"].Value;
                            if (imp != null)
                                imp.Properties["Nodes"].Collection.Remove(a);
    Wednesday, July 11, 2012 5:48 AM