AnsweredAssumed Answered

Compare Selected User with Current User

Question asked by gbanks on Jul 19, 2017
Latest reply on Jul 20, 2017 by cjose

We have a workflow where users may request access to various programs external to Activiti. The request must then be approved by that individual's manager, who is specified in the request using the "People" form item.

 

A manager should be able to request special permissions on behalf of someone else, and then not have to approve this request. 

 

How do I compare the User selected in the "People" form item to the user produced by userInfoBean.getCurrentUser()?

 

This is my Java Code:

 

//Establish request_originator

var currentUser = userInfoBean.getCurrentUser()
execution.setVariable('request_originator', currentUser);

 

//Compare to selected manager

var originatorIsManager = 'foobar'
if(currentUser.equals(execution.getVariable('manager_of_requested_for'))){
originatorIsManager = 'yes';
} else {
originatorIsManager = 'no';
}

execution.setVariable('originator_is_manager', originatorIsManager);

 

See the attached image, where I display the values being returned by my Variable and the Form Field. They are identical, but my comparison is still being returned as "no."

 

Thank you.

Attachments

Outcomes