Home Cireson Uploads
image


IT Monkey will place code here as examples of what Cireson's consulting team has to offer as well as examples for public consumption to benefit the Microsoft System Center community as a whole.

DISCLAIMER

All files and projects located here come as is and without any warranty or support. We will attempt to improve the projects as time goes on based on customer and community demand. Comments and improvements are welcome as well as customization requests. Your use of these Cireson Uploads is subject to our Terms of Use.


Cireson's support team has no information on these projects outside of what you have available and will not provide support for these enhancements, extensions, and scripts.

Dont forget to checkout solutions uploaded by our customers, partners and community members here.

Decision Engine

IT MonkeyIT Monkey O.G.
edited May 2016 in Cireson Uploads
What is the Cireson Decision Engine?

It’s a custom configuration for Service Manager 2012 R2 that allows you to utilize the built in Manual Activity class to make decisions within a workflow. These decisions will then determine the flow of the rest of the workflow or a sub tree of the workflow. Below is an example:

Before


After


In this example you can see that a decision was made in each of the Sequential Activities (SA) and then a new activity was created through the process of applying a pre-defined template to the activity based on the ‘Yes’ or ‘No’ decision.

An example scenario would be the process of determining if a machine was already deployed on a user’s desk. The analyst when then answer ‘No’ if it was not, and then new activities for ordering, receiving, and deploying would be created. If the answer was ‘Yes’ then the workflow may simply complete.

This process can also support a method of applying automation through runbook activities based on certain decisions. It is also possible to link the decision for the first decision to be made to the RO so that the end user can start the workflow off in a dynamic manner.

Installation

Installation consists of two phases, the Service Manager MP installation and then the Orchestrator monitoring installation. Total installation time is about 10 minutes for the average administrator.

Service Manager Installation

Install the following management packs into service manager through the administration > management packs, section:

Cireson Decision Engine Extensions
Cireson Decision Engine Configuration Library
Cireson Decision Engine Forms (Optional if using the Cireson Portal)

The below are optional but add functionality to either the console or the portal, or both.

Cireson Decision Engine Examples

Orchestrator Installation

On the orchestrator server create a new folder path for C:\CiresonFiles\Scripts and copy the CiresonDecisionEngineWorkflow.ps1 into the Scripts folder.

Create a new Runbook Folder called ‘Decision Engine’ (though technically it can be called anything) following whatever format you use to organize your runbook folders.

Select the folder and right click and select ‘import’

Browse to the location where you have saved the Cireson_Decision_Engine_Monitor.ois_export, select it and then import the Runbook.

Next create a Orchestrator variables for your SCSM Server Name.

Once imported select the Monitor MA for Decisions runbook and configure the activities in the runbook to work with your environment.

NOTE: You will need to configure each of the script activities, but only the variables at the top of the scripts. You will also need the SMLets installed and configured to run on the Orchestrator server (or all runbook servers if more than one)

Then start the monitor.

Cireson Portal Installation

The latest version of the Decision Engine also contains customizations for the Cireson Portal. These customizations add the decision box to any identified decision activities. These activities are recognized by whether the Template ID extension has a value for the activity. If the activity does have a decision required it will look like this on the form:

If it doesn’t have a decision required it will look like this:

To install these extension in the portal, open the ext_DecisionEngine.js file and read the instructions within the code. Basic instruction is to add the code in the JS file to the custom.js in the CustomSpace folder of the portal. If you already have some custom.js extensions, then you will need to add the function call in the JS file to your file in the appropriate place and add the function code to the bottom of the custom.js.

Configuration

Note: Currently the Decision Engine only supports Sequential Activity templates.

The only configuration that is required in SCSM is the creation of the proper templates.

A decision workflow template contains the following objects: A Service Request, a Sequential Activity, and a Manual Activity (it can also contain any other activities and activity types that you’d like).

Service Request – You will need to create a service request template with the Decision Template ID field (an extended field) filled in with a Template ID.

