# Implementing the Child over 3 years old is free promotion step

## Creating the rule

Create a new Guided Rule that you call YougestUnder3yearsOldFree

then Add a new Constraint

![](/files/-M-FWc1-aWaHAaIVJlkn)

![](/files/-M-FWc111M68SoYNXsJp)

Select the List class. Click on the "There is a list.." and the click on the Expression Builder button

![](/files/-M-FWc13YXlynpq34uFu)

on the first "Choose" select the size() function and on the second "greater than"

![](/files/-M-FWc15sJ8A1djSCXEP)

Then click on the pencil ![](/files/-M-FWc17ZCDSKhnQ3fhp) Click on the "From Collect" link and then chose the person fact type

![](/files/-M-FWc19sPK7gSHfTro7)

![](/files/-M-FWc1B0eRAbUYttBLH)

Then click on the "All Person with" link and select the age attribute and add the following constraint.

![](/files/-M-FWc1Dne0lwggf1MAQ)

Then Add a new constraint of type Accumulate

![](/files/-M-FWc1FbAprmS3tzSbD)

And select the Number type from the add a pattern link.

![](/files/-M-FWc1HQMKIpWr_TS-P)

Then make the rule look like this

![](/files/-M-FWc1JKCxPAZRr6wkB)

## Creating rule to insert a period

![](/files/-M-FWc1LphV0MrAaZqyP)

Create a drl file with the following content

![](/files/-M-FWc1NYIhzSU5WyD2k)

## Creating rule to start a process

To be able to start a process from a test scenario, we want to insert an object and set a attribute that would be the process id we want to start. So we first create a new Item of type Data Obkect that we shall call StartProcess. And we should add a field called procesId of type String

![](/files/-M-FWc1PDbDlF9XcMzpC)

Then we shall create a guided rule called StartProcessRule as follows. In the Then add free form drl ![](/files/-M-FWc1RTj3mve7vQEMv)

![](/files/-M-FWc1T-uT85gF0rNsX)

## Testing the rule

Create the test scenario by inserting Objects like follows.

![](/files/-M-FWc1V2TCeBfBsa_3F)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://nicolas-heron.gitbook.io/droolsonboarding/brms/implementation_the_promotion_step.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
