How to add your knowledge

Using WorkflowContainerFactory

    Table of contents
    No headers

    A workflow user interface can also be implemented by directly creating AutoCAD Map 3D workflow controls in the AutoCAD Map 3D task pane. This is done using an object based on the IWorkflowContainer interface (GeneralWorkflowContainerDesktop or GeneralWorkflowContainerWeb) created using the WorkflowContainerFactory static class. Workflows based on these container objects are compatible with the AutoCAD Map 3D Desktop Client and, unlike workflows using Windows user controls, the AutoCAD Map 3D Web Client as well. While the choice of controls and their placement is limited compared to Windows user controls, this also gives you access to AutoCAD Map 3D-specific controls. For more information about these controls, see Industry Model Workflow Controls.

    In the entry point, make a container object that contains the IWorkflowContainer interface. This can be done by calling WorkflowContainerFactory.Create(), which returns an IWorkflowContainer interface to the new container object, either a GeneralWorkflowContainerDesktop or a GeneralWorkflowContainerWeb depending on whether the user is in the AutoCAD Map 3D Desktop Client or the AutoCAD Map 3D Web Client.

    Note

    If you know the workflow will only be used in one type of client, you can directly create a new GeneralWorkflowContainerDesktop or GeneralWorkflowContainerWeb object.

    When creating this container, you specify some features of its behavior, such as the presence of a “Close”, “Ok”, or “Cancel” buttons.

    IWorkflowContainer container = WorkflowContainerFactory.Create(
        this.WorkflowSupport, 
        ContainerButtons.OkCancel, 
        Resources.ModuleName, 
        false);
    

    When your workflow has finished, be sure to clear the AutoCAD Map 3D task pane and return it to its previous state with the following code:

    this.WorkflowSupport.WorkflowExplorerFlyIn.HideUserControls();
    

    For demonstrations of these techniques, see Sample 85 - Workflows, Sample 116 - Advanced Workflows, and Sample 117 - Simple Water Module.