<?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 Java Service Task implementation in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/java-service-task-implementation/m-p/74654#M48929</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;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.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Pasting my BPMN file for reference :-&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;?xml version="1.0" encoding="UTF-8"?&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;definitions xmlns="&lt;/SPAN&gt;&lt;A href="http://www.omg.org/spec/BPMN/20100524/MODEL" rel="nofollow noopener noreferrer"&gt;http://www.omg.org/spec/BPMN/20100524/MODEL&lt;/A&gt;&lt;SPAN&gt;" xmlns:xsi="&lt;/SPAN&gt;&lt;A href="http://www.w3.org/2001/XMLSchema-instance" rel="nofollow noopener noreferrer"&gt;http://www.w3.org/2001/XMLSchema-instance&lt;/A&gt;&lt;SPAN&gt;" xmlns:activiti="&lt;/SPAN&gt;&lt;A href="http://activiti.org/bpmn" rel="nofollow noopener noreferrer"&gt;http://activiti.org/bpmn&lt;/A&gt;&lt;SPAN&gt;" xmlns:bpmndi="&lt;/SPAN&gt;&lt;A href="http://www.omg.org/spec/BPMN/20100524/DI" rel="nofollow noopener noreferrer"&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 href="http://www.omg.org/spec/DD/20100524/DC" rel="nofollow noopener noreferrer"&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 href="http://www.omg.org/spec/DD/20100524/DI" rel="nofollow noopener noreferrer"&gt;http://www.omg.org/spec/DD/20100524/DI&lt;/A&gt;&lt;SPAN&gt;" typeLanguage="&lt;/SPAN&gt;&lt;A href="http://www.w3.org/2001/XMLSchema" rel="nofollow noopener noreferrer"&gt;http://www.w3.org/2001/XMLSchema&lt;/A&gt;&lt;SPAN&gt;" expressionLanguage="&lt;/SPAN&gt;&lt;A href="http://www.w3.org/1999/XPath" rel="nofollow noopener noreferrer"&gt;http://www.w3.org/1999/XPath&lt;/A&gt;&lt;SPAN&gt;" targetNamespace="&lt;/SPAN&gt;&lt;A href="http://www.activiti.org/test" rel="nofollow noopener noreferrer"&gt;http://www.activiti.org/test&lt;/A&gt;&lt;SPAN&gt;"&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;lt;process id="LoanActiviti" name="LoanActiviti"&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;documentation&amp;gt;Place documentation for the 'LoanActiviti' process here.&amp;lt;/documentation&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;startEvent id="startevent1" name="Start"&amp;gt;&amp;lt;/startEvent&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;serviceTask id="servicetask1" name="Service Task" activiti:class="org.activiti.examples.bpmn.servicetask.SysoutDelegate"&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;extensionElements&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;activiti:field name="customerNameVar"&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;activiti:expression&amp;gt;${customerNameVar}&amp;lt;/activiti:expression&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/activiti:field&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/extensionElements&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/serviceTask&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;userTask id="usertask1" name="User Task" activiti:assignee="management"&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;extensionElements&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;activiti:formProperty id="customerName" name="Customer name" type="string" variable="${customerNameVar}"&amp;gt;&amp;lt;/activiti:formProperty&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/extensionElements&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/userTask&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;endEvent id="endevent1" name="End"&amp;gt;&amp;lt;/endEvent&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;sequenceFlow id="flow1" name="" sourceRef="startevent1" targetRef="servicetask1"&amp;gt;&amp;lt;/sequenceFlow&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;sequenceFlow id="flow2" name="" sourceRef="servicetask1" targetRef="usertask1"&amp;gt;&amp;lt;/sequenceFlow&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;sequenceFlow id="flow3" name="" sourceRef="usertask1" targetRef="endevent1"&amp;gt;&amp;lt;/sequenceFlow&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;lt;/process&amp;gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;/definitions&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Also when i put field value in service task it gives below error :-&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;com.vaadin.event.ListenerMethod$MethodException&lt;/SPAN&gt;&lt;BR /&gt;&lt;STRONG&gt;Cause: org.activiti.engine.ActivitiException: Field definition uses unexisting field &lt;/STRONG&gt;&lt;SPAN&gt;'customerNameVar' on class org.activiti.examples.bpmn.servicetask.SysoutDelegate&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;at com.vaadin.event.ListenerMethod.receiveEvent(ListenerMethod.java:510)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;at com.vaadin.event.EventRouter.fireEvent(EventRouter.java:164)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;at com.vaadin.ui.AbstractComponent.fireEvent(AbstractComponent.java:1193)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;at com.vaadin.ui.Button.fireClick(Button.java:539)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Please tell me if i am doing it in correct way.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 07 Dec 2011 11:52:54 GMT</pubDate>
    <dc:creator>prabhjot</dc:creator>
    <dc:date>2011-12-07T11:52:54Z</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>

