Uploaded image for project: 'JBRULES'
  1. JBRULES
  2. JBRULES-3704

Unable to set value to @expire tag dynamically

This issue belongs to an archived project. You can view it, but you can't modify it. Learn more

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Major
    • None
    • 5.5.0.Final
    • drools-core
    • Hide

      drl file contains

      declare Student
      @role(event)
      @expires(1m)
      end

      declare OrderScheduled
      @role(event)
      @timestamp(timestamp)
      end

      rule 'Schedule Order - order id 123'
      dialect "mvel"
      when
      $created:OrderCreated($orderId:orderId,$timestamp:timestamp ) from entry-point "time stream"
      not Student() from entry-point "time stream"
      then
      System.out.println("Student Event expire at "+new Date());
      end

      I am inserting both OrderScheduled and Student facts .After 1 minute Student Event expires and rule fired.Its working fine.

      My problem is i want to add expire time dynamically.

      If we could set this expiration time dynamically for each event then that would be helpful us to go with this approach. pls provide me the solution .

      Thanks in advance

      Show
      drl file contains declare Student @role(event) @expires(1m) end declare OrderScheduled @role(event) @timestamp(timestamp) end rule 'Schedule Order - order id 123' dialect "mvel" when $created:OrderCreated($orderId:orderId,$timestamp:timestamp ) from entry-point "time stream" not Student() from entry-point "time stream" then System.out.println("Student Event expire at "+new Date()); end I am inserting both OrderScheduled and Student facts .After 1 minute Student Event expires and rule fired.Its working fine. My problem is i want to add expire time dynamically. If we could set this expiration time dynamically for each event then that would be helpful us to go with this approach. pls provide me the solution . Thanks in advance

    Description

      declare Student
      @role(event)
      @expires(1m)
      end

      This way I used @expires tag in Rules from drl file for expiration of Student fact after 1minute.
      Now I want to set the @expires time value dynamically for Student fact, How can i achieve this ?

      Please provide me a solution.

      Attachments

        Activity

          People

            mproctor@redhat.com Mark Proctor
            ramakrishnav_jira Rakesh m v (Inactive)
            Archiver:
            rhn-support-ceverson Clark Everson

            Dates

              Created:
              Updated:
              Archived:

              Time Tracking

                Estimated:
                Original Estimate - 3 days
                3d
                Remaining:
                Remaining Estimate - 3 days
                3d
                Logged:
                Time Spent - Not Specified
                Not Specified

                PagerDuty