<?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: Mapping a start event form property to a java bean in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/mapping-a-start-event-form-property-to-a-java-bean/m-p/25082#M12344</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;When you use ${address.street} as form-property, the form-engine expects a variable with name "address" on the process. Since the process is just starting, no variables are available, so address cannot be resolved. For the engine, there really is no way of knowing how to instantiate/find the address bean.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The example in the userguide, using the address-bean, assumes a bean address is available on your process, which has been set by eg. API (runtimeService.setVariable) or from inside the process (JavaDelegate, Tasklistener etc.).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;A simple workaround for this could be to store the street as a normal variable and add a ExecutionListener to the start-event, which instantiates a new Address-bean and sets the address-beans properties based on the earlier submitted variables.&lt;/SPAN&gt;&lt;BR /&gt;&lt;CODE&gt;&lt;BR /&gt;&amp;lt;startEvent id="theStart" /&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;lt;extensionElements&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;activiti:executionListener class="org.activiti.CreateAdressBeanListener" event="end" /&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/extensionElements&amp;gt;&lt;BR /&gt;&amp;lt;/startEvent&amp;gt;&lt;BR /&gt;&lt;/CODE&gt;&lt;CODE&gt;&lt;BR /&gt;public class CreateAdressBeanListener implements ExecutionListener {&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp; public void notify(ExecutionListenerExecution execution) throws Exception {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Address address = new Address();&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; address.setStreet(execution.getVariable("street");&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; address.setXXX(…);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; …&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; execution.setVariable("address", address);&lt;BR /&gt;&amp;nbsp; }&lt;BR /&gt;}&lt;BR /&gt;&lt;/CODE&gt;&lt;BR /&gt;&lt;SPAN&gt;If you want to show existing (non-process variables) data in your startform, you can always expose your data/services providing the data using spring. You can define a bean in your spring-configuration (the same configuration where your process-engine is in) and use the beans in your expressions, eg:&lt;/SPAN&gt;&lt;BR /&gt;&lt;CODE&gt;&lt;BR /&gt;&amp;lt;activiti:formProperty id="street" expression="#{addressService.getAdress('Belgium')}" /&amp;gt;&lt;BR /&gt;&lt;/CODE&gt;&lt;BR /&gt;&lt;SPAN&gt;Hope this answers your questions.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Cheers&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 20 Jan 2011 07:15:07 GMT</pubDate>
    <dc:creator>frederikherema1</dc:creator>
    <dc:date>2011-01-20T07:15:07Z</dc:date>
    <item>
      <title>Mapping a start event form property to a java bean</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/mapping-a-start-event-form-property-to-a-java-bean/m-p/25081#M12343</link>
      <description>Hi,How would it be possible to assign values from Java beans to start event form properties?It seems that mapping form properties to Java beans doesn't work in start events (it works with user tasks, though). If a start event has form properties which are mapped to a Java bean properties, then the b</description>
      <pubDate>Wed, 19 Jan 2011 20:48:16 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/mapping-a-start-event-form-property-to-a-java-bean/m-p/25081#M12343</guid>
      <dc:creator>rainerv</dc:creator>
      <dc:date>2011-01-19T20:48:16Z</dc:date>
    </item>
    <item>
      <title>Re: Mapping a start event form property to a java bean</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/mapping-a-start-event-form-property-to-a-java-bean/m-p/25082#M12344</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;When you use ${address.street} as form-property, the form-engine expects a variable with name "address" on the process. Since the process is just starting, no variables are available, so address cannot be resolved. For the engine, there really is no way of knowing how to instantiate/find the address bean.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The example in the userguide, using the address-bean, assumes a bean address is available on your process, which has been set by eg. API (runtimeService.setVariable) or from inside the process (JavaDelegate, Tasklistener etc.).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;A simple workaround for this could be to store the street as a normal variable and add a ExecutionListener to the start-event, which instantiates a new Address-bean and sets the address-beans properties based on the earlier submitted variables.&lt;/SPAN&gt;&lt;BR /&gt;&lt;CODE&gt;&lt;BR /&gt;&amp;lt;startEvent id="theStart" /&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;lt;extensionElements&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;activiti:executionListener class="org.activiti.CreateAdressBeanListener" event="end" /&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/extensionElements&amp;gt;&lt;BR /&gt;&amp;lt;/startEvent&amp;gt;&lt;BR /&gt;&lt;/CODE&gt;&lt;CODE&gt;&lt;BR /&gt;public class CreateAdressBeanListener implements ExecutionListener {&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp; public void notify(ExecutionListenerExecution execution) throws Exception {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Address address = new Address();&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; address.setStreet(execution.getVariable("street");&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; address.setXXX(…);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; …&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; execution.setVariable("address", address);&lt;BR /&gt;&amp;nbsp; }&lt;BR /&gt;}&lt;BR /&gt;&lt;/CODE&gt;&lt;BR /&gt;&lt;SPAN&gt;If you want to show existing (non-process variables) data in your startform, you can always expose your data/services providing the data using spring. You can define a bean in your spring-configuration (the same configuration where your process-engine is in) and use the beans in your expressions, eg:&lt;/SPAN&gt;&lt;BR /&gt;&lt;CODE&gt;&lt;BR /&gt;&amp;lt;activiti:formProperty id="street" expression="#{addressService.getAdress('Belgium')}" /&amp;gt;&lt;BR /&gt;&lt;/CODE&gt;&lt;BR /&gt;&lt;SPAN&gt;Hope this answers your questions.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Cheers&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Jan 2011 07:15:07 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/mapping-a-start-event-form-property-to-a-java-bean/m-p/25082#M12344</guid>
      <dc:creator>frederikherema1</dc:creator>
      <dc:date>2011-01-20T07:15:07Z</dc:date>
    </item>
    <item>
      <title>Re: Mapping a start event form property to a java bean</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/mapping-a-start-event-form-property-to-a-java-bean/m-p/25083#M12345</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;If you want to show existing (non-process variables) data in your startform, you can always expose your data/services providing the data using spring. You can define a bean in your spring-configuration (the same configuration where your process-engine is in) and use the beans in your expressions, eg:&lt;BR /&gt;&lt;CODE&gt;&lt;BR /&gt;&amp;lt;activiti:formProperty id="street" expression="#{addressService.getAdress('Belgium')}" /&amp;gt;&lt;BR /&gt;&lt;/CODE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you for the answer.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm indeed using Spring and trying to access my services as Spring-configured beans in start forms. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Interestingly, I'm able to access my services in form properties in user tasks, but not in form properties in start events. Actually, I'm able to access my Spring-configured beans in all the other workflow elements (service tasks, task listener etc) but not in start events.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Could it be a bug in the Engine where beans are accessible everywhere else but start events or could there be just something wrong with my application? Could someone confirm (and test) if beans really work in start events?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks again&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Jan 2011 13:11:17 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/mapping-a-start-event-form-property-to-a-java-bean/m-p/25083#M12345</guid>
      <dc:creator>rainerv</dc:creator>
      <dc:date>2011-01-20T13:11:17Z</dc:date>
    </item>
    <item>
      <title>Re: Mapping a start event form property to a java bean</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/mapping-a-start-event-form-property-to-a-java-bean/m-p/25084#M12346</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I've looked a bit deeper into this and found the reason why this is happening.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The expression-resolving is now depending on an execution being active. When requesting start-form data, no execution is active yet, and the expression is not resolved, rather than throwing an exception. But it's a valid usecase to use expressions without an active execution in the start-form properties when using spring, like you are trying to do.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Created an issue for it, so you can track the changes: &lt;/SPAN&gt;&lt;A href="http://jira.codehaus.org/browse/ACT-558" rel="nofollow noopener noreferrer"&gt;http://jira.codehaus.org/browse/ACT-558&lt;/A&gt;&lt;SPAN&gt;. I propose you use the workaround I suggested, using ExecutionListener on startEvent END.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Jan 2011 13:50:55 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/mapping-a-start-event-form-property-to-a-java-bean/m-p/25084#M12346</guid>
      <dc:creator>frederikherema1</dc:creator>
      <dc:date>2011-01-20T13:50:55Z</dc:date>
    </item>
    <item>
      <title>Re: Mapping a start event form property to a java bean</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/mapping-a-start-event-form-property-to-a-java-bean/m-p/25085#M12347</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thank you, I appreciate that. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Looking forward to the bug fix.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Jan 2011 20:02:41 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/mapping-a-start-event-form-property-to-a-java-bean/m-p/25085#M12347</guid>
      <dc:creator>rainerv</dc:creator>
      <dc:date>2011-01-20T20:02:41Z</dc:date>
    </item>
  </channel>
</rss>

