Soledad Pano's Blog

Just Technical Stuff

CCF 2008 Hosted Application Toolkit

The Hosted Application Toolkit (HAT) is a new component of CCF 2.6 (2008) that facilitates the task of automating the UI of the hosted applications. It consists of two main parts: the Data Driven Adapters (DDA) and the Automations (WF workflows) that automates the hosted application using the DDAs.

Data Driven Adapters

DDAs must inherit from DataDrivenAdapterBase in Microsoft.Ccf.HostedApplicationToolkit. CCF supports two implementations out of the box: WinDataDrivenAdapter and WebDataDrivenAdapter. We can inherit from any of the three to extend the DDA as necessary. The methods the DDAs expose to manipulate the hosted application UI are ExecuteControlAction, FindControl, GetControlValue and SetControlValue. These methods take a friendly name as parameter and lets the application adapters interact with the hosted application UI abstracting from the details of how to obtain the control from that friendly name. The mapping between the controls' friendly names and the directions for the DDA to finding them is called Data Driven Adapter Binding and is part of the hosted app initialization string:

<DataDrivenAdapterBindings>

    <Type>Microsoft.Ccf.HostedApplicationToolkit.DataDrivenAdapter.WinDataDrivenAdapter</Type>

    <Controls>

        <AccControl name="okButton">

            <Path>

                <FindWindow>

                    <ControlID>15</ControlID>

                </FindWindow>

            </Path>

        </AccControl>

        <AccControl name="cancelButton">

            <Path>

                <FindWindow>

                    <ControlID>15</ControlID>

                </FindWindow>

            </Path>

        </AccControl>

    </Controls>

</DataDrivenAdapterBindings>

 

Note: It is a known issue that the initialization string of a hosted application is limited to 3902 characters. This may result a problem if several controls must be listed.

Although DDAs can be used from any custom adapter (and even outside CCF), they were mainly thought to support Automations in HAT.

 

Automations

In previous versions of CCF we could choose to use an Application Adapter to implement the actions' logic. In version 2.6 we can choose between Automation Adapter, Legacy Adapter, or no adapter at all. The Legacy Adapter is the Application Adapter from the previous versions. We can implement our own Legacy Adapter inheriting from the [Web]ApplicationAdapter class. The Automation Adapter is the adapter that makes use of the new Workflow Foundation (WF) feature. The AutomationAdapter implements the IAutomationAdapter interface. However, if we choose AutomationAdapter in the hosted app configuration in the AdminConsole, we can't choose our own implementation of IAutomationAdapter.

If a hosted application is configured to use the AutomationAdapter, we can specify a WF workflow to implement an action's logic. Workflows in HAT are called Automations.

In order to orchestrate an action automation, a set of WF Activities are provided by CCF that interact with the DDAs to access the UI controls. There are activities for calling an action in a hosted application, setting or getting a control's value, accessing the context, register for an application event, etc.

All together

The connection between the Automations and the DDAs is achieved by the AutomationBridgeService, which is in turn connected to the AutomationAdapter. As the bridge service is added to the WF runtime, it is accessible from the CCF WF activities. We can extend the set of activities and make use of this server, too.

The following diagram depicts the relationship between the components mentioned above:

 

 

 

More detailed documentation can be found in chapter 9 of the CCF 2008 Development Guide.

Posted: Oct 26 2007, 01:40 AM by spano | with 5 comment(s)
Filed under:

Comments

Edward said:

Hi,

Very good article. I am hunting for detail reference for this CCF but can't find any. Documents come with CCF 2008 is not helpful in producing a enterprise grade solution. Any suggestion?

# May 30, 2008 6:00 AM

spano said:

I'm afraid there's no more detail reference than that (as far as I know). Although for Microsoft's accounts there is a wiki and a discussion group, very useful.

# May 30, 2008 8:55 AM

Janer Gracia said:

Hi,

I am looking for an example about how to automate a win32 application menu. There is no documentation about how to describe menu controls

# September 26, 2008 5:03 PM

Brian Garnica said:

Hi,

I'm try to find window (as a Window Monitor) at CCF, where the functionallity is that on windows hosted application form shown, there raise an event. Can you help me?

Thanks.

# January 16, 2009 3:03 PM

cheap propecia said:

I rarely comment on blogs but yours I had to stop and say Great Blog!!

# May 31, 2009 3:36 AM
Leave a Comment

(required) 

(required) 

(optional)

(required)