Troubleshooting the Business Rule Monitor

This chapter covers the following topics:

Troubleshooting Tips

If you are having difficulties using the Business Rule Monitor after implementing it, verify the following:

General Tips for Defining Rules

The following suggestions are helpful when defining rules in the BRM:

Stopping the Business Rule Monitor

Some patches for CRM Foundation require the Business Rule Monitor to be stopped before the patch can continue. You can tell if the Business Rule Monitor is running by entering the CRM Administrator responsibility and navigating to Business Rule Monitor > Business Rule Monitor - this invokes the Control Panel. The Status field will show 'Active' or 'Stopping' if the Business Rule Monitor is in a running state.

To stop the Business Rule Monitor press the 'Stop' button on the Business Rule Monitor Control Panel. Note that the workflow background process for the 'Business Rule Monitor Main Process' workflow should be running in order for the 'Stop' command to be processed.

If the Business Rule Monitor Control Panel shows a status of 'Stopping' for an unusually long period of time, this is normally caused by the workflow background process not being running at the time the 'Stop' button is pressed. To start the workflow background process perform the following steps:

Steps

  1. Select System Administrator responsibility from the Requests menu option.

  2. Select Run.

  3. Run a Single Request.

    1. The name is Workflow Background Process.

    2. The item type is Business Rule Monitor Main Process

    3. Leave min and max threshold blank.

    4. Process deferred to Yes.

    5. Process timeout to Yes.

  4. Click OK.

  5. Select the Schedule button.

  6. Select Periodically.

  7. Enter an end date and time of 15 minutes later.

  8. Re-run every three minutes.

  9. From Completion of the prior run, click OK.

  10. Select Submit.

  11. Note that if your Business Rule Monitor main process is running every 30 minutes, for example, then you will need to extend the end time of the background process so that it is still running the next time the BRM process checks for instructions.

  12. You then need to wait for the BRM to do its next run so that it will process the 'STOP' command, then the status should show 'Complete' and you can continue with the patch.

  13. You should not comment out this script and continue with the patch as this will leave your system in an undefined state.

  14. If for some reason the main BRM workflow will not process the 'STOP' command then you will need to abort the process from within the Workflow Monitor. To do this:

    1. Find the error notification for itemkey JTFBRM and the process ID that is shown on the BRM control screen: these notifications are usually sent to the SYSADMIN user.

    2. View the notification for this process.

    3. At the bottom of the screen there is a poplist from where you choose what you want to happen next, select Abort.

    4. After a short while the process should stop.

Answers to Frequently Asked Questions (FAQs)

The following are frequently asked questions. Answers to these questions may help you in troubleshooting problems with the Business Rule Monitor.

What is the relationship between the following "Time Related Features"?

Answer: In Business Rule Monitor (BRM), you have the option to select how often (in <<Interval>> Field) you want the BRM to check the rules noted in Business Rule Workbench (BRW).

In BRW, you have option to select how often (in <<Check Rule Every>>, <<Tolerate Condition For>> Fields) you want the BRM to check the rule noted here.

In Workflow background process (WBP), you have option to select how often you want to run the workflow background process.

How Are The Parameters Discussed In Step 1 Related?

For example, you can set five minutes as the Interval in BRM, set one minute in Check Rule Every in BRW for one of the rules AND only run the Workflow background process every DAY, then what will happen?

What is the point of reference for time in the BRM? If it is run at 12:00 PM, and started at 12:05 PM, will the BRM continue to check every five minutes until a specified time?

Answer: Be realistic when setting the time intervals as there is no cross-referencing between them, so all times are independent of each other.

In the example of having the BRM run every five minutes, the BR check every minute and the WBP run once a day, then the BRM will run once when the WBP 24-hour anniversary occurs each day. The checking of the actual BR will depend on when its WBP is next run after the BRM has run. The Workflow processes cannot do anything unless the WBP associated with that process is executed, so the timing of the BRM is dependant on when the WBP runs.

