PureEngage On-Premises

 View Only

Sign Up

  • 1.  IWS Need to Query for Configuration information from Config Server

    Posted 01-08-2016 21:00
    I am creating a new module for our IWS and would like to store some configuration information in our config server. My question is: Is there a way for us to connect to the configuration server to retrieve the config information without having to store the config server connection information in the module?

    I have done this in the past with the platform sdk, having the config server connection information in an app.config file but we would like to see if this can be accomplished using the connection that already exists to the config server from IWS. I am just not seeing anything like this in the documentation.

    Thanks.


  • 2.  RE: IWS Need to Query for Configuration information from Config Server

    Posted 01-12-2016 10:27
    Here you go.....
    Below code piece shows how to add Person object as member into Role object; 

    *****************************************************************************
    IConfService confService = this.container.Resolve<IConfigurationService>().ConfigService;
                
                    CfgRoleQuery cfgRoleQry = new CfgRoleQuery();
                    cfgRoleQry.Name = "roleName";

                    CfgRole cfgRole = confService.RetrieveObject<CfgRole>(cfgRoleQry);

                    if (null == cfgRole)
                    {
                        errMsg = "Role not found";
                        return false;
                    }


                    CfgRoleMember cfgRoleMember = new CfgRoleMember(confService, null);
                    cfgRoleMember.ObjectType = CfgObjectType.CFGPerson;
                    cfgRoleMember.ObjectDBID = agentDBID;

                    cfgRole.Members.Add(cfgRoleMember);
                    cfgRole.Save();

    ****************************************************************************************

    Note: Instead of resolving IConfigurationService, you can also pass IConfigurationService into constructor of module. And this is more better way.