Configuring FSM Program Rules and Creation Timing

A rule distinguishes its type conditions from the records it produces. Project rules match the project type. Case rules match the case type, the resolved type of the linked project, or both. If both conditions are supplied, both must match. Every matching rule contributes work, so a broader rule can also apply alongside a more specific rule.

Project rules receive Project Type as the condition context. Case rules receive Case Type and the resolved type of the linked project. Additional mapped fields and related data are available to template tags. These values don't add arbitrary condition properties to the context. Program evaluates type conditions before resolving the output tags for a matching rule.

The following table lists rule properties, defaults, and effects.

Rule Area

Property or Default

Effect

Project rule conditions

project

Matches the project type. A mapping or template-data value doesn't automatically become another selection condition.

Project rule output

case

Case Type ID, or object containing type and supported case values.

Case rule conditions

case, project

Match the case type and the linked project type resolved through caseData.project.

Case rule output

task

Task Type ID, or object containing type and supported task values.

Both rule families

Integer offset (examples use zero or positive values) and positive integer interval

Omitted values use 0 and 1. Offset moves the first occurrence. The interval spaces later occurrences in the selected unit.

Project rules

unit: "day" or "month"

Month-based when omitted. Specify explicitly.

Case rules

unit: "day" or "month"

Day-based when omitted. Specify explicitly.

Project total

Positive count

No finite count limit when omitted, although the source date boundary still applies. Earlier occurrences excluded by Project Start Date still consume the count.

Case total

Positive count

One task when omitted.

Project create

Boolean value. Defaults to false when omitted.

true requests all planned missing cases when no rolling horizon applies. A value of false retains creation of the next required case.

Project shift

Boolean value. Defaults to false when omitted.

true shifts later unmatched planned dates using a matched case date difference. This date shifting is independent of create.

A rule output can be a single type ID or an object. For example, "case": 104 is equivalent to "case": {"type": 104}. Similarly, "task": 205 is equivalent to "task": {"type": 205}. Use the object form to supply additional supported destination values. If the output type is omitted, Program supplies no default Case Type or Task Type. Include the intended type ID from your account.

The following table lists properties excluded from condition matching.

Rule Family

Output and Pattern Properties

Project rules

case, offset, interval, total, unit, shift, create

Case rules

task, offset, interval, total, unit

In a project rule, case is the case output, not a Case Type condition. In a case rule, case is a condition and task is the task output. The create and shift properties control project rules and don't control case rules. For all-condition, alternative-value, and Boolean matching semantics, see Shared Rule Matching. Program uses every matching rule, whereas resource selection uses the first match.

For type conditions, one ID and an array are both valid: "project": 3, "project": [3], or "project": [3,4,5]. Omit a condition to leave it unrestricted. In a case rule, "project": true requires the resolved type of the linked project to be populated. The condition "project": false matches a missing resolved Project Type. These Boolean values don't test only whether the case's Company is a project. Selecting New Project doesn't supply the resolved type. That type becomes available after the project is created and linked. Use specific Project Type IDs when only those types should qualify.

The offset and interval properties use unit: "month" for calendar months or "day" for days. The default unit differs between project and case rules, so specify unit in examples. A project total counts occurrences from the pattern's anchor. It doesn't guarantee that the same number of cases will be created within the project dates. Don't use a count to bypass the required end boundary. A case total limits tasks for that rule. Omitted total means one task, rather than an unlimited series.

The first calculated case date is the project's pattern anchor plus offset. The first calculated task date is the case's Field Service Start Date plus offset. With the omitted offset of 0, each sequence starts on its respective anchor. Project occurrences before Project Start Date are excluded but still consume a finite total. The case's Field Service Start Date is the lower boundary for calculated task occurrences. The case's End Date doesn't cap that rule. A calculated task occurrence before the case start is excluded and still consumes the finite count. Program applies destination date outputs after the initial date selection, so output values can fall outside these boundaries. Project shifting is a separate effect. For more information, see Changing the Service Pattern and Creation Timing.

