Business Activity Monitoring

The XMBusiness Activity Monitor is primarily a service which can perform time-based jobs. It has a Controller/Mediator and a Database to store its data. It communicates to XMWorkspace using an XMPro API while the XMWorkspace and any third-party can communicate to an XMBusiness Activity Monitor using the WCF Service exposed by it. It has a default UI which is an ASP application and uses the same WCF Service to communicate.

Business Activity Monitor

Job

A job is a combination of following

  1. Schedule
  2. Trigger
  3. Action(s)

Schedule

A Schedule defines the timing of the Trigger to be evaluated at. It is defined by the end-user through UI at the time of configuring a job. Currently, it provides following Recursive scheduling options:
XMBusiness Activity Monitor Controller continually evaluates each job’s next Time to Occur. If the Time to Occur is current it creates a Thread and assigns it the relevant Trigger.

Trigger

A trigger physically exists in a folder which XMBusiness Activity Monitor has access to, specified in the config file. It is a DLL extended from a generic DLL (XMMonitor.dll) provided with some built-in functions, for example, checking for new Tasks, etc.

A trigger’s primary responsibility is to Evaluate if the Job needs to be executed or not. A trigger may get data passed in as static parameters at the time of configuration.

If the trigger evaluates to true it calls the current job’s associated Action(s). The outcome of Job is logged to database at the end of execution of all Actions.

Action

An action physically exists in a folder which XMBusiness Activity Monitor has access to, specified in the config file. It is a DLL extended from a generic DLL (XMMonitor.dll) provided with some built-in functions, for example, creating a Task, Sending an email, creating an XMPro User, etc.

Users can create a custom Action which will have access to all standard functions which can be mixed and matched for individual requirements.

Every Action has a set of inputs and outputs in a form of Named Value Pairs which in case of Sequenced Actions are passed from one Action to another.

xmd_BAM_Recursive_Scheduling_Options

XMPro Specific Actions

User, Business Groups

Name Create User
Class Name XMBusinessActivityActions.CreateUser
DLL XMBusinessActivityActions.dll
Name Update User
Class Name XMBusinessActivityActions.UpdateUser
DLL XMBusinessActivityActions.dll
Name Remove User
Class Name XMBusinessActivityActions.RemoveUser
DLL XMBusinessActivityActions.dll
Name Deactivate User
Class Name XMBusinessActivityActions.DeactivateUser
DLL XMBusinessActivityActions.dll
Name Unassign All Business Groups
Class Name XMBusinessActivityActions.UnassignAllRoleGroups
DLL XMBusinessActivityActions.dll

Process Specific

Name Trigger a New Task
Class Name XMBusinessActivityActions.Automate
DLL XMBusinessActivityActions.dll
Name Trigger a Pending Task
Class Name XMBusinessActivityActions.AutomatePending
DLL XMBusinessActivityActions.dll

Sample Jobs

Name Synchronize New Users
Trigger Customer created trigger to list/find new users to add to XMPro
Action
  1. Create User
  2. Activate User
Data Server.URL <WorkspaceURL>
Server.User Name <Service account recommended to be same as the service account for BAM service>
Server Password <Leave Empty for Windows authentication>
CreateUser.Business Group <Default XMPro Business Group to create new users in>
Name Synchronize Removed Users
Trigger Customer created trigger to list/find users to remove from XMPro
Action
  1. Deactivate User
  2. Unassign All Business Groups
Data Server.URL <WorkspaceURL>
Server.User Name <Service account recommended to be same as the service account for BAM service>
Server Password <Leave Empty for Windows authentication>
Groups.Except <Remove user from all XMPro business groups but this>
Name Synchronize User Information
Trigger Customer created trigger to find/list outdated user/s from XMPro
Action
  1. Update User
Data Server.URL <WorkspaceURL>
Server.User Name <Service account recommended to be same as the service account for BAM service>
Server Password <Leave Empty for Windows authentication>
Name Trigger a New Task
Trigger Customer created trigger to start a new process in XMPro
Action
  1. Trigger a New Task
