<?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: Execution of JavaServiceTask via variable in Alfresco Forum</title>
    <link>https://connect.hyland.com/t5/alfresco-forum/execution-of-javaservicetask-via-variable/m-p/34496#M14554</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="color: #727174; background-color: #ffffff; border: 0px;"&gt;assignee is my process variable and I have set the value of assignee to "&lt;SPAN style="color: #727174; background-color: #ffffff; border: 0px; font-weight: inherit;"&gt;LineManagerCompletionService&lt;/SPAN&gt;"&lt;/P&gt;&lt;P style="color: #727174; background-color: #ffffff; border: 0px;"&gt;&lt;SPAN style="color: #727174; background-color: #ffffff; border: 0px; font-weight: inherit;"&gt;&amp;lt;dataObject id="assignee" name="assignee" itemSubjectRef="xsd:string"&amp;gt;&lt;/SPAN&gt;&lt;BR style="color: #727174; background-color: #ffffff;" /&gt;&lt;SPAN style="color: #727174; background-color: #ffffff; border: 0px; font-weight: inherit;"&gt;&amp;lt;extensionElements&amp;gt;&lt;/SPAN&gt;&lt;BR style="color: #727174; background-color: #ffffff;" /&gt;&lt;SPAN style="color: #727174; background-color: #ffffff; border: 0px; font-weight: inherit;"&gt;&amp;lt;activiti:value&amp;gt;LineManagerCompletionService&amp;lt;/activiti:value&amp;gt;&lt;/SPAN&gt;&lt;BR style="color: #727174; background-color: #ffffff;" /&gt;&lt;SPAN style="color: #727174; background-color: #ffffff; border: 0px; font-weight: inherit;"&gt;&amp;lt;/extensionElements&amp;gt;&lt;/SPAN&gt;&lt;BR style="color: #727174; background-color: #ffffff;" /&gt;&lt;SPAN style="color: #727174; background-color: #ffffff; border: 0px; font-weight: inherit;"&gt;&amp;lt;/dataObject&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #727174; background-color: #ffffff; border: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="color: #727174; background-color: #ffffff; border: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="color: #727174; background-color: #ffffff; border: 0px;"&gt;When I put DelegateExpression = ${&lt;SPAN style="color: #727174; background-color: #ffffff; border: 0px; font-weight: inherit;"&gt;LineManagerCompletionService&lt;/SPAN&gt;}. It works.(Case 1 in my example)&lt;/P&gt;&lt;P style="color: #727174; background-color: #ffffff; border: 0px;"&gt;But when I put DelegateExpression = ${assignee} i get this error. (Case 2 in my example)&lt;/P&gt;&lt;P style="color: #727174; background-color: #ffffff; border: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="color: #727174; background-color: #ffffff; border: 0px;"&gt;Basically I want to execute the service task based on process variable value, which can be initialized at the start of process. &amp;nbsp;So that I dont have to create multiple workflow defn only because my service task is different.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 23 Mar 2017 13:13:39 GMT</pubDate>
    <dc:creator>anandvivek</dc:creator>
    <dc:date>2017-03-23T13:13:39Z</dc:date>
    <item>
      <title>Execution of JavaServiceTask via variable</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/execution-of-javaservicetask-via-variable/m-p/34494#M14552</link>
      <description>Hi, I am trying to execute the service task via variable.When I am using literal in the service task it works. But when I assign the variable with the same literal&amp;nbsp;it doesnt work.CASE 1: Using literal in delegateExpressionBelow is an exampleProcess XML&amp;lt;?xml version="1.0" encoding="UTF-8"?&amp;gt;&amp;lt;</description>
      <pubDate>Thu, 23 Mar 2017 10:33:57 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/execution-of-javaservicetask-via-variable/m-p/34494#M14552</guid>
      <dc:creator>anandvivek</dc:creator>
      <dc:date>2017-03-23T10:33:57Z</dc:date>
    </item>
    <item>
      <title>Re: Execution of JavaServiceTask via variable</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/execution-of-javaservicetask-via-variable/m-p/34495#M14553</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;A delegateExpression, as the name implies, must implement the JavaDelegate or ActivitiBehavior interface.&lt;/P&gt;&lt;P&gt;Obviously the ${assignee} expression doent resolve to such a class.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am not sure what your ${assignee} class actually resolves to so cannot offer a solution, but you may consider using an Expression rather than a DelegateExpression.&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>Thu, 23 Mar 2017 12:01:37 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/execution-of-javaservicetask-via-variable/m-p/34495#M14553</guid>
      <dc:creator>gdharley</dc:creator>
      <dc:date>2017-03-23T12:01:37Z</dc:date>
    </item>
    <item>
      <title>Re: Execution of JavaServiceTask via variable</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/execution-of-javaservicetask-via-variable/m-p/34496#M14554</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="color: #727174; background-color: #ffffff; border: 0px;"&gt;assignee is my process variable and I have set the value of assignee to "&lt;SPAN style="color: #727174; background-color: #ffffff; border: 0px; font-weight: inherit;"&gt;LineManagerCompletionService&lt;/SPAN&gt;"&lt;/P&gt;&lt;P style="color: #727174; background-color: #ffffff; border: 0px;"&gt;&lt;SPAN style="color: #727174; background-color: #ffffff; border: 0px; font-weight: inherit;"&gt;&amp;lt;dataObject id="assignee" name="assignee" itemSubjectRef="xsd:string"&amp;gt;&lt;/SPAN&gt;&lt;BR style="color: #727174; background-color: #ffffff;" /&gt;&lt;SPAN style="color: #727174; background-color: #ffffff; border: 0px; font-weight: inherit;"&gt;&amp;lt;extensionElements&amp;gt;&lt;/SPAN&gt;&lt;BR style="color: #727174; background-color: #ffffff;" /&gt;&lt;SPAN style="color: #727174; background-color: #ffffff; border: 0px; font-weight: inherit;"&gt;&amp;lt;activiti:value&amp;gt;LineManagerCompletionService&amp;lt;/activiti:value&amp;gt;&lt;/SPAN&gt;&lt;BR style="color: #727174; background-color: #ffffff;" /&gt;&lt;SPAN style="color: #727174; background-color: #ffffff; border: 0px; font-weight: inherit;"&gt;&amp;lt;/extensionElements&amp;gt;&lt;/SPAN&gt;&lt;BR style="color: #727174; background-color: #ffffff;" /&gt;&lt;SPAN style="color: #727174; background-color: #ffffff; border: 0px; font-weight: inherit;"&gt;&amp;lt;/dataObject&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #727174; background-color: #ffffff; border: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="color: #727174; background-color: #ffffff; border: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="color: #727174; background-color: #ffffff; border: 0px;"&gt;When I put DelegateExpression = ${&lt;SPAN style="color: #727174; background-color: #ffffff; border: 0px; font-weight: inherit;"&gt;LineManagerCompletionService&lt;/SPAN&gt;}. It works.(Case 1 in my example)&lt;/P&gt;&lt;P style="color: #727174; background-color: #ffffff; border: 0px;"&gt;But when I put DelegateExpression = ${assignee} i get this error. (Case 2 in my example)&lt;/P&gt;&lt;P style="color: #727174; background-color: #ffffff; border: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="color: #727174; background-color: #ffffff; border: 0px;"&gt;Basically I want to execute the service task based on process variable value, which can be initialized at the start of process. &amp;nbsp;So that I dont have to create multiple workflow defn only because my service task is different.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Mar 2017 13:13:39 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/execution-of-javaservicetask-via-variable/m-p/34496#M14554</guid>
      <dc:creator>anandvivek</dc:creator>
      <dc:date>2017-03-23T13:13:39Z</dc:date>
    </item>
    <item>
      <title>Re: Execution of JavaServiceTask via variable</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/execution-of-javaservicetask-via-variable/m-p/34497#M14555</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yeah, what you need to do is use the&amp;nbsp;working syntax:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #727174; background-color: #ffffff;"&gt;&amp;lt;serviceTask id="servicetask1" name="Service Task" activiti:delegateExpression="${LineManagerCompletionService}"&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #727174; background-color: #ffffff;"&gt;And add the assignee as an input property. Simple enough to do and the users guide has examples as well as the test suite.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #727174; background-color: #ffffff;"&gt;Greg&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Mar 2017 14:45:39 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/execution-of-javaservicetask-via-variable/m-p/34497#M14555</guid>
      <dc:creator>gdharley</dc:creator>
      <dc:date>2017-03-23T14:45:39Z</dc:date>
    </item>
    <item>
      <title>Re: Execution of JavaServiceTask via variable</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/execution-of-javaservicetask-via-variable/m-p/34498#M14556</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Greg,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks a lot for reply. Not sure if I explained my problem correctly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am &lt;STRONG&gt;NOT&lt;/STRONG&gt;&amp;nbsp;trying to do field injection. My problem is quite different.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For e.g. I have&amp;nbsp;more than one Class which implements JavaDelegate.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="color: #727174; background-color: #ffffff; border: 0px;"&gt;@Named("LineManagerCompletionService1")&lt;BR /&gt;public class LineManagerCompletionService1 implements JavaDelegate {&lt;/P&gt;&lt;P style="color: #727174; background-color: #ffffff; border: 0px;"&gt;@Override&lt;BR /&gt;public void execute(DelegateExecution execution) throws Exception {&lt;BR /&gt;System.out.println("******Saving LM Decision=====1******");&lt;BR /&gt;}&lt;/P&gt;&lt;P style="color: #727174; background-color: #ffffff; border: 0px;"&gt;}&lt;/P&gt;&lt;P style="color: #727174; background-color: #ffffff; border: 0px;"&gt;&lt;/P&gt;&lt;P style="border: 0px;"&gt;@Named("LineManagerCompletionService2")&lt;BR /&gt;public class LineManagerCompletionService2 implements JavaDelegate {&lt;/P&gt;&lt;P style="border: 0px;"&gt;@Override&lt;BR /&gt;public void execute(DelegateExecution execution) throws Exception {&lt;BR /&gt;System.out.println("******Saving LM Decision=====2******");&lt;BR /&gt;}&lt;/P&gt;&lt;P style="border: 0px;"&gt;}&lt;/P&gt;&lt;P style="border: 0px;"&gt;&lt;/P&gt;&lt;P style="border: 0px;"&gt;&lt;/P&gt;&lt;P style="color: #727174; background-color: #ffffff; border: 0px;"&gt;@Named("LineManagerCompletionService3")&lt;BR /&gt;public class LineManagerCompletionService3 implements JavaDelegate {&lt;/P&gt;&lt;P style="color: #727174; background-color: #ffffff; border: 0px;"&gt;@Override&lt;BR /&gt;public void execute(DelegateExecution execution) throws Exception {&lt;BR /&gt;System.out.println("******Saving LM Decision====3******");&lt;BR /&gt;}&lt;/P&gt;&lt;P style="color: #727174; background-color: #ffffff; border: 0px;"&gt;}&lt;/P&gt;&lt;P style="color: #727174; background-color: #ffffff; border: 0px;"&gt;&lt;/P&gt;&lt;P style="color: #727174; background-color: #ffffff; border: 0px;"&gt;And I want to execute any of the&amp;nbsp;different &amp;nbsp;beans(bean name can be provided as input parameter at start of the workflow) from same JAVA Service tasks without &lt;STRONG&gt;modifying&lt;/STRONG&gt; my process defn.&lt;/P&gt;&lt;P style="color: #727174; background-color: #ffffff; border: 0px;"&gt;I hope this makes this clear now. Also can you please point me where its exactly mentioned in User Guide?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Mar 2017 07:47:53 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/execution-of-javaservicetask-via-variable/m-p/34498#M14556</guid>
      <dc:creator>anandvivek</dc:creator>
      <dc:date>2017-03-24T07:47:53Z</dc:date>
    </item>
    <item>
      <title>Re: Execution of JavaServiceTask via variable</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/execution-of-javaservicetask-via-variable/m-p/34499#M14557</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Wow, interesting approach.&lt;/P&gt;&lt;P&gt;I haven't tested it, but from your description I do believe this approach should actually work.&lt;/P&gt;&lt;P&gt;Make sure the Object associated with the variable is actually the bean and not simply the name of the bean. If it is just the name of the bean the expression will resolve a string type and you will get the error you are seeing.&lt;/P&gt;&lt;P&gt;If it is the actual bean : execution;setVariable("assignee", myBean);&lt;/P&gt;&lt;P&gt;Then I dont see why this doesnt work.&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;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Mar 2017 14:49:16 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/execution-of-javaservicetask-via-variable/m-p/34499#M14557</guid>
      <dc:creator>gdharley</dc:creator>
      <dc:date>2017-03-24T14:49:16Z</dc:date>
    </item>
  </channel>
</rss>

