<?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 Re: Activiti CDI module and Alternatives in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/activiti-cdi-module-and-alternatives/m-p/124407#M87548</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thank you Frederik for your fast answer.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I'll create the JIRA issue later today and think about a possible (and elegant) solution.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Ususally, when CDI resolves alternatives for beans, activated alternatives always beat the normal class. And two possible, activated alternatives will result in an exception during deployment.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So far I solved the problem for me without changing Activiti-code. I am using delegates. The class, the BPMN-XML references, is now mostly empty, e.g.&lt;/SPAN&gt;&lt;BR /&gt;&lt;CODE&gt;&lt;BR /&gt;@Named("praxisberichtVeroeffentlichen")&lt;BR /&gt;@Dependent&lt;BR /&gt;public class PraxisberichtVeroeffentlichen {&lt;BR /&gt;&lt;BR /&gt; @Inject&lt;BR /&gt; private PraxisberichtVeroeffentlichenDelegate delegate;&lt;BR /&gt;&lt;BR /&gt; public void veroeffentlichen(String student, String thema) {&lt;BR /&gt;&amp;nbsp; delegate.veroeffentlichen(student, thema);&lt;BR /&gt; }&lt;BR /&gt;}&lt;BR /&gt;&lt;/CODE&gt;&lt;SPAN&gt;and the delegate is being replaced by a mock durung JUnit-tests.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The delegate does all the work now.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 30 Jan 2013 13:53:39 GMT</pubDate>
    <dc:creator>ronnybr</dc:creator>
    <dc:date>2013-01-30T13:53:39Z</dc:date>
    <item>
      <title>Activiti CDI module and Alternatives</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/activiti-cdi-module-and-alternatives/m-p/124405#M87546</link>
      <description>Hello Activiti-Community,I am using CDI in my application quite excessive and I am trying to write my JUnit-tests in a way, that most of my "real" CDI-Beans will be replaced by mocks.Also, I am using Arquillian, so that the injection works.The beans.xml for my tests looks like this:&amp;lt;beans xmlns="</description>
      <pubDate>Wed, 30 Jan 2013 10:38:47 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/activiti-cdi-module-and-alternatives/m-p/124405#M87546</guid>
      <dc:creator>ronnybr</dc:creator>
      <dc:date>2013-01-30T10:38:47Z</dc:date>
    </item>
    <item>
      <title>Re: Activiti CDI module and Alternatives</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/activiti-cdi-module-and-alternatives/m-p/124406#M87547</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I'm not really sure what the behavior should be, when multiple beans are found for the given class-name OR bean-name. I guess it's okay for lookup based on class to ignore "duplicate" entries. But the lookup by name should indeed throw an exception, informing that multiple beans with the same name have been found.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I wonder how the "usual" way of looking up a CDI-bean handles the resolving of what alternatives to return, but I presume the order of the beans returned by the BeanManager reflect the way CDI itself resolves references to beans. Perhaps there is a better way than using the BeanManager to resolve beans, that actually takes into account the "alternatives".&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Could you create an issue for this in Jira? Since you're a CDI-expert, can you perhaps add your recommendations on the way beans can be resolved, not using BeanManager? For now, you should override the CDIExpresionManager/CDI-ELResolver until this issue is cleared up…?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Jan 2013 12:13:29 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/activiti-cdi-module-and-alternatives/m-p/124406#M87547</guid>
      <dc:creator>frederikherema1</dc:creator>
      <dc:date>2013-01-30T12:13:29Z</dc:date>
    </item>
    <item>
      <title>Re: Activiti CDI module and Alternatives</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/activiti-cdi-module-and-alternatives/m-p/124407#M87548</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thank you Frederik for your fast answer.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I'll create the JIRA issue later today and think about a possible (and elegant) solution.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Ususally, when CDI resolves alternatives for beans, activated alternatives always beat the normal class. And two possible, activated alternatives will result in an exception during deployment.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So far I solved the problem for me without changing Activiti-code. I am using delegates. The class, the BPMN-XML references, is now mostly empty, e.g.&lt;/SPAN&gt;&lt;BR /&gt;&lt;CODE&gt;&lt;BR /&gt;@Named("praxisberichtVeroeffentlichen")&lt;BR /&gt;@Dependent&lt;BR /&gt;public class PraxisberichtVeroeffentlichen {&lt;BR /&gt;&lt;BR /&gt; @Inject&lt;BR /&gt; private PraxisberichtVeroeffentlichenDelegate delegate;&lt;BR /&gt;&lt;BR /&gt; public void veroeffentlichen(String student, String thema) {&lt;BR /&gt;&amp;nbsp; delegate.veroeffentlichen(student, thema);&lt;BR /&gt; }&lt;BR /&gt;}&lt;BR /&gt;&lt;/CODE&gt;&lt;SPAN&gt;and the delegate is being replaced by a mock durung JUnit-tests.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The delegate does all the work now.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Jan 2013 13:53:39 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/activiti-cdi-module-and-alternatives/m-p/124407#M87548</guid>
      <dc:creator>ronnybr</dc:creator>
      <dc:date>2013-01-30T13:53:39Z</dc:date>
    </item>
    <item>
      <title>Re: Activiti CDI module and Alternatives</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/activiti-cdi-module-and-alternatives/m-p/124408#M87549</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I see, so you're currently relying on CDI to injecting the alternative inside en in-the-middle-bean, resolved by Activiti, to overcome this issue?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Jan 2013 13:55:50 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/activiti-cdi-module-and-alternatives/m-p/124408#M87549</guid>
      <dc:creator>frederikherema1</dc:creator>
      <dc:date>2013-01-30T13:55:50Z</dc:date>
    </item>
    <item>
      <title>Re: Activiti CDI module and Alternatives</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/activiti-cdi-module-and-alternatives/m-p/124409#M87550</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Exactly. Activiti's CDIResolver get's one bean from the ProgrammaticBeanLookup and that bean has been initialized by CDI. That way, the alternative is taken, when running the JUnit-tests.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;At least, that's how I understand all this CDI magic&amp;nbsp; &lt;img id="smileyvery-happy" class="emoticon emoticon-smileyvery-happy" src="https://connect.hyland.com/i/smilies/16x16_smiley-very-happy.png" alt="Smiley Very Happy" title="Smiley Very Happy" /&gt;&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Jan 2013 14:00:19 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/activiti-cdi-module-and-alternatives/m-p/124409#M87550</guid>
      <dc:creator>ronnybr</dc:creator>
      <dc:date>2013-01-30T14:00:19Z</dc:date>
    </item>
    <item>
      <title>Re: Activiti CDI module and Alternatives</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/activiti-cdi-module-and-alternatives/m-p/124410#M87551</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Exactly. Activiti's CDIResolver get's one bean from the ProgrammaticBeanLookup and that bean has been initialized by CDI. That way, the alternative is taken, when running the JUnit-tests.&lt;BR /&gt;&lt;BR /&gt;At least, that's how I understand all this CDI magic &lt;img id="smileyvery-happy" class="emoticon emoticon-smileyvery-happy" src="https://connect.hyland.com/i/smilies/16x16_smiley-very-happy.png" alt="Smiley Very Happy" title="Smiley Very Happy" /&gt;&lt;/BLOCKQUOTE&gt;&lt;SPAN&gt;It is an option… An other option might be to have the resolver look at the @Alternative annotation and use that one instead of the normal bean. That requires a change to the code though… Not even sure it works….&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Jan 2013 20:31:56 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/activiti-cdi-module-and-alternatives/m-p/124410#M87551</guid>
      <dc:creator>ronald_van_kuij</dc:creator>
      <dc:date>2013-01-30T20:31:56Z</dc:date>
    </item>
    <item>
      <title>Re: Activiti CDI module and Alternatives</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/activiti-cdi-module-and-alternatives/m-p/124411#M87552</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;An other option might be to have the resolver look at the @Alternative annotation…&lt;/BLOCKQUOTE&gt;&lt;SPAN&gt;For me, it doesn't seem right to try to implement something the CDI framework should already be able to provide, like privilige alternatives.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The resolve() method from BeanManager looks like a good solution.&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://www.grepcode.com/file/repo1.maven.org/maven2/javax.enterprise/cdi-api/1.0/javax/enterprise/inject/spi/BeanManager.java#BeanManager.resolve%28java.util.Set%29" rel="nofollow noopener noreferrer"&gt;http://www.grepcode.com/file/repo1.maven.org/maven2/javax.enterprise/cdi-api/1.0/javax/enterprise/inject/spi/BeanManager.java#BeanManager.resolve%28java.util.Set%29&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I changed some code in the ProgrammaticBeanLookup and had a short JUnit test check whether it works or not. And it seems to do what the signature promises&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;BR /&gt;&lt;SPAN&gt;But I didn't have much time yesterday so I couldn't test it thoroughly.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 Jan 2013 06:06:32 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/activiti-cdi-module-and-alternatives/m-p/124411#M87552</guid>
      <dc:creator>ronnybr</dc:creator>
      <dc:date>2013-01-31T06:06:32Z</dc:date>
    </item>
    <item>
      <title>Re: Activiti CDI module and Alternatives</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/activiti-cdi-module-and-alternatives/m-p/124412#M87553</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I'll have a deeper look into the resolve() alternative, see &lt;/SPAN&gt;&lt;A href="https://jira.codehaus.org/browse/ACT-1557" rel="nofollow noopener noreferrer"&gt;https://jira.codehaus.org/browse/ACT-1557&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 Jan 2013 09:37:48 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/activiti-cdi-module-and-alternatives/m-p/124412#M87553</guid>
      <dc:creator>frederikherema1</dc:creator>
      <dc:date>2013-01-31T09:37:48Z</dc:date>
    </item>
  </channel>
</rss>

