How do I increment an attribute of an entity?

13 Nov '13, 10:06 PM
2,508 Views
No Forum Badges

Hi, I want to increment an attribute of an entity by clicking at a link, but I don't know do I plus one to it before I modifie the entity with the new value. Someone can help me?

 
x 0
Follow
Answer Answer at this question and get points!
Forum Expert - Level 5

Hi,

to increment an attribute of an entity you can use a Math Component, you can refer to the article of the knowledge base http://wiki.webratio.com:8081/knowledgebase/article/How-to-use-Math-Unit.

Otherwise, you can use a groovy script where you plus one to a previous value, you can refer to the article of the knowledge base http://wiki.webratio.com:8081/knowledgebase/article/Getting-started-with-the-Script-unit.

   
x 0
Forum Starter - Level 2

I think it's better to put a Query unit/component with update sql query like: "update entity set attr = attr+1 where oid = :oid" passing oid as input parameter.

 
x 0
Answer at this question and get points!