<?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: Problem mapping form property to object property  in Alfresco Forum</title>
    <link>https://connect.hyland.com/t5/alfresco-forum/problem-mapping-form-property-to-object-property/m-p/3166#M1046</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Finally it works, I modified the bpmn to use the deferred expression in the form and the unit test to use formService.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;test.bpmn&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;&amp;lt;process id="Test" name="Test" isExecutable="true"&amp;gt;&lt;BR /&gt; &amp;lt;startEvent id="start" name="start"&amp;gt;&lt;BR /&gt; &amp;lt;extensionElements&amp;gt;&lt;BR /&gt; &amp;lt;activiti:executionListener event="start" class="cl.pardo.business.BusinessLogic"&amp;gt;&amp;lt;/activiti:executionListener&amp;gt;&lt;BR /&gt; &amp;lt;/extensionElements&amp;gt;&lt;BR /&gt; &amp;lt;/startEvent&amp;gt;&lt;BR /&gt; &amp;lt;userTask id="dataEntry" name="Data Entry"&amp;gt;&lt;BR /&gt; &amp;lt;extensionElements&amp;gt;&lt;BR /&gt; &amp;lt;activiti:formProperty id="name" name="Name" type="string" expression="&lt;STRONG&gt;#{entry.name}&lt;/STRONG&gt;"&amp;gt;&amp;lt;/activiti:formProperty&amp;gt;&lt;BR /&gt; &amp;lt;activiti:formProperty id="accept" name="Accept" type="boolean" expression="&lt;STRONG&gt;#{entry.accept}&lt;/STRONG&gt;" required="true"&amp;gt;&amp;lt;/activiti:formProperty&amp;gt;&lt;BR /&gt; &amp;lt;/extensionElements&amp;gt;&lt;BR /&gt; &amp;lt;/userTask&amp;gt;&lt;BR /&gt; &amp;lt;exclusiveGateway id="exclusivegateway1" name="Exclusive Gateway"&amp;gt;&amp;lt;/exclusiveGateway&amp;gt;&lt;BR /&gt; &amp;lt;serviceTask id="acceptedMessage" name="Accepted Message" activiti:expression="${business.AcceptedMessage()}"&amp;gt;&amp;lt;/serviceTask&amp;gt;&lt;BR /&gt; &amp;lt;serviceTask id="rejectedMessage" name="Rejected Message" activiti:expression="${business.RejectedMessage()}"&amp;gt;&amp;lt;/serviceTask&amp;gt;&lt;BR /&gt; &amp;lt;endEvent id="end" name="end"&amp;gt;&lt;BR /&gt; &amp;lt;extensionElements&amp;gt;&lt;BR /&gt; &amp;lt;activiti:executionListener event="end" expression="${business.end()}"&amp;gt;&amp;lt;/activiti:executionListener&amp;gt;&lt;BR /&gt; &amp;lt;/extensionElements&amp;gt;&lt;BR /&gt; &amp;lt;/endEvent&amp;gt;&lt;BR /&gt; &amp;lt;sequenceFlow id="accept" name="Accept" sourceRef="exclusivegateway1" targetRef="acceptedMessage"&amp;gt;&lt;BR /&gt; &amp;lt;conditionExpression xsi:type="tFormalExpression"&amp;gt;&amp;lt;![CDATA[${business.isAccepted()}]]&amp;gt;&amp;lt;/conditionExpression&amp;gt;&lt;BR /&gt; &amp;lt;/sequenceFlow&amp;gt;&lt;BR /&gt; &amp;lt;sequenceFlow id="reject" name="Reject" sourceRef="exclusivegateway1" targetRef="rejectedMessage"&amp;gt;&lt;BR /&gt; &amp;lt;conditionExpression xsi:type="tFormalExpression"&amp;gt;&amp;lt;![CDATA[${!business.isAccepted()}]]&amp;gt;&amp;lt;/conditionExpression&amp;gt;&lt;BR /&gt; &amp;lt;/sequenceFlow&amp;gt;&lt;BR /&gt; &amp;lt;sequenceFlow id="flow4" sourceRef="rejectedMessage" targetRef="end"&amp;gt;&amp;lt;/sequenceFlow&amp;gt;&lt;BR /&gt; &amp;lt;sequenceFlow id="flow5" sourceRef="acceptedMessage" targetRef="end"&amp;gt;&amp;lt;/sequenceFlow&amp;gt;&lt;BR /&gt; &amp;lt;sequenceFlow id="flow6" sourceRef="start" targetRef="dataEntry"&amp;gt;&amp;lt;/sequenceFlow&amp;gt;&lt;BR /&gt; &amp;lt;serviceTask id="persistData" name="Persist Data" activiti:expression="${business.persistData(entry)}"&amp;gt;&amp;lt;/serviceTask&amp;gt;&lt;BR /&gt; &amp;lt;sequenceFlow id="flow7" sourceRef="dataEntry" targetRef="persistData"&amp;gt;&amp;lt;/sequenceFlow&amp;gt;&lt;BR /&gt; &amp;lt;sequenceFlow id="flow8" sourceRef="persistData" targetRef="exclusivegateway1"&amp;gt;&amp;lt;/sequenceFlow&amp;gt;&lt;BR /&gt; &amp;lt;/process&amp;gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the unit test&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;&lt;/P&gt;@Test&lt;BR /&gt; public void startProcess() throws Exception {&lt;BR /&gt;&amp;nbsp; &amp;nbsp; RepositoryService repositoryService = activitiRule.getRepositoryService();&lt;BR /&gt; &lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;repositoryService.createDeployment().addInputStream("Test.bpmn20.xml", new FileInputStream(filename)).deploy();&lt;BR /&gt; &lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;RuntimeService runtimeService = activitiRule.getRuntimeService();&lt;BR /&gt; &lt;BR /&gt; &lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("Test");&lt;BR /&gt; &lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;assertNotNull(processInstance.getId());&lt;BR /&gt; &lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;LOGGER.info("id {} {}", processInstance.getId(), processInstance.getProcessDefinitionId());&lt;BR /&gt; &lt;BR /&gt; &lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;TaskService taskService = activitiRule.getTaskService();&lt;BR /&gt; &lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;STRONG&gt;FormService formService = activitiRule.getFormService();&lt;/STRONG&gt;&lt;BR /&gt; &lt;BR /&gt; &lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;Task task = taskService.createTaskQuery().singleResult(); &lt;BR /&gt; &lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;LOGGER.info("TASK NAME: {}", task.getName());&lt;BR /&gt; &lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;STRONG&gt;Map&amp;lt;String, String&amp;gt; formData = new HashMap&amp;lt;String, String&amp;gt;();&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt; &amp;nbsp; &amp;nbsp; formData.put("name", "Benjamin");&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt; &amp;nbsp; &amp;nbsp; formData.put("accept", "false");&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt; &amp;nbsp; &amp;nbsp; formService.submitTaskFormData(task.getId(), formData);&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;// taskService.setVariable(task.getId(), "name", "Benjamin");&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;// taskService.setVariable(task.getId(), "accept", true);&lt;BR /&gt; &lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;taskService.complete(task.getId()); &lt;BR /&gt; }&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Than you.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 17 Jan 2017 13:17:50 GMT</pubDate>
    <dc:creator>bsoto</dc:creator>
    <dc:date>2017-01-17T13:17:50Z</dc:date>
    <item>
      <title>Problem mapping form property to object property</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/problem-mapping-form-property-to-object-property/m-p/3163#M1043</link>
      <description>Greeting to everyone,I want to map a form to a object, i'm using the expressions, but i doesn't work and i am not getting any error.Here is my codeThis is a POJO that i use to save datapublic class Entry implements Serializable{ &amp;nbsp; &amp;nbsp; private static final long serialVersionUID = -2724915954211057511L;</description>
      <pubDate>Mon, 16 Jan 2017 17:58:05 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/problem-mapping-form-property-to-object-property/m-p/3163#M1043</guid>
      <dc:creator>bsoto</dc:creator>
      <dc:date>2017-01-16T17:58:05Z</dc:date>
    </item>
    <item>
      <title>Re: Problem mapping form property to object property</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/problem-mapping-form-property-to-object-property/m-p/3164#M1044</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think there are a couple of problems with your implementation.&lt;/P&gt;&lt;P&gt;First, your unit test should make use of the formService rather than setting the execution variables.&lt;/P&gt;&lt;P&gt;Next, I think you need to use JUEL expressions (#) rather than delegate expressions ($) in your form property.&lt;BR /&gt;&lt;BR /&gt;Take a look at the FormServiceTest.testFormPropertyExpression(), it demonstrates how to map data into a pojo.&lt;BR /&gt;If after you look at this it still doesnt work, create a unit test and attach to the forum thread so we can take a look.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Greg&lt;/P&gt;&lt;P&gt;&lt;A href="https://migration33.stage.lithium.com/t5/tag/bp3/tg-p"&gt;&lt;/A&gt;‌&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 Jan 2017 22:05:38 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/problem-mapping-form-property-to-object-property/m-p/3164#M1044</guid>
      <dc:creator>gdharley</dc:creator>
      <dc:date>2017-01-16T22:05:38Z</dc:date>
    </item>
    <item>
      <title>Re: Problem mapping form property to object property</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/problem-mapping-form-property-to-object-property/m-p/3165#M1045</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you for your answer.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In some point i use deferred&amp;nbsp;expression (#{}) instead of immediate&amp;nbsp;expression (${}) but it doesn't work. Anyway, reading the JUEL documentation I should using &amp;nbsp;deferred expression since it is used for set and get while the immediate is only suitable for get, so i will change.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I gonna test the formService thing, thank you again.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://connect.hyland.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Jan 2017 12:36:09 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/problem-mapping-form-property-to-object-property/m-p/3165#M1045</guid>
      <dc:creator>bsoto</dc:creator>
      <dc:date>2017-01-17T12:36:09Z</dc:date>
    </item>
    <item>
      <title>Re: Problem mapping form property to object property</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/problem-mapping-form-property-to-object-property/m-p/3166#M1046</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Finally it works, I modified the bpmn to use the deferred expression in the form and the unit test to use formService.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;test.bpmn&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;&amp;lt;process id="Test" name="Test" isExecutable="true"&amp;gt;&lt;BR /&gt; &amp;lt;startEvent id="start" name="start"&amp;gt;&lt;BR /&gt; &amp;lt;extensionElements&amp;gt;&lt;BR /&gt; &amp;lt;activiti:executionListener event="start" class="cl.pardo.business.BusinessLogic"&amp;gt;&amp;lt;/activiti:executionListener&amp;gt;&lt;BR /&gt; &amp;lt;/extensionElements&amp;gt;&lt;BR /&gt; &amp;lt;/startEvent&amp;gt;&lt;BR /&gt; &amp;lt;userTask id="dataEntry" name="Data Entry"&amp;gt;&lt;BR /&gt; &amp;lt;extensionElements&amp;gt;&lt;BR /&gt; &amp;lt;activiti:formProperty id="name" name="Name" type="string" expression="&lt;STRONG&gt;#{entry.name}&lt;/STRONG&gt;"&amp;gt;&amp;lt;/activiti:formProperty&amp;gt;&lt;BR /&gt; &amp;lt;activiti:formProperty id="accept" name="Accept" type="boolean" expression="&lt;STRONG&gt;#{entry.accept}&lt;/STRONG&gt;" required="true"&amp;gt;&amp;lt;/activiti:formProperty&amp;gt;&lt;BR /&gt; &amp;lt;/extensionElements&amp;gt;&lt;BR /&gt; &amp;lt;/userTask&amp;gt;&lt;BR /&gt; &amp;lt;exclusiveGateway id="exclusivegateway1" name="Exclusive Gateway"&amp;gt;&amp;lt;/exclusiveGateway&amp;gt;&lt;BR /&gt; &amp;lt;serviceTask id="acceptedMessage" name="Accepted Message" activiti:expression="${business.AcceptedMessage()}"&amp;gt;&amp;lt;/serviceTask&amp;gt;&lt;BR /&gt; &amp;lt;serviceTask id="rejectedMessage" name="Rejected Message" activiti:expression="${business.RejectedMessage()}"&amp;gt;&amp;lt;/serviceTask&amp;gt;&lt;BR /&gt; &amp;lt;endEvent id="end" name="end"&amp;gt;&lt;BR /&gt; &amp;lt;extensionElements&amp;gt;&lt;BR /&gt; &amp;lt;activiti:executionListener event="end" expression="${business.end()}"&amp;gt;&amp;lt;/activiti:executionListener&amp;gt;&lt;BR /&gt; &amp;lt;/extensionElements&amp;gt;&lt;BR /&gt; &amp;lt;/endEvent&amp;gt;&lt;BR /&gt; &amp;lt;sequenceFlow id="accept" name="Accept" sourceRef="exclusivegateway1" targetRef="acceptedMessage"&amp;gt;&lt;BR /&gt; &amp;lt;conditionExpression xsi:type="tFormalExpression"&amp;gt;&amp;lt;![CDATA[${business.isAccepted()}]]&amp;gt;&amp;lt;/conditionExpression&amp;gt;&lt;BR /&gt; &amp;lt;/sequenceFlow&amp;gt;&lt;BR /&gt; &amp;lt;sequenceFlow id="reject" name="Reject" sourceRef="exclusivegateway1" targetRef="rejectedMessage"&amp;gt;&lt;BR /&gt; &amp;lt;conditionExpression xsi:type="tFormalExpression"&amp;gt;&amp;lt;![CDATA[${!business.isAccepted()}]]&amp;gt;&amp;lt;/conditionExpression&amp;gt;&lt;BR /&gt; &amp;lt;/sequenceFlow&amp;gt;&lt;BR /&gt; &amp;lt;sequenceFlow id="flow4" sourceRef="rejectedMessage" targetRef="end"&amp;gt;&amp;lt;/sequenceFlow&amp;gt;&lt;BR /&gt; &amp;lt;sequenceFlow id="flow5" sourceRef="acceptedMessage" targetRef="end"&amp;gt;&amp;lt;/sequenceFlow&amp;gt;&lt;BR /&gt; &amp;lt;sequenceFlow id="flow6" sourceRef="start" targetRef="dataEntry"&amp;gt;&amp;lt;/sequenceFlow&amp;gt;&lt;BR /&gt; &amp;lt;serviceTask id="persistData" name="Persist Data" activiti:expression="${business.persistData(entry)}"&amp;gt;&amp;lt;/serviceTask&amp;gt;&lt;BR /&gt; &amp;lt;sequenceFlow id="flow7" sourceRef="dataEntry" targetRef="persistData"&amp;gt;&amp;lt;/sequenceFlow&amp;gt;&lt;BR /&gt; &amp;lt;sequenceFlow id="flow8" sourceRef="persistData" targetRef="exclusivegateway1"&amp;gt;&amp;lt;/sequenceFlow&amp;gt;&lt;BR /&gt; &amp;lt;/process&amp;gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the unit test&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;&lt;/P&gt;@Test&lt;BR /&gt; public void startProcess() throws Exception {&lt;BR /&gt;&amp;nbsp; &amp;nbsp; RepositoryService repositoryService = activitiRule.getRepositoryService();&lt;BR /&gt; &lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;repositoryService.createDeployment().addInputStream("Test.bpmn20.xml", new FileInputStream(filename)).deploy();&lt;BR /&gt; &lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;RuntimeService runtimeService = activitiRule.getRuntimeService();&lt;BR /&gt; &lt;BR /&gt; &lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("Test");&lt;BR /&gt; &lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;assertNotNull(processInstance.getId());&lt;BR /&gt; &lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;LOGGER.info("id {} {}", processInstance.getId(), processInstance.getProcessDefinitionId());&lt;BR /&gt; &lt;BR /&gt; &lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;TaskService taskService = activitiRule.getTaskService();&lt;BR /&gt; &lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;STRONG&gt;FormService formService = activitiRule.getFormService();&lt;/STRONG&gt;&lt;BR /&gt; &lt;BR /&gt; &lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;Task task = taskService.createTaskQuery().singleResult(); &lt;BR /&gt; &lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;LOGGER.info("TASK NAME: {}", task.getName());&lt;BR /&gt; &lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;STRONG&gt;Map&amp;lt;String, String&amp;gt; formData = new HashMap&amp;lt;String, String&amp;gt;();&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt; &amp;nbsp; &amp;nbsp; formData.put("name", "Benjamin");&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt; &amp;nbsp; &amp;nbsp; formData.put("accept", "false");&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt; &amp;nbsp; &amp;nbsp; formService.submitTaskFormData(task.getId(), formData);&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;// taskService.setVariable(task.getId(), "name", "Benjamin");&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;// taskService.setVariable(task.getId(), "accept", true);&lt;BR /&gt; &lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;taskService.complete(task.getId()); &lt;BR /&gt; }&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Than you.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Jan 2017 13:17:50 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/problem-mapping-form-property-to-object-property/m-p/3166#M1046</guid>
      <dc:creator>bsoto</dc:creator>
      <dc:date>2017-01-17T13:17:50Z</dc:date>
    </item>
  </channel>
</rss>