The point of reference for the BRM is when the 'Start' button was pressed in the Control screen. So if it is started at 12.00 pm to run every five minutes, then it will check at 12.00 pm, then at 12.05 pm, until the 'Stop' button is pressed OR until the WBP stops repeating. However, this is dependent on when the WBP is run for the BRM Main Process. If the WBP is run from 12.00 pm every one minute then the above will hold true. However, if it is run every two minutes then it will only check at 12.02 pm, 12:04 pm, 12:06 pm, and so forth, so the 12:05 pm run of the BRM will be delayed by a minute.

For each BR the timing is taken from when the last iteration of that BR occurred. This is affected also by the timing of the WBP for that individual BR Process, in the same way as the main BRM as explained above, plus the timing of the main BRM run and how it coincides with the timing of each BR check.

Can You Stop the Notifications From Repeating?

Once the conditions set in a Business Rule are met, then the notifications are sent continuously. Is this the intended functionality? Do you have the option to have a flag to indicate that only one notification should be sent?

Answer: If you choose to send a notification or create a Task, then that will happen each time the BR is checked if the condition is still true. This is as designed, you should set the BR interval to how often you want the notification to be sent. If you want to send the notification only once then you can either customize the Escalation Activity code to do that, or raise it as an Enhancement Request which will be considered for a future release.

Can You Expand the Fields Available From The 3D View?

In the BRW, you are limited to fields in the CS_BRM_3D_SERVICE_REQUEST_V view. For example, there is no problem code field in CS_BRM_3D_SERVICE_REQUEST_V. Is there an option to use fields from other tables or views?

Answer: The seeded 3D view makes available the fields that you see on the Service Request UI that are audited. You only use the fields that are audited because this is how you are able to detect how the values have changed over time. If you need additional fields then you can use the 'Complex' style of rule definition to specify these in standard SQL format.

How Do You Control Who Receives the Workflow Notifications?

When defining business rules, you have the ability to associate a Workflow process with each business rule. It is the Workflow process that generates the notifications.

The client can view the definition of these seeded workflow processes in the Workflow builder, however, it is not clear as to how the process determines whom the notifications should be sent to. For example, in the Workflow Builder, viewing the process definition of "Escalate a Service Request (notification only)", it has a notification activity called "Object Conformed to a Rule" which sends a notification to a role defined in the "Notification Person" item attribute.

What is the default behavior of this workflow process? What is the hierarchy of criteria that the system uses to determine who to notify?

Answer: Select the button labelled "..." which is next to the Workflow LOV. This brings up the Workflow Attributes window, and from there you can select a value for each of the attributes for that specific Workflow process. For example, for the notification workflow you can choose the Notification Role, which is the role of the (in relation to the object, i.e. Service Request) who you want the notification to go to. The options are:

The default setting is Business Owner, which is the owner of the Business Rule. If an individual resource cannot be identified programmatically for any reason, then the notification will always default to Business Owner.

Where Can I View the Workflow Process Launched by the BRM?

I want to see if anything is happening for the rule I created which has six records in the database that have matched criteria. I completed all the necessary preliminary set ups to get the BRM running.

Answer: Perform the following steps.

  1. First check that the rule will actually return the records that you think it should. Do this by going to the Complex tab in the rule definition and copy the text into SQL*Plus. If it returns rows, then the rule is fine, if not then re-examine your rule. Start simply, such as 'Task Number' = '12345'.

  2. If rows are returned, then next look at the Workflow processes using the Workflow Monitor. Ensure that the SYSADMIN user has 'Workflow' responsibility attached, then connect to Applications as SYSADMIN through the PHP login for the instance that you are using.

  3. Under the heading 'Self Service', click Workflow.

  4. At the next page click View Progress.

  5. In 'Item Type' choose the name of the Workflow process that you believe should be invoked for your rule. For example, any of the Task seeded Workflow processes would use 'Business Rule Monitor Task Process'.

  6. Click Find. All of the Workflow processes that have been started in that instance will be displayed. Drill down into the details of each process.

  7. If there are none, there can be a problem with the main BRM Workflow. You can look at its progress using the same method, but select Business Rule Monitor Main Process.

It could be that there is a problem with the Workflow you are using, so again it is suggested that you try the simplest case first so that you can see it working. Try using the "Escalate a Task - send a Notification" seeded Workflow and have the notification sent to the Business Rule Owner or the Document Owner.