chrisg

Working hours via the API

 

So you say you want to get at the "Working hours" functionality but want to do it via the API. Well here is a quick sample of how to get to working hours through SourceCode.Workflow.Management

 

This sample will list out the zone names. You can also create, delete, query a user's zone, get/set hours, dates, date exceptions, etc.

 

            SourceCode.Hosting.Client.BaseAPI.SCConnectionStringBuilder connectionString = new

                SourceCode.Hosting.Client.BaseAPI.SCConnectionStringBuilder();

 

            connectionString.Authenticate = true;

            connectionString.Host = "servername";

            connectionString.Integrated = true;

            connectionString.IsPrimaryLogin = true;

            connectionString.Port = 5555;

             

            WorkflowManagementServer workflowServer = new WorkflowManagementServer();

            try

            {

                workflowServer.CreateConnection();

                workflowServer.Connection.Open(connectionString.ToString());

 

                workflowServer.ZoneListAll().ForEach(delegate(string zone){Console.WriteLine(zone);});

                Console.ReadLine();

            }

            catch{}

            finally

            {

                workflowServer.Connection.Close();

            }

 

 

You may want to check out the latest updated developer reference to get more information on SourceCode.Workflow.Management. These classes can be used for a variety of tasks such as managing the workflow server, setting rights and managing workflow-related tasks

Published Monday, April 28, 2008 5:50 PM by chrisg

Comments

No Comments
Anonymous comments are disabled

About chrisg

I am responsible for community development for SourceCode. I have been in technology for over 14 years mainly in infrastructure and security. I absolutely love technology especially new stuff and gadgets.