This service request template should also contain a Sequential Activity with one Manual Activity in it. The SA itself also needs a template ID, as does the MA. The template ID field is how the engine links all the pieces together to apply the correct template with your new activities.

For any sequential activity that will contain a decision activity and have new activities applied to it, the following should be true:

The Decision Template ID field should be filled in.
It should contain at least one Manual Activity to be used as a decision activity.

For any manual activity that will be a decision activity, the following should be true:

The Activity Decision field should be set to ‘Undecided’ in the template.
The MA should be the last activity in the sequence in the MA (the new activities will append to it)
The Decision Template ID field should be filled in.

We consider this Service Request template to be your baseline template. It can contain multiple decision activities within it.

The last piece of the Decision Engine configuration is the templates that are applied when a decision is made. These templates should created as a Sequential Activity template and should follow this naming convention:

{DecisionEngine}{SR Template ID}{SA Template ID}{MA Template ID}{Answer}

{DecisionEngine} – This should be in every template name that will be a decision template as this is how we filter and determine if the template is part of a decision activity workflow.

{SR Template ID} – This is the template ID text that you placed the Decision Template ID field in the Service Request template. It should be copied and pasted exactly as it was in the template.

{SA Template ID} – This is the template ID text that you placed in the Decision Template ID field of the SA inside your SR template OR inside your preceding SA template (it is possible to have nested decisions and decisions nested within other decisions)

{MA Template ID} – This is the template ID text that you placed in the Decision Template ID field of the MA inside your SR or SA template. You will often have a number of SA templates that use the same SA template ID but have many different MA template ID’s (see example below)

{Answer} – This will be Yes or No and will correspond to the Activity Decision dropdown in MA. This determines which template is applied depending on the answer.

Example Names

Example SA Template Configuration





 

Usage

When you complete a MA (Decision Activity) you simply need to select the appropriate answer and then click ‘OK’ *NOTE: Do not complete the activity!


After the engine runs it will identify the answer and complete the activity automatically after the appropriate template is applied successfully. If no template is found then the activity will NOT be completed and it will be treated like a normal MA. If the activity is completed before the MA runs (manually completed by the user) the decision engine will ignore it as it will only process ‘In Progress’ activities.

Best Practice

  1. When configuring multiple templates that are very similar, it is best to use the 'duplicate' functionality and then change only the child activities.
  2. There should be a 'Yes' and 'No' template for every activity, otherwise the workflow will not automatically complete the activity.
  3. Don't use spaces in the template ID, but instead use camel case to make the ID more readable.
  4. Any manual activity where an answer will be required, set the decision value in the template to 'Undecided' to better indicate it as a decision activity. You should also write the Title in the form of a question.
  5. For any activity where no decision is required, leave the decision value in the template blank

 

Trouble Shooting

  1. The template ID must match the value in the template name exactly (case doesn't matter)
  2. There should be a 'Yes' and 'No' template for every activity, otherwise the workflow will not automatically complete the activity.
  3. If the engine does not appear to be running verify your Orchestrator monitor is running, and that it is properly identifying the activity changes being made in SCSM.


Download the attached .zip file below.

Comments

  • KimMel_BriscoeKimMel_Briscoe Customer IT Monkey ✭

    SCSM Version: 2012 r2

    Good morning!

    I installed the Decision Engine.  I created the specified templates as stated in the instructions. When I create a Decision Engine SR, and choose the decision, the subsequent MAs are not added to the SA.  I tried duplication the example to no avail L.  I also realized my Orchestrator server did not have the SMLets module imported.  That was successfully done.

    I tried the SR with one MA added to the SA and with both MAs added. The first MA remains in ‘In Progress’ status.  I watch Runbook Designer to make sure it is going through the workflow and it does.  Below are the screen shots of my templates.  Am I missing something or doing something incorrectly?  Any help is greatly appreciated!

Sign In or Register to comment.