Data Server.Url <WorkspaceURL>
Server.User Name <Service account recommended to be same as the service account for BAM service>
Server Password <Leave Empty for Windows authentication>
ActivityId <The Id of the First Activity to be triggered.>
TriggerName <The name of Command Option (Trigger) control that is to be triggered.>
<Control Name> <Any Controls for which values are to be populated before the trigger triggers. Can be left out or have multiples specified.>
Name Trigger a Pending Task
Trigger Customer created trigger to pending new process in XMPro
Action
  1. Trigger a Pending Task
Data Server.URL <WorkspaceURL>
Server.User Name <Service account recommended to be same as the service account for BAM service>
Server Password <Leave Empty for Windows authentication>
ActivityId <The Id of the Pending Activity to be triggered.>
TriggerName <The name of Command Option (Trigger) control that is to be triggered.>
<Control Name> <Any Controls for which values are to be populated before the trigger triggers. Can be left out or have multiples specified.>

Examples

Trigger

public class FindNewUsers : ITrigger
{
private string WorkspaceUrl;
private string WorkspaceUserName;
private string WorkspacePassword;
#region ITrigger Members
public Dictionary<string, object> GetContextTemplate()
{
Dictionary<string, object> context = new Dictionary<string, object>();
context.Add("Server.Url" , String.Empty);
context.Add("Server.User Name" , String.Empty);
context.Add("Server.Password" , String.Empty);
return context;
}
private void ParseContext(Dictionary<string, object> data)
{
this.WorkspaceUrl = data["Server.Url"] as String;
this.WorkspaceUserName = data["Server.User Name"] as String;
this.WorkspacePassword = data["Server.Password"] as String;
}
public bool Evaluate(ref Dictionary<string, object> data)
{
this.ParseContext(data);
DataTable newUsers = new DataTable("User");
newUsers.Columns.Add("User Name");
newUsers.Columns.Add("First Name");
newUsers.Columns.Add("Last Name");
newUsers.Columns.Add("Tel Work");
newUsers.Columns.Add("Tel Cell");
newUsers.Columns.Add("Email");
newUsers.Columns.Add("Role Description");
 
//The following loop is querying your system to find any new users that you wish to create within XMPro.
//It is left in this code base to illustrate how a new row is added to the data table to be passed to the Action.
foreach (PersonDetailsPerson User in this.getUsers())
{
}
 
data.Add("User", newUsers);
return newUsers.Rows.Count > 0;
}
private IEnumerable<PersonDetailsPerson> getUsers()
{
return GetMembersOfGroup();
}
#endregion
}

Action

public class FileWriter : IAction
{
private string _Name = "FileWriter";
private string OutputDirectory;
private string ObjectName;
public string DataFile
{
get
{
return this._Name + "Output.txt";
}
}
#region IAction Members
public Dictionary<string, object> GetContextTemplate()
{
Dictionary<string, object> context = new Dictionary<string, object>();
context.Add(this._Name + ".OutputDirectory", "");//File system path to write the file at.
context.Add(this._Name + ".ObjectName", "");//the specific object in Dictionary to be used for output, if not specified all will be written.
return context;
}
private void ParseContext(Dictionary<string, object> data)
{
this.OutputDirectory = data[this._Name + ".OutputDirectory"] as String;
this.ObjectName = data[this._Name + ".ObjectName"] as String;
}
public string Perform(ref Dictionary<string, object> data)
{
this.ParseContext(data);
foreach (var obj in data.Keys)
{
if (obj == this.ObjectName || String.IsNullOrWhiteSpace(this.ObjectName))
{
if (data[obj] != null)
{
StringBuilder sb = new StringBuilder();
sb.AppendLine(obj);
sb.AppendLine(DateTime.Now.ToString());
sb.AppendLine("------------------------------------------");
sb.AppendLine(this.SerializeObject(data[obj]));
sb.AppendLine();
File.AppendAllText(Path.Combine(this.OutputDirectory, this.DataFile), sb.ToString());
}
}
}
return "Action Performed.";
}
#endregion
private string SerializeObject(object toSerialize)
{
XmlSerializer xmlSerializer = new XmlSerializer(toSerialize.GetType());
using (StringWriter textWriter = new StringWriter())
{
xmlSerializer.Serialize(textWriter, toSerialize);
return textWriter.ToString();
}
}
}

This is the legacy version of the XMPro Documentation site. For the latest XMPro documentation, please visit documentation.xmpro.com

X