<?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 Help understanding @BusinessProcessScoped beans in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/help-understanding-businessprocessscoped-beans/m-p/137525#M96411</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I came across the @BusinessProcessScoped bean section in the activiti online documentation, but I don't know how I or Actviti knows which BusinessProcessScoped bean to inject.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I assume if I create such a bean with the @Named annotation, I can reference it from the process definition. Then Activiti will know which BusinessProcessScoped bean belongs to which process instance.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;However what if I want to @Inject this bean into other CDI beans e.g. a @RequestScope bean in&amp;nbsp; a JSF application. e.g.:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="language-java line-numbers"&gt;&lt;CODE&gt;&lt;BR /&gt;@BusinessProcessScoped&lt;BR /&gt;public class MyProcessBean implements java.io.Serializable {&lt;BR /&gt;&amp;nbsp; // this bean persists its state throughout the whole process instance&lt;BR /&gt;&amp;nbsp; private String lastChangingUser;&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp; //getters&amp;amp;setters&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;@RequestScoped&lt;BR /&gt;public class MyTaskController {&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp; @Inject MyProcessBean myProcessBean;&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp; public void updateLastChangingUser() {&lt;BR /&gt;&amp;nbsp;&amp;nbsp; Principal principal = FacesContext.getCurrentInstance().getExternalContext().getUserPrincipal();&lt;BR /&gt;&amp;nbsp;&amp;nbsp; myProcessBean.setLastChangingUser( principal.getName() );&lt;BR /&gt;&amp;nbsp; }&lt;BR /&gt;}&lt;BR /&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;How will Activiti know, how can I tell it for which process instance it should inject the MyProcessBean?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks, Pal&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 06 Jun 2013 12:44:51 GMT</pubDate>
    <dc:creator>pkonyves</dc:creator>
    <dc:date>2013-06-06T12:44:51Z</dc:date>
    <item>
      <title>Help understanding @BusinessProcessScoped beans</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/help-understanding-businessprocessscoped-beans/m-p/137525#M96411</link>
      <description>I came across the @BusinessProcessScoped bean section in the activiti online documentation, but I don't know how I or Actviti knows which BusinessProcessScoped bean to inject.I assume if I create such a bean with the @Named annotation, I can reference it from the process definition. Then Activiti wi</description>
      <pubDate>Thu, 06 Jun 2013 12:44:51 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/help-understanding-businessprocessscoped-beans/m-p/137525#M96411</guid>
      <dc:creator>pkonyves</dc:creator>
      <dc:date>2013-06-06T12:44:51Z</dc:date>
    </item>
    <item>
      <title>Re: Help understanding @BusinessProcessScoped beans</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/help-understanding-businessprocessscoped-beans/m-p/137526#M96412</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;You don't: it works the other way around, as the scope only matters when you're talking about the lifecycle of this bean. The bean will only be the same during the duration of the process instance.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;From the docs: 'Sometimes, we want to work with process scoped beans, in the absence of an association with a process instance, for example before starting a process. If no process instance is currently active, instances of BusinessProcessScoped beans are temporarily stored in a local scope (I.e. the Conversation or the Request, depending on the context. If this scope is later associated with a business process instance, the bean instances are flushed to the process instance.'&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Jun 2013 15:04:55 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/help-understanding-businessprocessscoped-beans/m-p/137526#M96412</guid>
      <dc:creator>jbarrez</dc:creator>
      <dc:date>2013-06-10T15:04:55Z</dc:date>
    </item>
  </channel>
</rss>

