Custom attribute Of object

by Mr. Misha Akopov (2012-02-03) in group We Love BPM

 

Hi . I want to create  a custom attribute that depends on other attribute value.

For exapme object Person has attributes

salay

after_tax

 

if I enter salary 1000 , attribute after_tax should be calculated automaticly

for example 1000*some_tax_coeficient.


Comments

by Mr. Amol Patil (2012-02-03)

Hi Misha,

You can take help of Macros. Create a macro which runs on Attribute change event, which calculates the after_tax and saves in the attribute.

Thanks,

Amol Patil


by Mr. Misha Akopov (2012-02-03)

Hi Mr. Amol Patil

 

Thanks for replay, I hate macros because they slow down modelling process. The macro will be called every time designers change attribute value of all objects. And they are crazy about macro little icon appearing and waiting time (1 sec ) :))))

 

Maybe there is another solution ?


by Mr. Amol Patil (2012-02-03)

Hi Misha,

Yes I agree, calling a macro on Attribute change makes the process slow. Then you can do one thing, schedule a report, which does a search operation in database to collect all Person objects and calculates their after_tax value if the pre-existing value is not correct. Schedule this script on hourly basis, the script will run in background at server side to update the values. This might help you.

Thanks,

Amol Patil


by Mr. Sam Nguyen (2012-02-05)

Hi Misha,

Re your comment below:

"...The macro will be called every time designers change attribute value of all objects..."

This will not happen when you select the save model event as the trigger, which occurs only once when the model gets saved.

Regards,

Sam


by Mr. Misha Akopov (2012-02-06)

Mr. Amol Patil

 

 That's much better . but can you tell me how can I schedule a report ?

Mr. Sam Nguyen

Thanks for replay , I will try it, it sounds much better :)