Freigeben über


Dev-BA Collaboration:Part-1

One of the selling points with Workflows is customers have been able to customize the Workflows and can have a collaborative work between the BAs and Developers. BAs define the business process using the Re-hosted Workflow designer and the dev fine tunes/completes the implementation by taking the Workflow file in VS and editing it as appropriate.

In that context, the very first question that generally comes is, for a particular activity, how can we have a specific designer for BA and a different one for the developer in VS.

The 3 ways generally to associate an activity with the designer as you know is:

1. Designer attribute on your code activity.

2. If your custom activity is in CustomActivities.dll, you can create your designer in the CustomActivities.Design.dll. Then use the IRegisterMetadata as below to register the activity to the class. Please note that the CustomActivities and the CustomActivities.Design dlls should be in the same folder.

3. You can override the above two associations in the VS world, with CustomActivities.VisualStudio.Design.dll

Association Code:

 namespace CustomActivities.Design
{
    class Metadata : IRegisterMetadata
    {
        public void Register()
        {
            AttributeTableBuilder builder = new AttributeTableBuilder();
            // Register Designers.
            builder.AddCustomAttributes(typeof(Prompt), new DesignerAttribute(typeof(CustomActivities.Design.BasicDesignerWithStyling)));
            // Apply the metadata
            MetadataStore.AddAttributeTable(builder.CreateTable());
        }
    }
}

I have attached the zip with the sample application. The first time, you drag-drop the Prompt activity in Workflow.xaml, it should use the BasicDesignerWithStyling. However, if you go to the Registration.cs in CustomActivities.VisualStudio.Design project and uncomment the association, the next time after building the solution, you would get the InlineControl designer.

Thus, for a BA, the activity author can ensure either 1. To use the Code attribute or 2. Override using CustomActivities.Design.dll or 3. Override the Designer in the Re-hosting environment by providing the Attribute table in that re-hosted application.

And for the same activity, in the VS environment, use the CustomActivities.VisualStudio.Design.dll to override the designer with a one apt for the developer.

Thanks,

Kushal.

DevBACollaboration_Part_1.zip