<?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: Update custom tables along with Activiti Tables in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/update-custom-tables-along-with-activiti-tables/m-p/239346#M192476</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;This is my execution listener.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;public class TMCWFNotificationListener implements ExecutionListener {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; private Expression assignedTo;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; private Expression message;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; private Expression ds;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt; Logger logger =&amp;nbsp; LoggerFactory.getLogger(TMCWFNotificationListener.class);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; @Override&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; public void notify(DelegateExecution arg0) throws Exception{&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; // TODO Auto-generated method stub&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; int entityId = 0;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; String assignee = "",messageval = "";&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; NotificationObject notifyObj = new NotificationObject();&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; WorkflowDbDAOImpl jdbcDAO = (WorkflowDbDAOImpl) ds.getValue(arg0);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; String entityIdString = (String) arg0.getVariable("EntityId");&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; notifyObj.setEntitytype(entityType); &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; notifyObj.setEntityid(entityId);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; notifyObj.setAssignedto(assignee);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; notifyObj.setMessage(messageval);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; logger.info("Inside notification Listener");&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; jdbcDAO.insertNotifications(notifyObj);&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; }&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am injecting the values to this is listener from my Process.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;ds - ${workflowDbDAO}&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;assignedTo ${reminderobj.email}&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;message - Reminder - ${stepMessage} Notification&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 20 Jun 2016 14:05:26 GMT</pubDate>
    <dc:creator>subashini</dc:creator>
    <dc:date>2016-06-20T14:05:26Z</dc:date>
    <item>
      <title>Update custom tables along with Activiti Tables</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/update-custom-tables-along-with-activiti-tables/m-p/239342#M192472</link>
      <description>We are updating custom table using listener in the user task, service task and Email task , as part of our workflow. We are using the same transaction manager for both Activiti and the Custom tables. But even then, when there is a error in the listener, Activiti is not getting committed, but the loc</description>
      <pubDate>Mon, 06 Jun 2016 14:14:42 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/update-custom-tables-along-with-activiti-tables/m-p/239342#M192472</guid>
      <dc:creator>subashini</dc:creator>
      <dc:date>2016-06-06T14:14:42Z</dc:date>
    </item>
    <item>
      <title>Re: Update custom tables along with Activiti Tables</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/update-custom-tables-along-with-activiti-tables/m-p/239343#M192473</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I would prefer going for a service task if there are chances of exception in task listeners. &lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Jun 2016 05:13:13 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/update-custom-tables-along-with-activiti-tables/m-p/239343#M192473</guid>
      <dc:creator>hari</dc:creator>
      <dc:date>2016-06-08T05:13:13Z</dc:date>
    </item>
    <item>
      <title>Re: Update custom tables along with Activiti Tables</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/update-custom-tables-along-with-activiti-tables/m-p/239344#M192474</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;The same behavior is seen for service task.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Jun 2016 14:26:08 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/update-custom-tables-along-with-activiti-tables/m-p/239344#M192474</guid>
      <dc:creator>subashini</dc:creator>
      <dc:date>2016-06-08T14:26:08Z</dc:date>
    </item>
    <item>
      <title>Re: Update custom tables along with Activiti Tables</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/update-custom-tables-along-with-activiti-tables/m-p/239345#M192475</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Can you post your delegate? Is it a Spring bean? Are the other services injected into it?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;A process xml would also help.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Jun 2016 12:01:12 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/update-custom-tables-along-with-activiti-tables/m-p/239345#M192475</guid>
      <dc:creator>jbarrez</dc:creator>
      <dc:date>2016-06-20T12:01:12Z</dc:date>
    </item>
    <item>
      <title>Re: Update custom tables along with Activiti Tables</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/update-custom-tables-along-with-activiti-tables/m-p/239346#M192476</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;This is my execution listener.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;public class TMCWFNotificationListener implements ExecutionListener {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; private Expression assignedTo;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; private Expression message;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; private Expression ds;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt; Logger logger =&amp;nbsp; LoggerFactory.getLogger(TMCWFNotificationListener.class);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; @Override&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; public void notify(DelegateExecution arg0) throws Exception{&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; // TODO Auto-generated method stub&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; int entityId = 0;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; String assignee = "",messageval = "";&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; NotificationObject notifyObj = new NotificationObject();&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; WorkflowDbDAOImpl jdbcDAO = (WorkflowDbDAOImpl) ds.getValue(arg0);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; String entityIdString = (String) arg0.getVariable("EntityId");&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; notifyObj.setEntitytype(entityType); &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; notifyObj.setEntityid(entityId);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; notifyObj.setAssignedto(assignee);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; notifyObj.setMessage(messageval);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; logger.info("Inside notification Listener");&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; jdbcDAO.insertNotifications(notifyObj);&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; }&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am injecting the values to this is listener from my Process.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;ds - ${workflowDbDAO}&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;assignedTo ${reminderobj.email}&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;message - Reminder - ${stepMessage} Notification&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Jun 2016 14:05:26 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/update-custom-tables-along-with-activiti-tables/m-p/239346#M192476</guid>
      <dc:creator>subashini</dc:creator>
      <dc:date>2016-06-20T14:05:26Z</dc:date>
    </item>
    <item>
      <title>Re: Update custom tables along with Activiti Tables</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/update-custom-tables-along-with-activiti-tables/m-p/239347#M192477</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I had similar questions. In my case, I was using Spring boot application. I was using a transactionManager auto injected with my data source pointing to my tables. The transaction manager is a JPATransactionManager implementation. I was updating the tables in the event listeners. The same transaction manager along with a datasource pointing to activiti tables was passed to initialize the SpringProcessEngineConfiguration. The behavior is proper and working fine. The activiti engine underneath it uses Mybatis and uses the datasource passed to it accordingly. But my question is that how we can use the same transaction manager for two different data sources. The Spring documentation says that JpaTransactionManager must be used with one datasource. I have asked this question here - &lt;/SPAN&gt;&lt;A href="https://forums.activiti.org/content/multiple-data-sources-activiti" rel="nofollow noopener noreferrer"&gt;https://forums.activiti.org/content/multiple-data-sources-activiti&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In your case, you are using the same datsource for both the updates i.e. your tables as well as activiti. Basically you have defined your tables in the same schema as the activiti. In my case, I have defined the tables in different schemas respectively for activiti and my tables. &lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Jun 2016 21:50:31 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/update-custom-tables-along-with-activiti-tables/m-p/239347#M192477</guid>
      <dc:creator>davanna</dc:creator>
      <dc:date>2016-06-20T21:50:31Z</dc:date>
    </item>
    <item>
      <title>Re: Update custom tables along with Activiti Tables</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/update-custom-tables-along-with-activiti-tables/m-p/239348#M192478</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thank you for sharing your use case. I am using just a single datasource, but still the transactions are getting committed seperately. Initially, we used seperate data source. Then I modified to use the same datasource, but still it is not working. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;How did you inject the transaction manager to the event listeners?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Jun 2016 14:37:28 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/update-custom-tables-along-with-activiti-tables/m-p/239348#M192478</guid>
      <dc:creator>subashini</dc:creator>
      <dc:date>2016-06-21T14:37:28Z</dc:date>
    </item>
    <item>
      <title>Re: Update custom tables along with Activiti Tables</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/update-custom-tables-along-with-activiti-tables/m-p/239349#M192479</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Your TMCWFNotificationListener needs to be a spring bean too … or it won't participate in the same transaction. You need to reference it in your process via an expression. And then you can simply @AutoWired your dependencies like the DAO class you're using.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Jun 2016 08:22:59 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/update-custom-tables-along-with-activiti-tables/m-p/239349#M192479</guid>
      <dc:creator>jbarrez</dc:creator>
      <dc:date>2016-06-22T08:22:59Z</dc:date>
    </item>
  </channel>
</rss>

