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 Error The status of this task is 1 It cannot be submitted

You might have noticed an Ultimus Error The status of this task is 1 It cannot be submitted, While you are submitting a task from your inbox. This error occurs on the line of code where you use SendTask method. Actually the message is somewhat irrelevant to the error which is occurring at the back-end and it might have following reasons.

1. Invalid Step Recipient: You have not set the step recipient as

  • A valid short name of the person
  • The organizational chart group is invalid
  • Job function group is invalid
  • The dynamic recipient string used to set dynamic recipient is incorrect e.g. USER:org=Business Organization,user=UserShortName has some invalid values or syntax.

Solution to this problem is that you have to carefully check all the step recipients and their assignments.

2. Another scenario which I came across today is that you have 2 BPM servers with NLB (Network Load Balancing Configuration) and you are using email connectors to send emails via email flobots in the process maps. But one of the server’s BPM studio doesn’t have email connectors on it, and mistakenly you used the server with email connectors to publish the process on the server. But when the end user accessed the process through inbox task and tried to submit and the request went to other server which doesn’t have the email connectors. So it failed and generated an error while sending the task ‘The status of this task is 1 It cannot be submitted’.

Solution to this problem is to create the email connector on the other server and publish the process again on the faulty server. Although both servers are pointing to same DB repository but its strange that the email connectors on both BPM servers are stored differently.

3. Another reason this error comes up is that if you try to abort a step via step rules or code, and the step being aborted is not active, your send task method will generate the error ‘The status of this task is 1 It cannot be submitted’.

Solution to this problem is that you have to modify the step rules/code and add one more condition to check if the step status is active then abort the step. It will be fixed.

4. Yet another reason for this error could be that there is a known issue with the junction step. Sometimes junction step doesn’t go into delay or sometimes it doesn’t come out of delay. Sometimes if you have modified junction step rules to abort it, you may get this error so you have to delete the junction step, create it again, place the rules again and then publish. It will work.

So its really hard to catch this error and resolve it.

Enjoyyyyy!!!

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.