<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Compare Selected User with Current User in Alfresco Forum</title>
    <link>https://connect.hyland.com/t5/alfresco-forum/compare-selected-user-with-current-user/m-p/37295#M15700</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;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.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A manager should be able to request special permissions on behalf of someone else, and then not have to approve this request.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How do I compare the User selected in the "People" form item to the user produced by userInfoBean.getCurrentUser()?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is my Java Code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;//Establish request_originator&lt;/P&gt;&lt;P&gt;var currentUser =&amp;nbsp;userInfoBean.getCurrentUser()&lt;BR /&gt;execution.setVariable('request_originator', currentUser);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//Compare to selected manager&lt;/P&gt;&lt;P&gt;var originatorIsManager = 'foobar'&lt;BR /&gt;if(currentUser.equals(execution.getVariable('manager_of_requested_for'))){&lt;BR /&gt; originatorIsManager = 'yes';&lt;BR /&gt;} else {&lt;BR /&gt; originatorIsManager = 'no';&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;execution.setVariable('originator_is_manager', originatorIsManager);&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;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."&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 19 Jul 2017 13:45:00 GMT</pubDate>
    <dc:creator>gbanks</dc:creator>
    <dc:date>2017-07-19T13:45:00Z</dc:date>
    <item>
      <title>Compare Selected User with Current User</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/compare-selected-user-with-current-user/m-p/37295#M15700</link>
      <description>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,</description>
      <pubDate>Wed, 19 Jul 2017 13:45:00 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/compare-selected-user-with-current-user/m-p/37295#M15700</guid>
      <dc:creator>gbanks</dc:creator>
      <dc:date>2017-07-19T13:45:00Z</dc:date>
    </item>
    <item>
      <title>Re: Compare Selected User with Current User</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/compare-selected-user-with-current-user/m-p/37296#M15701</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;Since you are comparing execution.getVariable('manager_of_requested_for') which will be the "ID" of manager_of_requested_for, you need to get currentUser's ID for the comparison. Set&amp;nbsp;&lt;SPAN&gt;currentUser&lt;/SPAN&gt;&amp;nbsp;as below&lt;BR /&gt;var currentUser = userInfoBean.getCurrentUser().getId()&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Jul 2017 14:21:37 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/compare-selected-user-with-current-user/m-p/37296#M15701</guid>
      <dc:creator>cjose</dc:creator>
      <dc:date>2017-07-20T14:21:37Z</dc:date>
    </item>
  </channel>
</rss>

