GenericQueryClass AllUpdateTimes isA TransactionTime with parameter object: Proposition constraint alltimes: $ exists a/Attribute n/Label y/Proposition Pa(a,~object,n,y) and Known(a,~this) $ end { Example on using Timestamps with ECArules } { See User Manual for details. } { The createdOn attribute contains the time when the } { employee was inserted in the object base. } { The lastModified attribute contains the time, } { when the salary was changed. } Class Employee with attribute salary : Integer; createdOn : TransactionTime; lastModified : String rule createdOnRule : $ forall t/TransactionTime Known(this,t) ==> (this createdOn t) $ end { ECArule for updating the last modified attribute } ECArule LastModified_Employee_salary_1 with ecarule er : $ t1,t2/TransactionTime y/Employee i/Integer es/Employee!salary lab/Proposition ON Tell(A(y,salary,i)) IF A(y,lastModified,t1) and `In(es,Employee!salary) and `P(es,y,lab,i) and `Known(es,t2) DO Untell(A(y,lastModified,t1)), Tell(A(y,lastModified,t2)) ELSE Ask(new(In(es,Employee!salary))), Ask(new(P(es,y,lab,i))), Ask(new(Known(es,t2))), Tell(A(y,lastModified,t2)) $ end