<?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: What are the reasons when expressions are not injected (null) in a service task delegate expression (Spring bean) ? in Alfresco Forum</title>
    <link>https://connect.hyland.com/t5/alfresco-forum/what-are-the-reasons-when-expressions-are-not-injected-null-in-a/m-p/3297#M1177</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello, thank you for the interest. I haven't configured a JUnit environment (yet) , so I can't provide on the spot the use case scenario, but I can lay down all the needed data, it will certainly contain all the needed data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1.a Spring bean in the Spring context availlable and instantiated by Spring&lt;/P&gt;&lt;P&gt;&amp;lt;bean id="simpleServiceTaskDelegate" class="atraxo.acc.activiti.SimpleServiceTaskDelegate" /&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2.The Activiti BPM process:&lt;/P&gt;&lt;P&gt;&amp;lt;?xml version="1.0" encoding="UTF-8"?&amp;gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;definitions xmlns="&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://www.omg.org/spec/BPMN/20100524/MODEL" rel="nofollow noopener noreferrer" target="_blank"&gt;http://www.omg.org/spec/BPMN/20100524/MODEL&lt;/A&gt;&lt;SPAN&gt;" xmlns:xsi="&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://www.w3.org/2001/XMLSchema-instance" rel="nofollow noopener noreferrer" target="_blank"&gt;http://www.w3.org/2001/XMLSchema-instance&lt;/A&gt;&lt;SPAN&gt;" xmlns:xsd="&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://www.w3.org/2001/XMLSchema" rel="nofollow noopener noreferrer" target="_blank"&gt;http://www.w3.org/2001/XMLSchema&lt;/A&gt;&lt;SPAN&gt;" xmlns:activiti="&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://activiti.org/bpmn" rel="nofollow noopener noreferrer" target="_blank"&gt;http://activiti.org/bpmn&lt;/A&gt;&lt;SPAN&gt;" xmlns:bpmndi="&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://www.omg.org/spec/BPMN/20100524/DI" rel="nofollow noopener noreferrer" target="_blank"&gt;http://www.omg.org/spec/BPMN/20100524/DI&lt;/A&gt;&lt;SPAN&gt;" xmlns&lt;img id="smileysurprised" class="emoticon emoticon-smileysurprised" src="https://connect.hyland.com/i/smilies/16x16_smiley-surprised.png" alt="Smiley Surprised" title="Smiley Surprised" /&gt;mgdc="&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://www.omg.org/spec/DD/20100524/DC" rel="nofollow noopener noreferrer" target="_blank"&gt;http://www.omg.org/spec/DD/20100524/DC&lt;/A&gt;&lt;SPAN&gt;" xmlns&lt;img id="smileysurprised" class="emoticon emoticon-smileysurprised" src="https://connect.hyland.com/i/smilies/16x16_smiley-surprised.png" alt="Smiley Surprised" title="Smiley Surprised" /&gt;mgdi="&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://www.omg.org/spec/DD/20100524/DI" rel="nofollow noopener noreferrer" target="_blank"&gt;http://www.omg.org/spec/DD/20100524/DI&lt;/A&gt;&lt;SPAN&gt;" typeLanguage="&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://www.w3.org/2001/XMLSchema" rel="nofollow noopener noreferrer" target="_blank"&gt;http://www.w3.org/2001/XMLSchema&lt;/A&gt;&lt;SPAN&gt;" expressionLanguage="&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://www.w3.org/1999/XPath" rel="nofollow noopener noreferrer" target="_blank"&gt;http://www.w3.org/1999/XPath&lt;/A&gt;&lt;SPAN&gt;" targetNamespace="&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://activiti.org/bpmn20" rel="nofollow noopener noreferrer" target="_blank"&gt;http://activiti.org/bpmn20&lt;/A&gt;&lt;SPAN&gt;" id="definitions"&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;process id="sone_email" name="Send Sone Email" isExecutable="true"&amp;gt;&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;startEvent id="theStart"&amp;gt;&amp;lt;/startEvent&amp;gt;&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;endEvent id="theEnd"&amp;gt;&amp;lt;/endEvent&amp;gt;&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;serviceTask id="servicetask1" name="Simple Service Task" &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;activiti:delegateExpression="${simpleServiceTaskDelegate}"&amp;gt;&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;extensionElements&amp;gt;&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;activiti:field name="fieldA"&amp;gt;&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;activiti:string&amp;gt;&amp;lt;![CDATA[AAA]]&amp;gt;&amp;lt;/activiti:string&amp;gt;&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;/activiti:field&amp;gt;&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;/extensionElements&amp;gt;&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;/serviceTask&amp;gt;&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;sequenceFlow id="flow1" sourceRef="theStart" targetRef="servicetask1"&amp;gt;&amp;lt;/sequenceFlow&amp;gt;&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;sequenceFlow id="flow2" sourceRef="servicetask1" targetRef="theEnd"&amp;gt;&amp;lt;/sequenceFlow&amp;gt;&lt;BR /&gt; &amp;lt;/process&amp;gt;&lt;BR /&gt;&amp;lt;/definitions&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3.The delegate:&amp;nbsp;SimpleServiceTaskDelegate.java class&lt;/P&gt;&lt;P&gt;public class SimpleServiceTaskDelegate implements JavaDelegate {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;private Expression fieldA;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;@Override&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;public void execute(DelegateExecution execution) {&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;System.out.println("FIELD:" + this.fieldA);// null&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;4.Just deploy and start the process&lt;/P&gt;&lt;P&gt;//deploy&lt;/P&gt;&lt;P&gt;InputStream is = this.getStream(workflowResourceName);&lt;/P&gt;&lt;P&gt;this.activitiBpmService.getRepositoryService().createDeployment().addInputStream(workflowResourceName, is).deploy()&lt;/P&gt;&lt;P&gt;//start&lt;/P&gt;&lt;P&gt;this.activitiBpmService.getRuntimeService().startProcessInstanceByKey("&lt;SPAN&gt;sone_email&lt;/SPAN&gt;");&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Basically,&amp;nbsp;in the &lt;STRONG&gt;simpleServiceTaskDelegate&amp;nbsp;&lt;/STRONG&gt;&lt;SPAN&gt;bean I inject an Expression &lt;STRONG&gt;fieldA&lt;/STRONG&gt;, which is null always. If I use the class to inject expressions, then it works:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt; &amp;lt;serviceTask id="servicetask1" name="Simple Service Task" activiti:class="atraxo.acc.activiti.SimpleServiceTaskDelegate"&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;If needed, I will setup the JUnit along with Spring context, h2 DB and Activiti and came up with a more functionl test.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks in advance for all the help !&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 19 Jan 2017 10:11:42 GMT</pubDate>
    <dc:creator>viorelhojda</dc:creator>
    <dc:date>2017-01-19T10:11:42Z</dc:date>
    <item>
      <title>What are the reasons when expressions are not injected (null) in a service task delegate expression (Spring bean) ?</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/what-are-the-reasons-when-expressions-are-not-injected-null-in-a/m-p/3295#M1175</link>
      <description>I'm trying to use a simple ServiceTask with a delegateExpression (a Spring bean) and to inject simple Expressions using activiti fields, I'm following the tutorial from official page :&amp;nbsp;Activiti User Guide&amp;nbsp;&amp;nbsp;.The Spring bean is correctly initialized by Spring and I have other beans and services correc</description>
      <pubDate>Wed, 18 Jan 2017 12:51:42 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/what-are-the-reasons-when-expressions-are-not-injected-null-in-a/m-p/3295#M1175</guid>
      <dc:creator>viorelhojda</dc:creator>
      <dc:date>2017-01-18T12:51:42Z</dc:date>
    </item>
    <item>
      <title>Re: What are the reasons when expressions are not injected (null) in a service task delegate expression (Spring bean) ?</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/what-are-the-reasons-when-expressions-are-not-injected-null-in-a/m-p/3296#M1176</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Please provide a unit test to demonstrate your problem.&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>Wed, 18 Jan 2017 17:43:59 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/what-are-the-reasons-when-expressions-are-not-injected-null-in-a/m-p/3296#M1176</guid>
      <dc:creator>gdharley</dc:creator>
      <dc:date>2017-01-18T17:43:59Z</dc:date>
    </item>
    <item>
      <title>Re: What are the reasons when expressions are not injected (null) in a service task delegate expression (Spring bean) ?</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/what-are-the-reasons-when-expressions-are-not-injected-null-in-a/m-p/3297#M1177</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello, thank you for the interest. I haven't configured a JUnit environment (yet) , so I can't provide on the spot the use case scenario, but I can lay down all the needed data, it will certainly contain all the needed data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1.a Spring bean in the Spring context availlable and instantiated by Spring&lt;/P&gt;&lt;P&gt;&amp;lt;bean id="simpleServiceTaskDelegate" class="atraxo.acc.activiti.SimpleServiceTaskDelegate" /&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2.The Activiti BPM process:&lt;/P&gt;&lt;P&gt;&amp;lt;?xml version="1.0" encoding="UTF-8"?&amp;gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;definitions xmlns="&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://www.omg.org/spec/BPMN/20100524/MODEL" rel="nofollow noopener noreferrer" target="_blank"&gt;http://www.omg.org/spec/BPMN/20100524/MODEL&lt;/A&gt;&lt;SPAN&gt;" xmlns:xsi="&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://www.w3.org/2001/XMLSchema-instance" rel="nofollow noopener noreferrer" target="_blank"&gt;http://www.w3.org/2001/XMLSchema-instance&lt;/A&gt;&lt;SPAN&gt;" xmlns:xsd="&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://www.w3.org/2001/XMLSchema" rel="nofollow noopener noreferrer" target="_blank"&gt;http://www.w3.org/2001/XMLSchema&lt;/A&gt;&lt;SPAN&gt;" xmlns:activiti="&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://activiti.org/bpmn" rel="nofollow noopener noreferrer" target="_blank"&gt;http://activiti.org/bpmn&lt;/A&gt;&lt;SPAN&gt;" xmlns:bpmndi="&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://www.omg.org/spec/BPMN/20100524/DI" rel="nofollow noopener noreferrer" target="_blank"&gt;http://www.omg.org/spec/BPMN/20100524/DI&lt;/A&gt;&lt;SPAN&gt;" xmlns&lt;img id="smileysurprised" class="emoticon emoticon-smileysurprised" src="https://connect.hyland.com/i/smilies/16x16_smiley-surprised.png" alt="Smiley Surprised" title="Smiley Surprised" /&gt;mgdc="&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://www.omg.org/spec/DD/20100524/DC" rel="nofollow noopener noreferrer" target="_blank"&gt;http://www.omg.org/spec/DD/20100524/DC&lt;/A&gt;&lt;SPAN&gt;" xmlns&lt;img id="smileysurprised" class="emoticon emoticon-smileysurprised" src="https://connect.hyland.com/i/smilies/16x16_smiley-surprised.png" alt="Smiley Surprised" title="Smiley Surprised" /&gt;mgdi="&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://www.omg.org/spec/DD/20100524/DI" rel="nofollow noopener noreferrer" target="_blank"&gt;http://www.omg.org/spec/DD/20100524/DI&lt;/A&gt;&lt;SPAN&gt;" typeLanguage="&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://www.w3.org/2001/XMLSchema" rel="nofollow noopener noreferrer" target="_blank"&gt;http://www.w3.org/2001/XMLSchema&lt;/A&gt;&lt;SPAN&gt;" expressionLanguage="&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://www.w3.org/1999/XPath" rel="nofollow noopener noreferrer" target="_blank"&gt;http://www.w3.org/1999/XPath&lt;/A&gt;&lt;SPAN&gt;" targetNamespace="&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://activiti.org/bpmn20" rel="nofollow noopener noreferrer" target="_blank"&gt;http://activiti.org/bpmn20&lt;/A&gt;&lt;SPAN&gt;" id="definitions"&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;process id="sone_email" name="Send Sone Email" isExecutable="true"&amp;gt;&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;startEvent id="theStart"&amp;gt;&amp;lt;/startEvent&amp;gt;&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;endEvent id="theEnd"&amp;gt;&amp;lt;/endEvent&amp;gt;&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;serviceTask id="servicetask1" name="Simple Service Task" &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;activiti:delegateExpression="${simpleServiceTaskDelegate}"&amp;gt;&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;extensionElements&amp;gt;&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;activiti:field name="fieldA"&amp;gt;&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;activiti:string&amp;gt;&amp;lt;![CDATA[AAA]]&amp;gt;&amp;lt;/activiti:string&amp;gt;&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;/activiti:field&amp;gt;&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;/extensionElements&amp;gt;&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;/serviceTask&amp;gt;&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;sequenceFlow id="flow1" sourceRef="theStart" targetRef="servicetask1"&amp;gt;&amp;lt;/sequenceFlow&amp;gt;&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;sequenceFlow id="flow2" sourceRef="servicetask1" targetRef="theEnd"&amp;gt;&amp;lt;/sequenceFlow&amp;gt;&lt;BR /&gt; &amp;lt;/process&amp;gt;&lt;BR /&gt;&amp;lt;/definitions&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3.The delegate:&amp;nbsp;SimpleServiceTaskDelegate.java class&lt;/P&gt;&lt;P&gt;public class SimpleServiceTaskDelegate implements JavaDelegate {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;private Expression fieldA;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;@Override&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;public void execute(DelegateExecution execution) {&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;System.out.println("FIELD:" + this.fieldA);// null&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;4.Just deploy and start the process&lt;/P&gt;&lt;P&gt;//deploy&lt;/P&gt;&lt;P&gt;InputStream is = this.getStream(workflowResourceName);&lt;/P&gt;&lt;P&gt;this.activitiBpmService.getRepositoryService().createDeployment().addInputStream(workflowResourceName, is).deploy()&lt;/P&gt;&lt;P&gt;//start&lt;/P&gt;&lt;P&gt;this.activitiBpmService.getRuntimeService().startProcessInstanceByKey("&lt;SPAN&gt;sone_email&lt;/SPAN&gt;");&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Basically,&amp;nbsp;in the &lt;STRONG&gt;simpleServiceTaskDelegate&amp;nbsp;&lt;/STRONG&gt;&lt;SPAN&gt;bean I inject an Expression &lt;STRONG&gt;fieldA&lt;/STRONG&gt;, which is null always. If I use the class to inject expressions, then it works:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt; &amp;lt;serviceTask id="servicetask1" name="Simple Service Task" activiti:class="atraxo.acc.activiti.SimpleServiceTaskDelegate"&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;If needed, I will setup the JUnit along with Spring context, h2 DB and Activiti and came up with a more functionl test.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks in advance for all the help !&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Jan 2017 10:11:42 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/what-are-the-reasons-when-expressions-are-not-injected-null-in-a/m-p/3297#M1177</guid>
      <dc:creator>viorelhojda</dc:creator>
      <dc:date>2017-01-19T10:11:42Z</dc:date>
    </item>
    <item>
      <title>Re: What are the reasons when expressions are not injected (null) in a service task delegate expression (Spring bean) ?</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/what-are-the-reasons-when-expressions-are-not-injected-null-in-a/m-p/3298#M1178</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;maybe you should define the scope of your bean as prototype.&lt;/P&gt;&lt;P&gt;Niklas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Jan 2017 10:56:50 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/what-are-the-reasons-when-expressions-are-not-injected-null-in-a/m-p/3298#M1178</guid>
      <dc:creator>nikmenke</dc:creator>
      <dc:date>2017-01-19T10:56:50Z</dc:date>
    </item>
    <item>
      <title>Re: What are the reasons when expressions are not injected (null) in a service task delegate expression (Spring bean) ?</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/what-are-the-reasons-when-expressions-are-not-injected-null-in-a/m-p/3299#M1179</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello, I tried that already,&amp;nbsp;that "only" means the bean won't be a Singleton with the implications regarding instantiating objects and therefore thread-safety. This doesn't solve the problem , the fields (Expressions) won't be injected in the bean, they will still be null.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Jan 2017 12:11:15 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/what-are-the-reasons-when-expressions-are-not-injected-null-in-a/m-p/3299#M1179</guid>
      <dc:creator>viorelhojda</dc:creator>
      <dc:date>2017-01-19T12:11:15Z</dc:date>
    </item>
    <item>
      <title>Re: What are the reasons when expressions are not injected (null) in a service task delegate expression (Spring bean) ?</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/what-are-the-reasons-when-expressions-are-not-injected-null-in-a/m-p/3300#M1180</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;yes i know. My thought was that the setter might not be called because the object was initialized before. The behaviour with a prototyped bean should be the same as using the class attribute of the service task.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have tested your code now with my engine. With version 6.0.0.Beta4 there is no problem getting your inserted value. Maybe you should consider to update your engine to a newer version than 5.9.&lt;/P&gt;&lt;P&gt;Niklas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Jan 2017 12:30:36 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/what-are-the-reasons-when-expressions-are-not-injected-null-in-a/m-p/3300#M1180</guid>
      <dc:creator>nikmenke</dc:creator>
      <dc:date>2017-01-19T12:30:36Z</dc:date>
    </item>
    <item>
      <title>Re: What are the reasons when expressions are not injected (null) in a service task delegate expression (Spring bean) ?</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/what-are-the-reasons-when-expressions-are-not-injected-null-in-a/m-p/3301#M1181</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you again for the interest, I will consider upgrading to 6 (I did try that also), the problem is I have to refactor a lot. Thanks again !&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Jan 2017 12:42:13 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/what-are-the-reasons-when-expressions-are-not-injected-null-in-a/m-p/3301#M1181</guid>
      <dc:creator>viorelhojda</dc:creator>
      <dc:date>2017-01-19T12:42:13Z</dc:date>
    </item>
    <item>
      <title>Re: What are the reasons when expressions are not injected (null) in a service task delegate expression (Spring bean) ?</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/what-are-the-reasons-when-expressions-are-not-injected-null-in-a/m-p/3302#M1182</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN&gt;Hello again, I did find a "workaround" though:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;1.create a "dummy" Spring&amp;nbsp;Bean &lt;STRONG&gt;simpleServiceBean &lt;/STRONG&gt;&amp;nbsp;with a method with 2 params, let's say callMethod(Object a, Object b); also, make sure the object t's serializable&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;2.add the bean to the process instance variables map when starting the process&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Object simpleServiceBean = this.getApplicationContext().getBean("simpleServiceBean");&lt;BR /&gt; vars.put("simpleServiceBean", simpleServiceBean);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;3.use the delegate class&amp;nbsp;as before,&amp;nbsp;&lt;SPAN style="color: #727174; background-color: #ffffff;"&gt;SimpleServiceTaskDelegate&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;4.in the execute method in&amp;nbsp;&lt;SPAN style="color: #727174; background-color: #ffffff;"&gt;SimpleServiceTaskDelegate, take the injected Expressions (members of the class), extract the&amp;nbsp;&lt;STRONG&gt;SimpleServiceTaskDelegate&lt;/STRONG&gt; from the execution and call the method with params:&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff; color: #727174;"&gt;Object fa = this.fieldA.getValue(execution);&lt;BR /&gt; Object fb = this.fieldB.getValue(execution);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff; color: #727174;"&gt;Object obj = execution.getVariable("simpleServiceBean");&lt;BR /&gt; SimpleServiceBean ssb = (SimpleServiceBean) obj;&lt;BR /&gt; ssb.callMethod(fa, fb);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff; color: #727174;"&gt;This works, but it isn't so pretty &lt;img id="smileysad" class="emoticon emoticon-smileysad" src="https://connect.hyland.com/i/smilies/16x16_smiley-sad.png" alt="Smiley Sad" title="Smiley Sad" /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Jan 2017 12:48:40 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/what-are-the-reasons-when-expressions-are-not-injected-null-in-a/m-p/3302#M1182</guid>
      <dc:creator>viorelhojda</dc:creator>
      <dc:date>2017-01-19T12:48:40Z</dc:date>
    </item>
    <item>
      <title>Re: What are the reasons when expressions are not injected (null) in a service task delegate expression (Spring bean) ?</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/what-are-the-reasons-when-expressions-are-not-injected-null-in-a/m-p/3303#M1183</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think the better workaround would be to use the expression attribute of the servicetask. There you could call the method with the two parameters of the spring bean. Something like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;serviceTask id="serviceTask" activiti:expression="${springBean.handleNotification(execution, &amp;amp;quot;hallo&amp;amp;quot&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;}"/&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Niklas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Jan 2017 13:13:03 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/what-are-the-reasons-when-expressions-are-not-injected-null-in-a/m-p/3303#M1183</guid>
      <dc:creator>nikmenke</dc:creator>
      <dc:date>2017-01-19T13:13:03Z</dc:date>
    </item>
    <item>
      <title>Re: What are the reasons when expressions are not injected (null) in a service task delegate expression (Spring bean) ?</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/what-are-the-reasons-when-expressions-are-not-injected-null-in-a/m-p/3304#M1184</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, I think it's a better approach, it's lighter since I don't have to put the Spring bean in the process instance variables.&lt;/P&gt;&lt;P&gt;It seems I have 3 options:&lt;/P&gt;&lt;P&gt;1.Activiti 6 with Java class delegate&lt;/P&gt;&lt;P&gt;2.Facade Spring Bean with Expression&amp;nbsp;delegate and delegate Java class&lt;/P&gt;&lt;P&gt;3.Call Spring bean code with Expression&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks again !&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Jan 2017 13:53:06 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/what-are-the-reasons-when-expressions-are-not-injected-null-in-a/m-p/3304#M1184</guid>
      <dc:creator>viorelhojda</dc:creator>
      <dc:date>2017-01-19T13:53:06Z</dc:date>
    </item>
  </channel>
</rss>

