<?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 Variables Not Populated in Some ServiceTask in Unit Test but Working in Activiti Explorer in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/variables-not-populated-in-some-servicetask-in-unit-test-but/m-p/210281#M163411</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi All,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm a new user of Activiti BPMS. Now I have very strange behavior. I have &lt;/SPAN&gt;&lt;A href="https://github.com/xsalefter/activiti-spring-demo/blob/master/src/main/resources/reinsurance_process_v2.bpmn20.xml" rel="nofollow noopener noreferrer"&gt;Activiti's model&lt;/A&gt;&lt;SPAN&gt; as follow:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; [img]&lt;/SPAN&gt;&lt;A href="http://s29.postimg.org/dumgzpdd3/reinsurance_v2.png" rel="nofollow noopener noreferrer"&gt;http://s29.postimg.org/dumgzpdd3/reinsurance_v2.png&lt;/A&gt;&lt;SPAN&gt;[/img]&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;As we can see, it contains:&lt;/SPAN&gt;&lt;BR /&gt;&lt;UL&gt;&lt;LI&gt;User Tasks: Receive an Offers, Input Ceding Application, and Ceding Application Acceptance Process, and&lt;/LI&gt;&lt;LI&gt;Service Tasks: Check for Facultative Code …. , Saving Ceding Application, and Update Master Data.&lt;/LI&gt;&lt;/UL&gt;&lt;SPAN&gt;The problem is, when executing in unit test:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;UL&gt;&lt;LI&gt;Receive an Offers -&amp;gt; Check for Facultative Code …. : On this task, all variables from "Receive an Offers" is obtained without any problem.&lt;/LI&gt;&lt;LI&gt;Input Ceding Application -&amp;gt; Save Ceding Application: Only variables from "Receive an Offers" is available. No variables that comes from "Input Ceding Application" is available.&lt;/LI&gt;&lt;LI&gt;Ceding Application Acceptance Process -&amp;gt; Update Master Data: Only variables from "Receive and offers" and "Input Ceding Application" is available. Form data from "Ceding Application Acceptance Process" is not available.&lt;/LI&gt;&lt;/UL&gt;&lt;SPAN&gt;This is log comes when executing the &lt;/SPAN&gt;&lt;A href="https://github.com/xsalefter/activiti-spring-demo/blob/master/src/test/java/com/baeldung/activitispringdemo/ReInsuranceProcessV2IntegrationTest.java" rel="nofollow noopener noreferrer"&gt;unit test code&lt;/A&gt;&lt;SPAN&gt;:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;&lt;BR /&gt;&amp;gt;&amp;gt;&amp;gt; execute() in FacultativeCodeAndBusinessClassifiedHandler. Variables={business_classified=Others, facultative_code=F004.25102015.0001, initiator=null}&lt;BR /&gt;….&lt;BR /&gt;&amp;gt;&amp;gt;&amp;gt; execute() method on CedingApplicationCreator. Variables:{facultative_code_and_business_class_valid=true, business_classified=Others, facultative_code=F004.25102015.0001, initiator=null}&lt;BR /&gt;….&lt;BR /&gt;&amp;gt;&amp;gt;&amp;gt; execute() in CedingApplicationUpdater. Variables={facultative_code_and_business_class_valid=true, business_classified=Others, facultative_code=F004.25102015.0002, ceding_address=Rasuna Said street, Central Jakarta, Indonesia, application_amount=0, ceding_contact_phone=+628123456789, share_in_percent=0.0, ceding_contact_email=someotherceding@mailinator.com, initiator=null, application_status=P11_Offer_In_Progress, ceding_name=Some Other Ceding}&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;/CODE&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;On the other side, when I'm deploying the process to activiti explorer, I think I got the expected result. This is the logs from activiti explorer tomcat log:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;&lt;BR /&gt;&amp;gt;&amp;gt;&amp;gt; execute() in FacultativeCodeAndBusinessClassifiedHandler. Variables={business_classified=Others, facultative_code=123123, initiator=kermit}&lt;BR /&gt;&lt;BR /&gt;&amp;gt;&amp;gt;&amp;gt; execute() method on CedingApplicationCreator. Variables:{facultative_code_and_business_class_valid=true, business_classified=Others, facultative_code=123123, ceding_address=Address 123, application_amount=0, ceding_contact_phone=123123123, share_in_percent=0, ceding_contact_email=email123@email.com, initiator=kermit, application_status=P11 - Offer In Process, ceding_name=Ceding 123}&lt;BR /&gt;&lt;BR /&gt;&amp;gt;&amp;gt;&amp;gt; execute() in CedingApplicationUpdater. Variables={facultative_code_and_business_class_valid=true, business_classified=Others, facultative_code=123123, ceding_address=Address 123, application_amount=0, ceding_contact_phone=123123123, share_in_percent=0, ceding_contact_email=email123@email.com, initiator=kermit, ceding_application_accepted=true, application_status=P11 - Offer In Process, ceding_name=Ceding 123}&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;/CODE&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Currently, all of my JavaDelegate implementations only logging a messages with this one line:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;code language="java"&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;logger.info("&amp;gt;&amp;gt;&amp;gt; execute() method on CedingApplicationCreator. Variables:{}", execution.getVariables());&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;/code&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Now my questions: &lt;/SPAN&gt;&lt;BR /&gt;&lt;OL style="list-style-type:decimal;"&gt;&lt;LI&gt;Is these all above is expected behavior? Is my unit test behave like my explanation above because I'm not including any IdentityService or any ***Service that should be used properly?&lt;/LI&gt;&lt;LI&gt;What I need to complete to make unit test code works as expected as in activiti explorer?&lt;/LI&gt;&lt;LI&gt;Do I use Activiti, especially the JavaDelegate in the wrong direction? (For example, use ***Listener in this case is more common instead of JavaDelegate, etc)&lt;/LI&gt;&lt;/OL&gt;&lt;SPAN&gt;Thanks for any comments and suggestions.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 09 Nov 2015 23:56:08 GMT</pubDate>
    <dc:creator>xsa</dc:creator>
    <dc:date>2015-11-09T23:56:08Z</dc:date>
    <item>
      <title>Variables Not Populated in Some ServiceTask in Unit Test but Working in Activiti Explorer</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/variables-not-populated-in-some-servicetask-in-unit-test-but/m-p/210281#M163411</link>
      <description>Hi All,I'm a new user of Activiti BPMS. Now I have very strange behavior. I have Activiti's model as follow: [img]http://s29.postimg.org/dumgzpdd3/reinsurance_v2.png[/img]As we can see, it contains:User Tasks: Receive an Offers, Input Ceding Application, and Ceding Application Acceptance Process, an</description>
      <pubDate>Mon, 09 Nov 2015 23:56:08 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/variables-not-populated-in-some-servicetask-in-unit-test-but/m-p/210281#M163411</guid>
      <dc:creator>xsa</dc:creator>
      <dc:date>2015-11-09T23:56:08Z</dc:date>
    </item>
    <item>
      <title>Re: Variables Not Populated in Some ServiceTask in Unit Test but Working in Activiti Explorer</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/variables-not-populated-in-some-servicetask-in-unit-test-but/m-p/210282#M163412</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Resa,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Share jUnit tests with us. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Martin&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Nov 2015 20:52:26 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/variables-not-populated-in-some-servicetask-in-unit-test-but/m-p/210282#M163412</guid>
      <dc:creator>martin_grofcik</dc:creator>
      <dc:date>2015-11-12T20:52:26Z</dc:date>
    </item>
    <item>
      <title>Re: Variables Not Populated in Some ServiceTask in Unit Test but Working in Activiti Explorer</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/variables-not-populated-in-some-servicetask-in-unit-test-but/m-p/210283#M163413</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi martin, &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for your response. I did shared unit test code above. I'll share again:&lt;/SPAN&gt;&lt;BR /&gt;&lt;UL&gt;&lt;LI&gt;&lt;A href="https://github.com/xsalefter/activiti-spring-demo" rel="nofollow noopener noreferrer"&gt;Full source code&lt;/A&gt;&lt;/LI&gt;&lt;LI&gt;&lt;A href="https://github.com/xsalefter/activiti-spring-demo/blob/master/src/test/java/com/baeldung/activitispringdemo/ReInsuranceProcessV2IntegrationTest.java" rel="nofollow noopener noreferrer"&gt;Unit test&lt;/A&gt;&lt;/LI&gt;&lt;LI&gt;&lt;A href="https://github.com/xsalefter/activiti-spring-demo/blob/master/src/main/resources/reinsurance_process_v2.bpmn20.xml" rel="nofollow noopener noreferrer"&gt;bpmn20.xml file.&lt;/A&gt;&lt;/LI&gt;&lt;BR /&gt;Thanks.&lt;/UL&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Nov 2015 21:09:38 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/variables-not-populated-in-some-servicetask-in-unit-test-but/m-p/210283#M163413</guid>
      <dc:creator>xsa</dc:creator>
      <dc:date>2015-11-12T21:09:38Z</dc:date>
    </item>
  </channel>
</rss>

