Custom evaluator to perform basic calculations on custom properties

cancel
Showing results for 
Search instead for 
Did you mean: 
zputnoky
Established Member

Custom evaluator to perform basic calculations on custom properties

Dear All,

Got a new user demand to provide custom indicator based on property values. Do I need to create a custom evaluator java class to be able to do the following?

  • display indicator A if property A value is 1
  • display indicator B if current system date is less than approval target date and the difference is less or equal to X
  • display indicator C if current system date is beyond or equal to approval target date and property A value is 0

Regards,

Zsolt Putnoky

2 Replies
angelborroy
Alfresco Employee

Re: Custom evaluator to perform basic calculations on custom properties

zputnoky
Established Member

Re: Custom evaluator to perform basic calculations on custom properties

Hi Angel,

Thanks alot, will have a look. In the meantime I hacked the following - quick and dirty to test

  • created two dummy, hidden properties, these properties are not shown on the form and populated by a script
  • created a JS file which does the checks and does the date calculation
  • based on the result, the scripts sets one of the property to 1 and the other to null
  • created a simple evaluator based on the PropertyNotNull standard one
  • displaying the indicator based on the result of the evaluators

the solution is not elegant but it allows us to test how it works. Plus, just checked how to set up Eclipse to work with Alfresco, looked so complicated to a non developer, that I decided to hack something as proof of concept