Emptying either rule array prevents those rules from contributing planned work. This change doesn't remove existing cases or tasks.

Note:

The worked examples contain illustrative type IDs, employee IDs, and custom field IDs. Replace these values with valid values from your account.

For example, plan six-monthly cases and one task per matching case:

          {
  "program": {
    "projectRules": [
      {
        "project": [
          103
        ],
        "case": {
          "type": 104
        },
        "unit": "month",
        "interval": 6,
        "total": 4
      }
    ],
    "caseRules": [
      {
        "case": [
          104
        ],
        "task": {
          "type": 205
        },
        "unit": "day",
        "offset": 0,
        "total": 1
      }
    ]
  }
} 

        

Type IDs 103, 104, and 205 are illustrative. Use the type IDs for projects, cases, and tasks from your account. These arrays replace their matching arrays, so include all required rules. The project still needs its type, Start Date, and End Date or usable rolling horizon. This topic defines the Program-specific maps, related-data defaults, and rules. For reusable mapping syntax, see FSM Searches and Field Mapping.

The case rule in this example applies to type 104 regardless of linked Project Type. Add the intended project condition when task generation depends on a particular linked project.

Changing the Service Pattern and Creation Timing

For alternating Minor and Major service every six months, give each type a twelve-month interval and offset the Major rule by six months. This illustrative replacement for program.projectRules uses Project Type 46, Minor Case Type 27, and Major Case Type 28:

            {
  "program": {
    "projectRules": [
      {
        "project": [46],
        "unit": "month",
        "interval": 12,
        "offset": 0,
        "create": true,
        "case": {
          "type": 27,
          "details": "${project.comments}",
          "custevent_nxc_department": "${project.department}",
          "assigned": 5
        }
      },
      {
        "project": [46],
        "unit": "month",
        "interval": 12,
        "offset": 6,
        "create": true,
        "case": {
          "type": 28,
          "details": "${project.comments}",
          "custevent_nxc_department": "${project.department}",
          "assigned": 5
        }
      }
    ]
  }
} 

          

The custom department field and employee ID 5 are account-specific examples. Use a compatible case department field and the intended employee in the account. The offsets establish the sequence. Changing the order of the rules alone doesn't change their dates. Set Project Start Date to January 1, 2026, with no separate Program Start Date. Minor first occurs on January 1, and Major on July 1. Set Program Start Date to December 10, 2025 to preserve the earlier pattern. The Minor occurrence before the project Start Date is omitted. The first included occurrences are Major on June 10, 2026, and Minor on December 10, 2026. With a finite total, that omitted earlier Minor still consumes an occurrence. For information about the other date examples and bounds, see FSM Program.

The following table compares creation timing options.

Desired Timing

Setting Combination

Consequence

Next required case

When no rolling horizon applies, omit create or set it to false.

Selects the first planned row without an end date. Creates a case only if that row has no matched case. A matched case without Field Service End Date prevents progression.

Advance creation

Set a positive Program Create Until on the project.

Additional missing cases at or before the rolling horizon qualify for creation. This horizon takes precedence over create for advance creation.

All planned cases

When no rolling horizon applies, set create: true.

Requests all missing cases in the calculated schedule through its applicable date and count boundaries.

When Project End Date and a rolling horizon are both present, End Date limits the initial calculated pattern. The horizon selects additional missing cases for advance creation. Next required case selection can select a missing row beyond that horizon if the row remains in the calculated pattern. Program recalculates the horizon during assessment. Passing time alone doesn't guarantee another execution.

For a next required case pattern, set shift: true to move later unmatched dates relative to a matched case. Program uses the difference between the case's planned date and its Field Service End Date. If no end date exists, Program uses the case's start date instead. For example, a pattern repeats every six months, with planned dates of January 1 and July 1. An actual end date of February 7 can move the unmatched July date to August 7. The shifting calculation is independent of create and doesn't reschedule matched existing cases. Shifted dates and configured output dates can fall outside the initial project date bounds.

Additional Information

Related Topics

General Notices