Actually, il have to use this List<Event> in another class and then print
list<Event> after every rule execution cycle.
On Mon, Mar 10, 2014 at 4:05 PM, Mauricio Salatino <salaboy(a)gmail.com>wrote:
Can you please elaborate about why do you want to do that? what's
the
point of having a list inside of the Event class that will contain the same
event?
The "Then" side of the rule is pure java.. so you just do
event.getEvents().add(event);
but I don't see the point of doing that.
Regards
On Mon, Mar 10, 2014 at 10:31 AM, Sandhya Sree <sandhyachinnaraj(a)gmail.com
> wrote:
> hi ,
>
> i have a class called Event which is as follows:
>
> public class Event {
> private String name;
> private File source;
> private Date timeStamp;
> public static List<Event> listOfEvents;
>
> public Event(String name, File source, Date timeStamp) {
> this.name = name;
> this.source = source;
> this.timeStamp = timeStamp;
> }
> public String getName() {
> return name;
> }
> public void setName(String name) {
> this.name = name;
> }
> public File getSource() {
> return source;
> }
> public void setSource(File source) {
> this.source = source;
> }
> public Date getTimeStamp() {
> return timeStamp;
> }
> public void setTimeStamp(Date timeStamp) {
> this.timeStamp = timeStamp;
> }
>
>
> public void display()
> {
> System.out.println(name +" " + "in folder: " + source + "
on " +
> timeStamp );
> }
>
>
>
> there are also some other classes associated with my project.. i have a
> rules file which computes the size of a folder and creates an object of
> Event class. every time this object of Event class is created i wwant to
> put it in a List<Event>.. how can i do this..
>
> my rules is as follows:
>
> rule "size"
> when
> $p: RuleContext($size: getOldContext().getParent().getUsableSpace() >
> (30*1024*1024))
>
> then
> Event event = new Event("folder almost full",
> $p.getOldContext().getParent(), new Date());
> event.display();
> ......here i want to put this event into the List<Event> declared in
> Event Class.....
>
> end
>
>
>
> thanks,
> Sandhya
>
> _______________________________________________
> rules-users mailing list
> rules-users(a)lists.jboss.org
>
https://lists.jboss.org/mailman/listinfo/rules-users
>
--
- MyJourney @
http://salaboy.com <
http://salaboy.wordpress.com>
- Co-Founder @
http://www.jugargentina.org
- Co-Founder @
http://www.jbug.com.ar
- Salatino "Salaboy" Mauricio -
_______________________________________________
rules-users mailing list
rules-users(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users