June 18, 2012

Fetch Email of users whom tasks has been assigned in bonita using bonita runtime and identity API

Following is the code snippet, through which, we can fetch users lists with emails of assigned one:

import org.ow2.bonita.util.AccessorUtil
 def candidates = AccessorUtil.getQueryRuntimeAPI().getTaskCandidates
(activityInstance.getUUID())
 def to=""
 for(user in candidates){
 if(to!="") to+=","
 // If Emails are not stored in Bonita User Experience, 
//please adapt the next line to get email from your system
 to+=AccessorUtil.getIdentityAPI().getUser(user).getEmail()
 }
 return to

1 comment:

  1. can u please tell me where to place the above code within bonita ?

    ReplyDelete