How to optimize getting a user from Ultimus OC

This article explains you how to optimize getting a user from Ultimus OC because if you use the method of GetAllOCMembers defined in Ultimus.OC.OrgChart to identify a user and the solution is running for multiple countries having thousands of employees defined in the Ultimus Organizational Chart, it will take a lot of time as well as it will slow down the loading of the page and end user will get frustrated.

SO lets say you have a business process with following implementation:

1. Designed in Ultimus BPM
2. Integrated with an ASP.NET website
3. Ultimus OC is having the organizational chart/heirarchy defined for multiple countries with a naming convention of Chart Name_CountryName
4. Each chart contains thousands of employees listed
5. A database table is maintained to identify the user country linked with OC.
Structure is like

CountryCode
OCName

6. You want to get the country ISO code of user’s country based on which OC chart the user is found. This ISO code might be used on later stages for some functionality

The function that takes more time is

private string GetUserCountry()
{
string CountryISOCode = string.Empty;
Ultimus.OC.User usr;
Ultimus.OC.User[] usrList;
Ultimus.OC.OrgChart UltOrgChart = new Ultimus.OC.OrgChart();

if (UltOrgChart.GetAllOCMembers(out usrList))
{
for (int i = 0; i < usrList.Length; i++)
{
if ((String.IsNullOrEmpty(Request.Cookies[“UserID”].Value)) || (String.IsNullOrEmpty((usrList[i].strUserName))))
continue;
if (Request.Cookies[“UserID”].Value.ToLower() == usrList[i].strUserName.ToLower())
{
usr = usrList[i];
string[] strChartList = usrList[i].strDepartmentName.Split(‘_’);
string strCountry = strChartList[strChartList.Length – 1];
CountryISOCode = DAL.GetCountryISOCodeAgainstOC(strCountry);//Change the code here to get the data

break;
}
}
}
return CountryISOCode;
}

The improved version is listed below:

private string GetUserCountry()
{
string CountryISOCode = string.Empty;
Ultimus.OC.User usr;
Ultimus.OC.OrgChart UltOrgChart = new Ultimus.OC.OrgChart();
UltOrgChart.FindUser(Request.Cookies[“UserID”].Value, “”, “”, out usr);
Ultimus.OC.Department[] strDepartments;
usr.GetUserDepartments(out strDepartments);

foreach (Ultimus.OC.Department strDepartment in strDepartments)
{
string[] strChartList = strDepartment.strDepartmentName.Split(‘_’);
if (strChartList.Length > 1)
{
string strCountry = strChartList[strChartList.Length – 1];
CountryISOCode = DAL.GetCountryISOCodeAgainstOC(strCountry);//Change the code here to get the data
}
}
return CountryISOCode;
}

The approach being used in the approved version is that instead of

UltOrgChart.GetAllOCMembers(out usrList) //getting all users of OC and then filtering the requested user

we have used

UltOrgChart.FindUser(Request.Cookies[“UserID”].Value, “”, “”, out usr);

which gives the exact user and then you can get a list of his department name and pass it to get the country ISO code.

You can use different variations in this approach to fit into your requirements.

 

Ultimus BPM studio fails on generating step assembly

Ultimus BPM Suit is one of the best business process management tools which gives you the ability to create business processes graphically, manage them, integrate ASP.NET website with the step forms and lots of more. If you are publishing a process on Ultimus BPM studio v 8.2, Ultimus BPM studio fails on generating step assembly. It gives the following error:

error - Copy

This error is most likely because your MS DTC (Microsoft Distributed Transaction Coordinator) settings are incorrect on you Ultimus or DB server(s).

In order to check the MS DTC settings, go to Start Menu->Administrative Tools->Component Services->Computers->My Computer->Distributed Transaction Coordinator

Right click on the Local DTC node and click on properties. Go to ‘security’ tab, and see if your local DTC security settings resembles the following image, if not you have to correct it.

DTC Settings

 

You have to check these settings on the DB server as well as all the Ultimus servers included in the NLB (Network Load Balancing) configuration (if you are using NLB).

Now restart the Ultimus services and login to Ultimus BPM studio again and try to publish the process, hopefully the problem will be resolved.