<?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: Activiti Error Handling in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/activiti-error-handling/m-p/151228#M106002</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;1) You cannot make this work (reliably) without having a shared transaction-manager for activiti and your own entities, regardless of the technology (hibernat, jpa, plain JDBC, …).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;2) Activiti doesn't use hibernate for persistence…&lt;/SPAN&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 02 Oct 2013 09:33:07 GMT</pubDate>
    <dc:creator>frederikherema1</dc:creator>
    <dc:date>2013-10-02T09:33:07Z</dc:date>
    <item>
      <title>Activiti Error Handling</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/activiti-error-handling/m-p/151225#M105999</link>
      <description>What I have:Non-Activiti processes (saving to DB) in Activiti Service Task. I want to rollback Activiti context on errorWhat a problem:Activiti context doesn't rollback.My code:]In this service task I create new client entity and persist it. Client entity has Unique constraint, so the try{} section</description>
      <pubDate>Wed, 25 Sep 2013 15:09:02 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/activiti-error-handling/m-p/151225#M105999</guid>
      <dc:creator>fritz128</dc:creator>
      <dc:date>2013-09-25T15:09:02Z</dc:date>
    </item>
    <item>
      <title>Re: Activiti Error Handling</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/activiti-error-handling/m-p/151226#M106000</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I don't think any of your questions are asking the correct thing. The question is whether the hibernate session is running&amp;nbsp; in the same transaction as the activiti one. How did you configure that&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;How can you know that this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;code&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; Engine engine = Engine.getInstance();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;SessionFactory sessionFactory = engine.getHibernateSessionFactory();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;/code&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;is actually in the same transaction&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Sep 2013 17:11:18 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/activiti-error-handling/m-p/151226#M106000</guid>
      <dc:creator>jbarrez</dc:creator>
      <dc:date>2013-09-26T17:11:18Z</dc:date>
    </item>
    <item>
      <title>Re: Activiti Error Handling</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/activiti-error-handling/m-p/151227#M106001</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks for reply&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I need to rollback only Activiti's context.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;ul&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;li&amp;gt;&lt;/SPAN&gt;&lt;EM&gt;Can I make it work without common transaction manager for Activiti and Hibernate? &lt;/EM&gt;&lt;SPAN&gt;&amp;lt;/li&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;li&amp;gt;&lt;/SPAN&gt;&lt;EM&gt;How can I check that Activiti session factory == Engine.getInstance().getHibernateSessionFactory()? I mean some Activiti's method to get Activiti session factory or where to look at in debug. Please more details&lt;/EM&gt;&lt;SPAN&gt;&amp;lt;/li&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;/ul&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Sep 2013 07:21:27 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/activiti-error-handling/m-p/151227#M106001</guid>
      <dc:creator>fritz128</dc:creator>
      <dc:date>2013-09-27T07:21:27Z</dc:date>
    </item>
    <item>
      <title>Re: Activiti Error Handling</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/activiti-error-handling/m-p/151228#M106002</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;1) You cannot make this work (reliably) without having a shared transaction-manager for activiti and your own entities, regardless of the technology (hibernat, jpa, plain JDBC, …).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;2) Activiti doesn't use hibernate for persistence…&lt;/SPAN&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Oct 2013 09:33:07 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/activiti-error-handling/m-p/151228#M106002</guid>
      <dc:creator>frederikherema1</dc:creator>
      <dc:date>2013-10-02T09:33:07Z</dc:date>
    </item>
    <item>
      <title>Re: Activiti Error Handling</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/activiti-error-handling/m-p/151229#M106003</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Yes, but there are many examples in an internet, where Hibernate's trasaction manager bean are passed to ProcessEngineConfig bean. Is it deliberately wrong way?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;Please, see my question &lt;A href="http://forums.activiti.org/content/pass-hibernatesessionfactory-activiti-engine-configs" rel="nofollow noopener noreferrer"&gt;http://forums.activiti.org/content/pass-hibernatesessionfactory-activiti-engine-configs&lt;/A&gt;&lt;/STRONG&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Oct 2013 06:36:19 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/activiti-error-handling/m-p/151229#M106003</guid>
      <dc:creator>fritz128</dc:creator>
      <dc:date>2013-10-03T06:36:19Z</dc:date>
    </item>
    <item>
      <title>Re: Activiti Error Handling</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/activiti-error-handling/m-p/151230#M106004</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;If you're using the hibernate transaction manager as transaction-manager for Activiti, both activiti and your DB-stuff will get rollbacked when transaction rolls back (after error in hibernate or error in activiti execution).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If you DO NOT want your transaction to roll-back when something happens in activiti, don't use the same transaction-manager. However, in case that the activiti-transaction is comitted (and contains a reference to hibernate-entities you created) AND after that, the hibernate-transaction rolls back, you end up with variables in activiti referencing an unexisting entity in your DB. Not sure what the actual usacase is to NOT synchronize the transactions?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Oct 2013 08:09:54 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/activiti-error-handling/m-p/151230#M106004</guid>
      <dc:creator>frederikherema1</dc:creator>
      <dc:date>2013-10-03T08:09:54Z</dc:date>
    </item>
    <item>
      <title>Re: Activiti Error Handling</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/activiti-error-handling/m-p/151231#M106005</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;The point is that when I pass &lt;/SPAN&gt;&lt;EM&gt;HibernateTransactionManager&lt;/EM&gt;&lt;SPAN&gt; to both Activiti and application, it DOESN'T WORK. There are a lot of topics in the internet that&amp;nbsp; people face the same problem. It is very common issue. And there're any working example (I search a lot) that can confirm your words. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Can you provide me a very simple working demo with Activiti + Spring + common HibernateTransactionManager + &lt;/SPAN&gt;&lt;EM&gt;desirable with Postgres&lt;/EM&gt;&lt;SPAN&gt;? PLEASE!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;P.S.&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;In debug I can see that in service tasks Activiti call Context.getCommandContext().getDbSqlSession() that returns org.activiti.engine.impl.db.DbSqlSession instead of hibernate session&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;EM&gt;see the last comment in &lt;A href="http://forums.activiti.org/content/pass-hibernatesessionfactory-activiti-engine-configs" rel="nofollow noopener noreferrer"&gt;http://forums.activiti.org/content/pass-hibernatesessionfactory-activiti-engine-configs&lt;/A&gt; question&lt;/EM&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Oct 2013 11:23:34 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/activiti-error-handling/m-p/151231#M106005</guid>
      <dc:creator>fritz128</dc:creator>
      <dc:date>2013-10-04T11:23:34Z</dc:date>
    </item>
    <item>
      <title>Re: Activiti Error Handling</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/activiti-error-handling/m-p/151232#M106006</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;About the org.activiti.engine.impl.db.DbSqlSession versus the hibernate session: a hibernate-session is used to get Hibernate-entities from. The org.activiti.engine.impl.db.DbSqlSession is an internal session in activiti which gives access to SQL-functionality on top of mybatis. So the&amp;nbsp; hibernate session is really not relevant.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The only thing that is relevant is that, in case the HibernateTransactionManager is used, the underlying datasource returns the same SQL-connection as is used for the hibernate-operations. Can you please share your process-engine configuration (spring-context) so we can validate what settings you're using to accomplish this.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;There are a lot of topics in the internet that people face the same problem&lt;/BLOCKQUOTE&gt;&lt;SPAN&gt;Do you mean specifically using activity and hibernate together? Because in Alfresco 3.4.X, activiti was running with the hibernate transaction manager (as all entities USED to be hibernate in alfresco) without any issues and unit-tests to back that statement up… &lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Oct 2013 12:42:48 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/activiti-error-handling/m-p/151232#M106006</guid>
      <dc:creator>frederikherema1</dc:creator>
      <dc:date>2013-10-09T12:42:48Z</dc:date>
    </item>
    <item>
      <title>Re: Activiti Error Handling</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/activiti-error-handling/m-p/151233#M106007</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi, I have a question regarding activiti errors and transactions.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;As the userguide says, activities are executed within a DB transaction. If&amp;nbsp; techincal (RuntimeException) is thrown, then the transaction is rolled back leaving the process instance unchanged. Is this the case also when I throw BpmnError?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;My problem is that I cannot pass any meaningful error message to a user when an exception occurs, because the db transaction is rolled back, any process variable changes are unmade too. Db transaction must stay rolled back by the way, so that is ok to me. My only problem is how to store a message to show the user after an error?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Error boundary event would be good, but all the information I can pass is the error code which is not enough.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Obviously I could set variables in a new JTA transaction (I use JTA), but it's very inconvenient. Is there some support for my case?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;code&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;CommandExecutor commandExecutor = ((ProcessEngineImpl)processEngine).getProcessEngineConfiguration().getCommandExecutor();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; CommandConfig config = new CommandConfig().transactionRequiresNew();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; commandExecutor.execute(config, new Command&amp;lt;Object&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; public Object execute(CommandContext commandContext) {&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; // do my sh*t here&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; return null;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; });&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;/code&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;or using JTA transaction:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;code&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;JtaProcessEngineConfiguration jtaProcessEngineConfiguration = (JtaProcessEngineConfiguration) processEngineCfg;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;TransactionManager tm = jtaProcessEngineConfiguration.getTransactionManager();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;tm.suspend();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;tm.begin();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;// do my sh*t&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;tm.commit();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;tm.resume(tx);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;/code&amp;gt;&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 Mar 2014 08:09:58 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/activiti-error-handling/m-p/151233#M106007</guid>
      <dc:creator>pkonyves</dc:creator>
      <dc:date>2014-03-21T08:09:58Z</dc:date>
    </item>
    <item>
      <title>Re: Activiti Error Handling</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/activiti-error-handling/m-p/151234#M106008</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;When you are invoking the process instance synchronously and it executes synchronously you'll get the exception back in your calling application. And you can act on that based on the exception details. Doesn't that work for you?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 Mar 2014 16:01:32 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/activiti-error-handling/m-p/151234#M106008</guid>
      <dc:creator>trademak</dc:creator>
      <dc:date>2014-03-21T16:01:32Z</dc:date>
    </item>
    <item>
      <title>Re: Activiti Error Handling</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/activiti-error-handling/m-p/151235#M106009</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I would catch it if I could but we build a gui for Activiti with JSF. Processes have their own facelets for forms with complete buttons like h:commandButton action="BusinessProcess#completeTask(taskId)". I don't think it's the most practical way, but we didn't want to force workflows to use our own API, they can use standard Activiti API the same way Activiti in action describes the JSF integration. I am telling it because this excludes the idea of just wrapping the completeTask() method in a try-catch block.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I can catch the exception in the JSF ErrorHandler and show it to the user: OK. But also want to have it logged within the process to save this information as a process variable for later time. I don't want to do in the JSF ErrorHandler, because I would kill myself for making calls to the business tier from the "last rock" of my application, the ErrorHandler, totally out the JSF lifecycle etc.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I could probably automate this behavior with a custom CommandInterceptor… Anyways, if you don't have a better idea, I think a new transaction is fine.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;ps.: You still mentioned synchronously, but I also want it to work on async tasks&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 Mar 2014 23:07:21 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/activiti-error-handling/m-p/151235#M106009</guid>
      <dc:creator>pkonyves</dc:creator>
      <dc:date>2014-03-21T23:07:21Z</dc:date>
    </item>
  </channel>
</rss>

