Configuring the AIF Container in the ID

To run MCE applications in the ID, you must configure the Application Integration Framework (AIF) container as a hosted control in the CCF Admin Console.

To configure the AIF container

  1. Start the CCF Admin Console, and then start the Add New Hosted Application Wizard.
  2. Dd631952.decc1d3e-1cce-47bb-856e-9abfadd7b412(en-us,MSDN.10).png

  3. The hosted application Name will be the container name unless you override it by using the following application initialization string.
  4. 
                        <?xml version="1.0" encoding="utf-16"?>
    <initstring>
      <assemblyInfo>    <URL>D:\Dev\Work\CCFR4\Public\Framework\Microsoft.Ccf.Mce.Containers.AIF.dll</URL>
        <type>Microsoft.Ccf.Mce.Containers.AIF.MceAifContainer</type>
        <ContainerName>mchContainer1</ContainerName>
      </assemblyInfo>
      <DataDrivenAdapterBindings>
        <Type>
    Microsoft.Ccf.HostedApplicationToolkit.DataDrivenAdapter.WinDataDrivenAdapter,
          Microsoft.Ccf.HostedApplicationToolkit.DataDrivenAdapter
        </Type>
        <Controls />
      </DataDrivenAdapterBindings>
      <displayGroup>MainPanel</displayGroup>
    </initstring>
    
                      
    
  5. The Build Initialization String wizard does not allow you to enter the container name. Therefore, you must manually change the value in the XML <ContainerName>…</ContainerName> tag set.

  6. Click Next.
  7. In the Build Application Initialization String window, point the URI to the Microsoft.Ccf.Mce.Containers.AIF.dll in the installation directory. Specify the Type as Microsoft.Ccf.Mce.Containers.AIF.MceAifContainer, as shown in the following image.
  8. Dd631952.ba36bedb-6b40-4065-856f-f56ff98aa0b0(en-us,MSDN.10).png

  9. Build initialization string—URI and Type

  10. The <DataDrivenAdapterBindings> tag in the initialization string must be specified as shown below.

  11. 
                        <DataDrivenAdapterBindings>
      <Type>
    Microsoft.Ccf.HostedApplicationToolkit.DataDrivenAdapter.WinDataDrivenAdapter,
        Microsoft.Ccf.HostedApplicationToolkit.DataDrivenAdapter
      </Type>
      <Controls />
    </DataDrivenAdapterBindings>
    
                      
    
  12. Make sure that the rest of the information in the Build Application Initialization String window is correct, and then click OK.
  13. In the MceAIFContainer Properties window, configure the following actions for the hosted container control as shown below.
    • StartWorkUnit
    • UnloadWorkUnit
    • RestartWorkUnit
    • SendExternalEvent
  14. Dd631952.1f71c59d-937a-4eba-8eaa-b38e0159305a(en-us,MSDN.10).png

  15. Hosted container control actions

  16. You can invoke these actions by using the following code.

The APIs for the hosted control can be used as follows:

  • StartWorkUnit – This action can be fired as shown in the next code sample. The last parameter of the RequestActionEventArgs constructor can be an embedded resource name or a type name that derives from WorkUnitSchema. The return value is a WorkUnitID of the started work unit instance.
  • 
                        RequestActionEventArgs raArgs = new RequestActionEventArgs("MceAIFContainer", "StartWorkUnit", "DemoWorkflows,DemoWorkflows.WorkUnit.xml");
    
    this.FireRequestAction(raArgs);
    
    if (raArgs.ActionReturnValue != null && raArgs.ActionReturnValue.Length > 0)
    {
    this.txtWorkUnitID.Text = raArgs.ActionReturnValue;
    }
    
                      
    

UnloadWorkUnit – When you pass the GUID of the work unit you want to unload, this method returns the persisted work unit.


                  RequestActionEventArgs raArgs = new RequestActionEventArgs("MceAIFContainer", "UnloadWorkUnit", this.txtWorkUnitID.Text);this.FireRequestAction(raArgs);

                

RestartWorkUnitUse the following construction to restart a work unit from the AIF container.


                  this.FireRequestAction(new RequestActionEventArgs("MceAIFContainer", "RestartWorkUnit", this.txtWorkUnitID.Text));

                

Show: