Tuesday, February 24, 2015

OnBase Unity Workflow Script ODBC connection method

Here is a standard OnBase workflow ODBC connection method.

  • You have to have the DSN setup on the machine that is running the workflow process/timer.
  • You need to add a Reference in the Unity IDE
namespace <project name>
{


    using Hyland.Unity;
    using Hyland.Unity.Workflow;
    using System.Data.Odbc;
...

    public class <project name> : Hyland.Unity.IWorkflowScript
    {
...
        public void OnWorkflowScriptExecute(Hyland.Unity.Application app, Hyland.Unity.WorkflowEventArgs args)
        {
         
OdbcConnection conn = openODBCConnection();
...
         }
...
private OdbcConnection openODBCConnection()
        {
            var conn = new OdbcConnection();
            conn.ConnectionString = "DSN=OnBaseDSN;UID=<instance user>;PWD=<password>";
            conn.Open();
            return (conn);
        }

No comments:

Post a Comment