Web Client Software Factory - controller class navigation tree

Topics: User Forum
Mar 21, 2007 at 4:41 PM
I'm trying to create a controller class for my pageflow

i made a method that generates a treeview based on the transitions and allows me to navigate trhough the workflow.
the problem is that with the interface IPageFlow i only get access to the transitions name...

since the transitions are based on the EventDrivenActivities in the pages, i was wondering if there's a way to get the "description" property on these activities to my controller class...

any ideias?
Developer
Apr 4, 2007 at 12:46 AM
Edited Apr 4, 2007 at 2:13 PM
You will need to write your own implementation of the IPageFlow interface. I would recommend you to copy the following classes in your own assembly/namespace:

  • WorkflowFoundationPageFlowFactory
  • WorkflowFoundationPageFlowProvider
  • WorkflowFoundationPageFlow
Then follow these steps:

  • Change the constructor of WorkflowFoundationPageFlowProvider to create your WorkflowFoundationPageFlowFactory.
  • Change the GetPageFlow method of the WorkflowFoundationPageFlowFactory to create your WorkflowFoundationPageFlow.
  • Add to your new WorkflowFoundationPageFlow this new property:
public ReadOnlyCollection<string> TransitionsDescriptions
{
   get
   {
       if (!_stateMachineQuery.IsWorkflowQueueDataAvailable())
           throw new PageFlowException(string.Format(CultureInfo.CurrentCulture, Resources.CannotGetTransitions, this.Id));
 
       List<string> descriptions = new List<string>();
 
       foreach (Activity activity in _stateMachineQuery.CurrentState.Activities)
       {
           if (activity is EventDrivenActivity)
           {
              descriptions.Add(activity.Description);
           }
       }  
        
       return descriptions.AsReadOnly();
    }
}
  • Change the configuration to use your new provider.
Let me know if this helps,
Ezequiel Jadib
http://staff.southworks.net/blogs/ejadib