You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Looking at the examples, I realized that the rules are created and executed within a function. The variables of the rules are passed as input to the function. How can I separate the creation of Rules and Execution of rules. I want to have a set of library of Rules design for my flows and then use them in the project as per the need. This is what I am trying to do and its not working...The Rule in the Demo function is not executed.
class Test_Controller extends CI_Controller
{
public function demo()
{
echo "demo";
$rb = new RuleBuilder;
$rule = $rb->create(
$rb->logicalAnd(
$rb['minNumPeople']->lessThanOrEqualTo($rb['actualNumPeople']),
$rb['maxNumPeople']->greaterThanOrEqualTo($rb['actualNumPeople'])
),
function() {
echo 'YAY!';
}
);
}
public function test()
{
$context = new Context(array(
'minNumPeople' => 5,
'maxNumPeople' => 25,
'actualNumPeople' => function() {
return 6;
},
));
//echo "test";
$rule->execute($context);
}
}
Thanks.
The text was updated successfully, but these errors were encountered:
Looking at the examples, I realized that the rules are created and executed within a function. The variables of the rules are passed as input to the function. How can I separate the creation of Rules and Execution of rules. I want to have a set of library of Rules design for my flows and then use them in the project as per the need. This is what I am trying to do and its not working...The Rule in the Demo function is not executed.
class Test_Controller extends CI_Controller
{
public function demo()
{
echo "demo";
$rb = new RuleBuilder;
$rule = $rb->create(
$rb->logicalAnd(
$rb['minNumPeople']->lessThanOrEqualTo($rb['actualNumPeople']),
$rb['maxNumPeople']->greaterThanOrEqualTo($rb['actualNumPeople'])
),
function() {
echo 'YAY!';
}
);
}
}
Thanks.
The text was updated successfully, but these errors were encountered: