PureConnect

 View Only
Discussion Thread View
  • 1.  DesignerCOM API

    Posted 03-04-2020 04:24
    Does anyone used the DesignerCOM API? I found the documentation Designer COM API Reference , but I could not find any description how to access it. Do I have to register the designer as a COM server manually? I opened Visual Studio and trie to reference it, but could not find the COM object/type library.
    #Unsure/Other

    ------------------------------
    ---------------------------------------------
    Hans-Gerd Sandhagen
    Software Developer
    Fiebig GmbH
    ---------------------------------------------
    ------------------------------


  • 2.  RE: DesignerCOM API

    Posted 03-04-2020 17:26
    Was Interaction Designer running when you tried to access the COM objects?

    You didn't mention which language you are using, but another way you can access it is to reference the assemblies directly.  I don't recall how I figured out which dlls to use, but you can try these two, I used them in a test project awhile back. They are located in your I3\IC\Server folder:

    ININ.Interop.IDTypeLib.dll
    ININ.Tools.DesignerCustomizations.dll



    ------------------------------
    Douglas Suyemoto
    Latham & Watkins LLP
    ------------------------------



  • 3.  RE: DesignerCOM API

    Posted 03-05-2020 04:40
    Thank you Douglas. That was exactly the missing information. I want to use C# (if possible) and could reference the DLLs you mentioned. But I could not find out, how to initialize or access one of the classes in this DLLs.


    ------------------------------
    ---------------------------------------------
    Hans-Gerd Sandhagen
    Software Developer
    Fiebig GmbH
    ---------------------------------------------
    ------------------------------



  • 4.  RE: DesignerCOM API
    Best Answer

    Posted 03-06-2020 20:39
    I had to go back to this because I didn't have all the complete code, however, I was able to port the VB sample to a C# example that creates a sample "sleep" tool. Editing the Interaction Designer interface uses the same principle so I added a custom menu item to show this.

    using ININ.Interop.IDTypeLib;
    using System;
    
    namespace InteractionDesigner
    {
        public class CustomTest : II3IDToolSetAddOn
        {
            public void InitializeTypes(II3ID Designer)
            {
                
            }
    
            public void InitializeTools(II3ID Designer)
            {
                try
                {
                    var sleepToolLabel = "Sleep Sample (COM)";
                    var sleepToolDescription = "Pauses execution of this handler's thread.";
    
                    var sleepToolEventSink = Activator.CreateInstance(Type.GetTypeFromProgID("InteractionDesigner.CustomEventTest"));
                    //Designer.MessageBox(sleepToolEventSink.ToString());
    
                    object toolAddOnEventSink = null;
    
                    var sleepTool = Designer.Tools.RegisterTool(
                        toolAddOnEventSink,
                        sleepToolLabel,
                        "InteractionDesigner",
                        "Sleep",
                        sleepToolDescription,
                        "Basic",
                        "IPSLEEPTOOLU",
                        "ExecuteSleep",
                        1,
                        "1.0");
                    //Designer.MessageBox(sleepTool.Name);
    
                    var integerTypeSpecifier = "::" + Designer.QueryNativeTypeName(I3IDNativeDataType.ID_INTEGER);
                    //Designer.MessageBox(integerTypeSpecifier);
    
                    var inputParmLabel = "Sleep Time In Seconds";
    
                    sleepTool.ParameterDefinitions.Item(0).SetAsInputComboBox(integerTypeSpecifier, inputParmLabel, true);
                    //Designer.MessageBox("Set combobox");
    
                    var nextLabel = "Next";
    
                    sleepTool.ExitPaths.Add(nextLabel, 1, false);
                    //Designer.MessageBox("Added exit path");
    
                    sleepTool.RegisterForStepEvents(sleepToolEventSink);
                    //Designer.MessageBox("Register for step events");
    
                    sleepTool.Commit();
                    //Designer.MessageBox("Committed");
                }
                catch (Exception ex)
                {
                    Designer.MessageBox(ex.Message);
                }
            }
    
            public void InitializeEnvironment(II3ID Designer)
            {
                Designer.MenuManager.AddMenuItem("Test Menu", false, true, null);
            }
    
            public void ShutDown(II3ID Designer)
            {
                
            }
    
            public void Initialize(II3ID Designer)
            {
                Designer.MessageBox("Initialize", "Message Title");
            }
        }
    
        public class CustomEventTest : II3IDStepEvents
        {
            public void StepInserted(II3IDStep InsertedStep)
            {
                InsertedStep.Designer.MessageBox(InsertedStep.Label);
            }
    
            public void StepToBeRemoved(II3IDStep StepToRemove)
            {
                StepToRemove.Designer.MessageBox(StepToRemove.Label);
            }
    
            public void StepUpdated(II3IDStep UpdatedStep)
            {
                throw new NotImplementedException();
            }
    
            public void StepLinked(II3IDStepLink LinkStepInfo, bool ToolIsPreviousStep)
            {
                throw new NotImplementedException();
            }
    
            public void StepUnlinked(II3IDStep PreviousStep, II3IDExitPath PreviousStepExitPath, II3IDStep NextStep, bool ToolIsPreviousStepInStepInfo)
            {
                throw new NotImplementedException();
            }
    
            public bool StepOutOfSync(I3IDOutOfSyncReason ReasonCode, II3IDStep CurrentStep, II3IDOldStepInfo OutOfSyncInfo)
            {
                throw new NotImplementedException();
            }
    
            public bool EditStepProperties(II3IDStep StepToModify, int ParentHWND)
            {
                throw new NotImplementedException();
            }
    
            public void Publish(II3IDStep StepToPublish, II3IDICServer Server)
            {
                throw new NotImplementedException();
            }
    
            public void Validate(II3IDStep StepToValidate)
            {
                throw new NotImplementedException();
            }
    
            public void GenerateI3PUB(II3IDStep Step)
            {
                throw new NotImplementedException();
            }
        }
    
    Save this as a library project and copy the compiled dll to your "Server" folder in I3.

    You will also need to add this line in the "DesignerRegisteredTools.lst" (also in the "Server" folder):

    UNICODE RELEASE PROGID InteractionDesigner.CustomTest

    This will allow ID to load the dll file you created.

    By the way, I put both CustomEventTest and CustomTest classes in the same file so its easier to copy/paste, but they were in two class files.  Also, I only needed to reference the one dll "ININ.Interop.IDTypeLib.dll".

    The test menu was added to the "Utilities" menu.



    ------------------------------
    Douglas Suyemoto
    Latham & Watkins LLP
    ------------------------------



  • 5.  RE: DesignerCOM API

    Posted 03-15-2020 05:48
    Thank you very much. Your example code works. It was not exactly what I was looking for but it is well to know, that writing custom tool steps in C# is possible.

    I thought, that there is a possibility to remote access the designer via COM (e.g. exporting and importing handlers), but maybe I was wrong and I have to reread the documentation about this.

    ------------------------------
    ---------------------------------------------
    Hans-Gerd Sandhagen
    Software Developer
    Fiebig GmbH
    ---------------------------------------------
    ------------------------------



  • 6.  RE: DesignerCOM API

    Posted 03-17-2020 23:48
    The DesignerCOM allows you to customize the Interaction Designer interface, but if all that you want to do is publish handlers and export them, you can use command line parameters to bulk publish handlers using the interaction Designer idu.exe directly or using EICpublisherU.exe.

    To export the handlers you can use a Interaction Designer to export to XML. 

    I guess I would need to know more about what you're trying to accomplish to assist more, but if you're trying to just access remotely, you can actually run the idu.exe by going to the drive share and opening, of course this would be slow depending on your connection, but may work for occasional use.



    ------------------------------
    Douglas Suyemoto
    Latham & Watkins LLP
    ------------------------------



  • 7.  RE: DesignerCOM API

    Posted 09-24-2021 11:59
    Hi Douglas,
    You do not happen to have an example of the IPSLEEPTOOLU?

    I created my own but I keep getting an error, The specified module could not be found.

    Thanks,
    Ant

    ------------------------------
    Antonio Montes
    American Advisors Group
    ------------------------------



Need Help finding something?

Check out the Genesys Knowledge Network - your all-in-one access point for Genesys resources