Create Rules

The ActionHub/ActionFlow platforms are rule-based, so the first thing you must do is create rules to invoke action based on your processes. A few examples of rules to drive process include invoking a build job in Jenkins based on a commit message to a specific branch in a repository, invoking a workflow in CollabNet ActionFlow to deploy a build based on a successful build message from a Jenkins job, and opening a defect in a project based on a health event from a monitoring tool like New Relic.

You can create simple rules that check for one particular condition or complex nested rules that have more than one condition to check.
  1. Log on to TeamForge and select a project from the Menu.
  2. From the TeamForge tools menu, choose Project Home > ActionHub or Project Home > ActionFlow. The Rules page appears.
  3. In the Rules section, click Create. The Create Rule page appears.
  4. In the Rule Name field, enter the name given to the rule that will be displayed in the rules list and in notifications generated by the rule.

    Enter meaningful attributes into this field to describe what the rule does. This will make it easier to understand in lists and notifications.

  5. For the Rule Enabled option, click the checkbox to enable or disable the rule. Disabling a rule prevents it from being processed by the ActionHub rules engine.
  6. In the Rule Description field, enter a detailed description describing the purpose of the rule.

    Include as much detail as possible to help another person understand the rule. For example, the description may include details about the parameters defined for the action on the target system.

  7. Click Source, select the source from where the event will be generated and click Save.

    The SOURCE page shows a list of all sources defined in TeamForge EventQ. These source systems generate events which may match the rule being defined. Selecting the source also tells the editor the type of event generated by the system such as commit, workitem, build, deploy, review, health and more. This allows the editor to understand the format of the message and make it easy to create the criteria for the rule.

  8. In the Criteria field, define the criteria for what events should match the rule.
    When a rule is first created it has a default criteria of Matches Any condition. This means it will match any event generated by the source system. To modify the condition, click the Matches Any link and select Edit Condition from the menu. The Add Condition dialog box appears allowing you to modify the condition.
    1. Select a message property that should be evaluated.

      The Property list displays a list of all properties defined for the message type specified by the Source system. For example, a source control system will show properties for a commit message. A tracker system will show properties for a work item message.

    2. From the Operator list, select the operator that will determine how the property will be evaluated.
    3. In the Value field, specify the value to evaluate against the property.
    4. Click Save.

    Creating nested criteria

    If you want to create a criteria that evaluates more than one condition such as (work_item.created_by Contains user123 AND work_item.updated_by Contains userQA) OR (work_item.status_id Equals Ready for Deploy), you can create a nested criteria as follows.

    To create a rule that checks for more than one condition, click the Matches Any link and select Convert to Group from the shortcut-menu.
    You now have two "Matches Any" conditions linked together by an "AND" operator. You can toggle between "AND" and "OR" operators by clicking the "AND" or "OR" operator.

    Now, you can modify the conditions by clicking the Matches Any link and selecting Edit Condition from the menu. The Add Condition dialog box appears allowing you to modify the condition.

    Click Add New to add (nest) more conditions.

  9. From the TARGET drop-down list, select the target system.

    The TARGET drop-down list shows a list of all target workflow systems. Selecting a target system populates the ACTION drop-down with actions available for the event type defined by the Source system.

  10. From the Action drop-down list, select the action to take for the defined event.

    The Action drop-down list shows all available actions on the target workflow system based on the event type of the Source system. Selecting an action populates the PARAMETERS table with all the available parameters for the action. Refer to the documentation for the action in the target workflow system for purpose of each parameter. If the selected action requires input, the PARAMETERS table will be populated with the required parameters.

  11. In the PARAMETERS table, specify the appropriate value for each parameter. Since each action is different, refer to the documentation for the action in the target workflow system for the purpose of each input parameter.
  12. Click Save. The new rule is created.

    Create as many rules you want. You can now go to the Rule Execution History tab (Project Home > ActionHub) to view the history of rules that are executed.

Create and execute a Manual Rule

The Manual Rule feature allows you to create rules that will be manually executed on demand from the Release Console page.

  1. From the Project Home menu, choose ActionHub.
  2. Click the Create Rule button.
  3. Enter all appropriate informaiton about the rule you wish to create while choosing <Button Click> (Manual) from the Source list.
  4. In the Rule Parameters section, enter the Environment ID corresponding with the environment that packages should be deployed to when this rule is executed.
  5. On the Release Console page, select the radio button next to the package you want to execute a Manual Rule for.
  6. Click the button corresponding to the Manual Rule that you would like to execute.

Audit information for rules

Within ActionHub, you can view a rule's general information, scope, change log and the rule execution history.

  1. From the Project Home menu, choose ActionHub and select a rule.
    General tab: View general rule information.
    Scope tab: View the scope of the rule.
    Execution History tab: Lists the rule execution history.

    Change Log tab: Shows the change log for a rule.