<?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: Java Service Task implementation in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/java-service-task-implementation/m-p/74655#M48930</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Does your class SysoutDelegate have a field named "customerNameVar".&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;From what I understand you are trying to inject a value into a field of this class, but this field does not exist.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;From the user guide.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;The following code snippet shows how to inject a constant value into a field. Field injection is supported when using the 'class' attribute. Note that we need to declare a 'extensionElements' XML element before the actual field injection declarations, which is a requirement of the BPMN 2.0 XML Schema.&lt;BR /&gt;&lt;BR /&gt;&amp;lt;serviceTask id="javaService" &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; name="Java service invocation" &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; activiti:class="org.activiti.examples.bpmn.servicetask.ToUpperCaseFieldInjected"&amp;gt;&lt;BR /&gt;&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;lt;activiti:field name="text" stringValue="Hello World" /&amp;gt;&lt;BR /&gt;&amp;nbsp; &amp;lt;/extensionElements&amp;gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;&amp;lt;/serviceTask&amp;gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;&lt;BR /&gt;The class ToUpperCaseFieldInjected has a field text which is of type org.activiti.engine.delegate.Expression. When calling text.getValue(execution), the configured string value Hello World will be returned.&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 07 Dec 2011 13:58:27 GMT</pubDate>
    <dc:creator>swapnonil</dc:creator>
    <dc:date>2011-12-07T13:58:27Z</dc:date>
    <item>
      <title>Java Service Task implementation</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/java-service-task-implementation/m-p/74654#M48929</link>
      <description>Trying to implement a workflow in which it will have a Java service task in which i am fetching data from mysql DB and then i have user task which will have form where i need to populate all fields with data coming from Service task . Please tell me how to forward data from Service task to user task</description>
      <pubDate>Wed, 07 Dec 2011 11:52:54 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/java-service-task-implementation/m-p/74654#M48929</guid>
      <dc:creator>prabhjot</dc:creator>
      <dc:date>2011-12-07T11:52:54Z</dc:date>
    </item>
    <item>
      <title>Re: Java Service Task implementation</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/java-service-task-implementation/m-p/74655#M48930</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Does your class SysoutDelegate have a field named "customerNameVar".&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;From what I understand you are trying to inject a value into a field of this class, but this field does not exist.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;From the user guide.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;The following code snippet shows how to inject a constant value into a field. Field injection is supported when using the 'class' attribute. Note that we need to declare a 'extensionElements' XML element before the actual field injection declarations, which is a requirement of the BPMN 2.0 XML Schema.&lt;BR /&gt;&lt;BR /&gt;&amp;lt;serviceTask id="javaService" &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; name="Java service invocation" &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; activiti:class="org.activiti.examples.bpmn.servicetask.ToUpperCaseFieldInjected"&amp;gt;&lt;BR /&gt;&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;lt;activiti:field name="text" stringValue="Hello World" /&amp;gt;&lt;BR /&gt;&amp;nbsp; &amp;lt;/extensionElements&amp;gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;&amp;lt;/serviceTask&amp;gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;&lt;BR /&gt;The class ToUpperCaseFieldInjected has a field text which is of type org.activiti.engine.delegate.Expression. When calling text.getValue(execution), the configured string value Hello World will be returned.&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Dec 2011 13:58:27 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/java-service-task-implementation/m-p/74655#M48930</guid>
      <dc:creator>swapnonil</dc:creator>
      <dc:date>2011-12-07T13:58:27Z</dc:date>
    </item>
    <item>
      <title>Re: Java Service Task implementation</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/java-service-task-implementation/m-p/74656#M48931</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;What i am trying to do is Getting Data from Mysql database in Java service task (Sysoutdelegate.java) and then trying to print those data to User task . how can i achieve this ?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Like i got name in customerNameVar variable from database and i want that to print that name in User Task but i am not able to do it . What approach i should follow for the same .&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Dec 2011 04:38:52 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/java-service-task-implementation/m-p/74656#M48931</guid>
      <dc:creator>prabhjot</dc:creator>
      <dc:date>2011-12-08T04:38:52Z</dc:date>
    </item>
    <item>
      <title>Re: Java Service Task implementation</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/java-service-task-implementation/m-p/74657#M48932</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi. As I understand you retrieve data from MySQL in the Service Task Delegate and want to assign the data to a process variable, which data you later access in the User Task.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;In the UserGuide there is documentation how to assign data to the process Execution, see &lt;/SPAN&gt;&lt;A href="http://www.activiti.org/userguide/index.html#bpmnJavaServiceTask" rel="nofollow noopener noreferrer"&gt;BPMN 2.0 Constructs - Java Service Task - Implementation&lt;/A&gt;&lt;SPAN&gt; (execution.setVariable("myData",&amp;nbsp; var)). You might also work with JPA entities if you do anyway.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;To access the process variables in following external code (like your User Task UI), perhaps you can use something like &lt;/SPAN&gt;&lt;BR /&gt;&lt;CODE&gt;Object data = runtimeService.getVariable(processInstance.getId(), "myData");&lt;/CODE&gt;&lt;SPAN&gt; (not sure if that's the best usage).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regarding your exception, @swapnonil already pointed you to the possible problem: ensure you already have set the process variable "customerNameVar" before the Service Task and that a your Delegate has a field of name "customerNameVar" of type org.activiti.engine.delegate.Expression, so the injection as defined in your process is possible.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Dec 2011 08:47:02 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/java-service-task-implementation/m-p/74657#M48932</guid>
      <dc:creator>aziesi</dc:creator>
      <dc:date>2011-12-08T08:47:02Z</dc:date>
    </item>
  </channel>
</rss>

