cancel
Showing results for 
Search instead for 
Did you mean: 

Update Aspect property in a Javascript controller

mduduzi
Confirmed Champ
Confirmed Champ
Hi,

I have a custom aspect with one property, that is attached to a person object. The property is of type a boolean type. On a controller I check if the property exists on the initiator of an workflow and if does I update the property of that aspect. Please see the snippet below:

if (!initiator.hasAspect("alvexoc:orgchartMember"))
{
   initiator.addAspect("alvexoc:orgchartMember");
   initiator.properties["alvexoc:outOfOffice"]=true;
}
else
{
   initiator.properties["alvexoc:outOfOffice"]=true;
}   


Is the above possible in a javascript controller?
Thanks!
2 REPLIES 2

kbonnet
Champ in-the-making
Champ in-the-making
I think you forgot initiator.save() to save your update?

Koen

Thnks for the response. But for some reason the part that fails is updating the property but checking the existance of the aspect and attaching it is not a problem. I have decided to call a script instead of putting it inside the bpm xml.