>>i need to do the assert only in case the variable ?distance is equals to 1
(one)

Hi Lucia,

This should work...

(defrule generate_outside_execution_relations
    "comment"
    (call (call_id ?call_1) (caller_id ?method_X)
          (callee_id ?method_Y) (precedence ?precedence_1))
    (call (call_id ?call_2) (caller_id ?method_X)
          (callee_id ?method_Z) (precedence ?precedence_2))
    =>
    (bind ?distance (- ?precedence_2 ?precedence_1))
    (if (= ?distance 1) then
       (assert
            (outside_execution_relation
                 (call_id ?call_1)
                 (call_id2 ?call_2)
                 (distance ?distance)))))

Cheers,
Jason

Reply via email to