<?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 Java Enum while evaluating conditions in JUEL in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/java-enum-while-evaluating-conditions-in-juel/m-p/41375#M22143</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Is it possible to use java enum while evaluating conditions in JUEL? &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;e.g.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I want to&amp;nbsp; choose route from exclusive gateway based on state of process entity, where state is java enum. Comparison fails cause enum class is not visible in JUEL expression.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;${entity.getState() == JavaEnum.STATE1}&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I hope I made it clear&amp;nbsp; &lt;img id="smileywink" class="emoticon emoticon-smileywink" src="https://connect.hyland.com/i/smilies/16x16_smiley-wink.png" alt="Smiley Wink" title="Smiley Wink" /&gt;&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 23 Mar 2011 12:01:21 GMT</pubDate>
    <dc:creator>mlisiewicz</dc:creator>
    <dc:date>2011-03-23T12:01:21Z</dc:date>
    <item>
      <title>Java Enum while evaluating conditions in JUEL</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/java-enum-while-evaluating-conditions-in-juel/m-p/41375#M22143</link>
      <description>Is it possible to use java enum while evaluating conditions in JUEL? e.g.I want to&amp;nbsp; choose route from exclusive gateway based on state of process entity, where state is java enum. Comparison fails cause enum class is not visible in JUEL expression.${entity.getState() == JavaEnum.STATE1}I hope I made</description>
      <pubDate>Wed, 23 Mar 2011 12:01:21 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/java-enum-while-evaluating-conditions-in-juel/m-p/41375#M22143</guid>
      <dc:creator>mlisiewicz</dc:creator>
      <dc:date>2011-03-23T12:01:21Z</dc:date>
    </item>
    <item>
      <title>Re: Java Enum while evaluating conditions in JUEL</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/java-enum-while-evaluating-conditions-in-juel/m-p/41376#M22144</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;what if you add the whole package of the enum? eg. org.activiti.enums.JavaEnum ?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Mar 2011 06:40:45 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/java-enum-while-evaluating-conditions-in-juel/m-p/41376#M22144</guid>
      <dc:creator>jbarrez</dc:creator>
      <dc:date>2011-03-24T06:40:45Z</dc:date>
    </item>
    <item>
      <title>Re: Java Enum while evaluating conditions in JUEL</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/java-enum-while-evaluating-conditions-in-juel/m-p/41377#M22145</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;This was obviously my second guess - unfortunately it doesn't work either.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 25 Mar 2011 16:20:30 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/java-enum-while-evaluating-conditions-in-juel/m-p/41377#M22145</guid>
      <dc:creator>mlisiewicz</dc:creator>
      <dc:date>2011-03-25T16:20:30Z</dc:date>
    </item>
    <item>
      <title>Re: Java Enum while evaluating conditions in JUEL</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/java-enum-while-evaluating-conditions-in-juel/m-p/41378#M22146</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;This will work, although doesn't look as clean as it should &lt;img id="smileywink" class="emoticon emoticon-smileywink" src="https://connect.hyland.com/i/smilies/16x16_smiley-wink.png" alt="Smiley Wink" title="Smiley Wink" /&gt;:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;CODE&gt;${entity.getState().toString().equals("STATE")}&lt;/CODE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Mar 2011 06:36:29 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/java-enum-while-evaluating-conditions-in-juel/m-p/41378#M22146</guid>
      <dc:creator>frederikherema1</dc:creator>
      <dc:date>2011-03-29T06:36:29Z</dc:date>
    </item>
    <item>
      <title>Re: Java Enum while evaluating conditions in JUEL</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/java-enum-while-evaluating-conditions-in-juel/m-p/41379#M22147</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;This will work, although doesn't look as clean as it should &lt;img id="smileywink" class="emoticon emoticon-smileywink" src="https://connect.hyland.com/i/smilies/16x16_smiley-wink.png" alt="Smiley Wink" title="Smiley Wink" /&gt;:&lt;BR /&gt;&lt;BR /&gt;&lt;CODE&gt;${entity.getState().toString().equals("STATE")}&lt;/CODE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt;Well, &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;in this case I read Your answer as: We just figured out that we do not support Java Enums &lt;img id="smileywink" class="emoticon emoticon-smileywink" src="https://connect.hyland.com/i/smilies/16x16_smiley-wink.png" alt="Smiley Wink" title="Smiley Wink" /&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;It's quite a drawback…&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Apr 2011 10:55:36 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/java-enum-while-evaluating-conditions-in-juel/m-p/41379#M22147</guid>
      <dc:creator>mlisiewicz</dc:creator>
      <dc:date>2011-04-01T10:55:36Z</dc:date>
    </item>
    <item>
      <title>Re: Java Enum while evaluating conditions in JUEL</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/java-enum-while-evaluating-conditions-in-juel/m-p/41380#M22148</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;We just leverage UEL (JUEL), so it's actually not us not supporting Enums &lt;img id="smileywink" class="emoticon emoticon-smileywink" src="https://connect.hyland.com/i/smilies/16x16_smiley-wink.png" alt="Smiley Wink" title="Smiley Wink" /&gt; -&amp;gt; &lt;/SPAN&gt;&lt;A href="http://download.oracle.com/javaee/5/tutorial/doc/bnahq.html" rel="nofollow noopener noreferrer"&gt;http://download.oracle.com/javaee/5/tutorial/doc/bnahq.html&lt;/A&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;When referencing an enum constant with an expression, you use a String literal. For example, consider this Enum class:&lt;BR /&gt;&lt;BR /&gt;public enum Suit {hearts, spades, diamonds, clubs}&lt;BR /&gt;To refer to the Suit constant, Suit.hearts with an expression, you use the String literal, "hearts". Depending on the context, the String literal is converted to the enum constant automatically. For example, in the following expression in which mySuit is an instance of Suit, "hearts" is first converted to a Suit.hearts before it is compared to the instance.&lt;BR /&gt;&lt;BR /&gt;${mySuit == "hearts"}&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt;So the workaround is not a workaround, actually it's the way to do this… Don't really see what the drawback is. All there is to it, is their name, so typing in a literal string in an expression is exactly the same as using enum &lt;img id="smileywink" class="emoticon emoticon-smileywink" src="https://connect.hyland.com/i/smilies/16x16_smiley-wink.png" alt="Smiley Wink" title="Smiley Wink" /&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;CODE&gt;&lt;BR /&gt;${var == 'ORANGE'}&lt;BR /&gt;${var == MyEnum.ORANGE}&lt;BR /&gt;&lt;/CODE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Apr 2011 12:39:41 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/java-enum-while-evaluating-conditions-in-juel/m-p/41380#M22148</guid>
      <dc:creator>frederikherema1</dc:creator>
      <dc:date>2011-04-01T12:39:41Z</dc:date>
    </item>
    <item>
      <title>Re: Java Enum while evaluating conditions in JUEL</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/java-enum-while-evaluating-conditions-in-juel/m-p/41381#M22149</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Actually You are right, it works like that :shock: &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;So the proper answer to my first post is:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;${entity.getState() == "STATE1"}&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;or of course&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;${entity.getState().equals("STATE1")}&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It does work in Activiti.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Apr 2011 13:13:41 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/java-enum-while-evaluating-conditions-in-juel/m-p/41381#M22149</guid>
      <dc:creator>mlisiewicz</dc:creator>
      <dc:date>2011-04-01T13:13:41Z</dc:date>
    </item>
  </channel>
</rss>

