<?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: How to verify user task assignment at runtime? in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/how-to-verify-user-task-assignment-at-runtime/m-p/52855#M31154</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks for your reply. I get the approach but to obtain the user id of the executed task I need to use the History service provided by the Activiti Engine . History service can be accessed via the instance of Process engine using getHistoryService();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;How do I obtain the instance of process engine inside the task listener? I am not sure if my understanding is correct. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Please guide me!!!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 04 May 2011 18:29:40 GMT</pubDate>
    <dc:creator>raj1</dc:creator>
    <dc:date>2011-05-04T18:29:40Z</dc:date>
    <item>
      <title>How to verify user task assignment at runtime?</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/how-to-verify-user-task-assignment-at-runtime/m-p/52853#M31152</link>
      <description>I have a Business Process with two user tasks ut1 and ut2 namely. Both usertasks have same candidate group Management. After deploying the process, at runtime, the requirement is to ensure that usertasks ut1 and ut2 are preformed by different users in the Candidate groups Management. For e.g.&amp;nbsp; if Ke</description>
      <pubDate>Wed, 04 May 2011 12:03:33 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/how-to-verify-user-task-assignment-at-runtime/m-p/52853#M31152</guid>
      <dc:creator>raj1</dc:creator>
      <dc:date>2011-05-04T12:03:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to verify user task assignment at runtime?</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/how-to-verify-user-task-assignment-at-runtime/m-p/52854#M31153</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;i was just looking at this recently, what you describe is the four-eyes principle (but can be extended to any number of eyes really)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;CODE&gt;&lt;BR /&gt;&amp;lt;userTask id="payment_execute" name="Execute Payment" &amp;gt;&lt;BR /&gt;&amp;nbsp; &amp;lt;extensionElements&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;!– upon task creation the listener is called –&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;activiti:taskListener event="create" class="my.FourEyesTaskListener"&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;!– here we set the id of the other task –&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;activiti:field name="fourEyesTask" stringValue="payment_approve" /&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/activiti:taskListener&amp;gt;&lt;BR /&gt;&amp;nbsp; &amp;lt;/extensionElements&amp;gt;&lt;BR /&gt;&amp;lt;/userTask&amp;gt;&lt;BR /&gt;&lt;/CODE&gt;&lt;BR /&gt;&lt;SPAN&gt;and the task listener something like&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;CODE&gt;&lt;BR /&gt;public class FourEyesTaskListener implements TaskListener {&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp; // injected by activiti&lt;BR /&gt;&amp;nbsp; private String fourEyesTask;&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp; // see &lt;A href="http://www.activiti.org/javadocs/org/activiti/engine/delegate/DelegateTask.html" rel="nofollow noopener noreferrer"&gt;http://www.activiti.org/javadocs/org/activiti/engine/delegate/DelegateTask.html&lt;/A&gt;&lt;BR /&gt;&amp;nbsp; public void notify(DelegateTask delegateTask) {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // find out the user id that executed the four eyes task &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; String userId = ….&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; //&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; delegateTask.deleteCandidateUser(userId);&lt;BR /&gt;&amp;nbsp; }&lt;BR /&gt;}&lt;BR /&gt;&lt;/CODE&gt;&lt;BR /&gt;&lt;SPAN&gt;so yes pretty much as you describe it but i would use deleteCandidateUser instead of unassign so that the second user would never even see the task for assignment, and also the listener runs on 'create' event instead of 'assignment'.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;HTH&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Jorg&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 May 2011 13:02:30 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/how-to-verify-user-task-assignment-at-runtime/m-p/52854#M31153</guid>
      <dc:creator>heymjo</dc:creator>
      <dc:date>2011-05-04T13:02:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to verify user task assignment at runtime?</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/how-to-verify-user-task-assignment-at-runtime/m-p/52855#M31154</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks for your reply. I get the approach but to obtain the user id of the executed task I need to use the History service provided by the Activiti Engine . History service can be accessed via the instance of Process engine using getHistoryService();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;How do I obtain the instance of process engine inside the task listener? I am not sure if my understanding is correct. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Please guide me!!!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 May 2011 18:29:40 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/how-to-verify-user-task-assignment-at-runtime/m-p/52855#M31154</guid>
      <dc:creator>raj1</dc:creator>
      <dc:date>2011-05-04T18:29:40Z</dc:date>
    </item>
    <item>
      <title>Re: How to verify user task assignment at runtime?</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/how-to-verify-user-task-assignment-at-runtime/m-p/52856#M31155</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Well if you use Spring you can make the listener a managed bean and have it wire the historyservice to the listener.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 May 2011 07:09:25 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/how-to-verify-user-task-assignment-at-runtime/m-p/52856#M31155</guid>
      <dc:creator>heymjo</dc:creator>
      <dc:date>2011-05-05T07:09:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to verify user task assignment at runtime?</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/how-to-verify-user-task-assignment-at-runtime/m-p/52857#M31156</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;The engine API shouldn't be used from within service-tasks, execution- and tasklisteners now. If you do, it can mess up transactions/connections, especially if you update data that is related to the current process…&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 May 2011 09:22:52 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/how-to-verify-user-task-assignment-at-runtime/m-p/52857#M31156</guid>
      <dc:creator>frederikherema1</dc:creator>
      <dc:date>2011-05-09T09:22:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to verify user task assignment at runtime?</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/how-to-verify-user-task-assignment-at-runtime/m-p/52858#M31157</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Frederikheremans, thanks for your reply.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Is there any work arround available currently in Activiti to achieve the above mentioned requirement of verifying user task assignment at runtime?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Kindly guide me!!!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 May 2011 13:46:45 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/how-to-verify-user-task-assignment-at-runtime/m-p/52858#M31157</guid>
      <dc:creator>raj1</dc:creator>
      <dc:date>2011-05-09T13:46:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to verify user task assignment at runtime?</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/how-to-verify-user-task-assignment-at-runtime/m-p/52859#M31158</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;The only way you achieve this, is to use the internal sessions (you hear it, internal - no guerantees of backward compatibility):&lt;/SPAN&gt;&lt;BR /&gt;&lt;CODE&gt;&lt;BR /&gt;org.activiti.engine.impl.context.Context.getCommandContext()&lt;BR /&gt;&amp;nbsp;&amp;nbsp; .getHistoricTaskInstanceManager()&lt;BR /&gt;&amp;nbsp;&amp;nbsp; ….&lt;BR /&gt;&lt;/CODE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 May 2011 07:23:11 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/how-to-verify-user-task-assignment-at-runtime/m-p/52859#M31158</guid>
      <dc:creator>frederikherema1</dc:creator>
      <dc:date>2011-05-10T07:23:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to verify user task assignment at runtime?</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/how-to-verify-user-task-assignment-at-runtime/m-p/52860#M31159</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Can you please elaborate on this&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;The engine API shouldn't be used from within service-tasks, execution- and tasklisteners now. If you do, it can mess up transactions/connections,&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt;It is also said here &lt;/SPAN&gt;&lt;A href="http://forums.activiti.org/en/viewtopic.php?f=6&amp;amp;t=1353" rel="nofollow noopener noreferrer"&gt;http://forums.activiti.org/en/viewtopic.php?f=6&amp;amp;t=1353&lt;/A&gt;&lt;SPAN&gt;. In what way could connections/transactions be messed up , and if so is that not a serious limitation of the engine ? Introspecting the process from a listener seems something a lot of people will want to do.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;My use case is that of four-eyes principle. For this i need to lookup a previously executed task on the same process instance, obtain the user that executed it, and then exclude that user from the candidate users on the current task.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2011 09:07:20 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/how-to-verify-user-task-assignment-at-runtime/m-p/52860#M31159</guid>
      <dc:creator>heymjo</dc:creator>
      <dc:date>2011-06-15T09:07:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to verify user task assignment at runtime?</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/how-to-verify-user-task-assignment-at-runtime/m-p/52861#M31160</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;When activiti executes a command (for example complete task) it will have a single command-context where modifications to entities are stored. Once the command finishes, all modifications are flushed onto the SQLConnection. Depending on your transaction-strategy, these changes will be comitted.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;When you use the API from within a taskListener, you actually execute a new command from within a running command. If the datasource is transaction-aware (in case of spring), you'll use the same connection as the command-context of the calling command. If not, a fresh one is used. In both cases, all changes done in the first command, aren't visible to the second command, since the changes aren't flushed yet.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Most of the time (when reading stuff from activiti in the second API-call) you won't see an issue. But when, eg. the taksListener/executionListener is executed, when other activities are executed before that, that part of the data will be invisible. The same with process/execution-state of the process that is currently running and caling the listener…&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I agree that this is a limitation of the system, but exposing the full API from within the context isn't safe (eg. signalling the same process etc. from within the process). &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Anyone else thoughts about this?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2011 09:18:18 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/how-to-verify-user-task-assignment-at-runtime/m-p/52861#M31160</guid>
      <dc:creator>frederikherema1</dc:creator>
      <dc:date>2011-06-15T09:18:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to verify user task assignment at runtime?</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/how-to-verify-user-task-assignment-at-runtime/m-p/52862#M31161</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;i agree that the processengine cannot be completely reentrant. But there is probably a big portion of the api which is 'safe' to use and it would suffice to just document this.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;However, i just tried to let Spring wire the historyservice to a listener bean and it throws a NPE. Looking at the way the activiti spring config works it does not look trivial to avoid this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;CODE&gt;&lt;BR /&gt;&amp;nbsp; &amp;lt;bean id="myProcessEngineConfiguration" class="org.activiti.spring.SpringProcessEngineConfiguration"&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; …..&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;property name="beans"&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;map&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;entry key="fourEyesTaskListener" value-ref="fourEyesTaskListener"/&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/map&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/property&amp;gt;&lt;BR /&gt;&amp;nbsp; &amp;lt;/bean&amp;gt;&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp; &amp;lt;bean id="fourEyesTaskListener" class="my.FourEyesTaskListener"/&amp;gt;&lt;BR /&gt;&lt;/CODE&gt;&lt;BR /&gt;&lt;SPAN&gt;This listener is referenced from the process engine config and will be initialized first. Since the listener holds an @Autowired reference to the ProcessEngine factory bean it will throw NPE because this bean has not been instantiated yet (it is instantiated by the process engine configuration bean) &lt;span class="lia-unicode-emoji" title=":neutral_face:"&gt;😐&lt;/span&gt; I might need to resort to a BeanFactoryPostProcessor but it's not so nice a solution.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So i tried going via Context.getCommandContext().getHistoricTaskInstanceManager() but i cannot seem to obtain the specific task as via the historyservice&lt;/SPAN&gt;&lt;BR /&gt;&lt;CODE&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; HistoricTaskInstance instance = processEngine.getHistoryService().createHistoricTaskInstanceQuery()&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .processInstanceId(delegateTask.getExecution().getProcessInstanceId())&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .taskName(fourEyesTask.getExpressionText()).singleResult();&lt;BR /&gt;&lt;/CODE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2011 10:03:24 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/how-to-verify-user-task-assignment-at-runtime/m-p/52862#M31161</guid>
      <dc:creator>heymjo</dc:creator>
      <dc:date>2011-06-15T10:03:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to verify user task assignment at runtime?</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/how-to-verify-user-task-assignment-at-runtime/m-p/52863#M31162</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;If you remove the "beans" property, ALL spring beans will be available, and than your listener will no longer be a circular reference… (in case you're using the SpringProcessEngineConfiguration) Not sure if this is a good solution for you, just suggesting &lt;img id="smileywink" class="emoticon emoticon-smileywink" src="https://connect.hyland.com/i/smilies/16x16_smiley-wink.png" alt="Smiley Wink" title="Smiley Wink" /&gt;&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2011 14:05:13 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/how-to-verify-user-task-assignment-at-runtime/m-p/52863#M31162</guid>
      <dc:creator>frederikherema1</dc:creator>
      <dc:date>2011-06-15T14:05:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to verify user task assignment at runtime?</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/how-to-verify-user-task-assignment-at-runtime/m-p/52864#M31163</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;i'm having a similar issue with defining a BpmnParseListener. They need to be injected in the (Spring)ProcessEngineConfiguration, but if the parselistener depends on the engine itself i get a nullpointer exception because the engine has not been initialized via the ProcessEngineFactoryBean. If i wouldn't use factorybeans i would get circular references instead.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;CODE&gt;&lt;BR /&gt;&amp;nbsp; &amp;lt;bean id="config" class="org.activiti.spring.SpringProcessEngineConfiguration"&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;property name="customPreBPMNParseListeners"&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;util:list&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;ref bean="userGroupsCheckParseListener"/&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/util:list&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/property&amp;gt;&lt;BR /&gt;&amp;nbsp; &amp;lt;/bean&amp;gt;&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp; &amp;lt;bean id="userGroupsCheckParseListener" class="my.UserGroupsCheckParseListener"&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;property name="userGroupsCheckTaskListener"&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;bean class="my.UserGroupsCheckTaskListener"/&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/property&amp;gt;&lt;BR /&gt;&amp;nbsp; &amp;lt;/bean&amp;gt;&lt;BR /&gt;&lt;/CODE&gt;&lt;BR /&gt;&lt;SPAN&gt;and the tasklistener needs the RepositoryService to lookup a ProcessDefinitionEntity.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The springprocessengineconfiguration could add value here maybe by scanning for @PreParseListener, @PostParseListener annotations and add them dynamically. Then again i don't know how often this feature will get used so is there much point ?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Also, doing ProcessEngineConfiguration.getPreParseListeners().add(myparselistener) does not work because the processengine is already initialized. so we cannot dynamically add a parselistener after the processengine has been created, that is a bit suprising but only slightly inconvenient.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Jun 2011 13:39:43 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/how-to-verify-user-task-assignment-at-runtime/m-p/52864#M31163</guid>
      <dc:creator>heymjo</dc:creator>
      <dc:date>2011-06-20T13:39:43Z</dc:date>
    </item>
    <item>
      <title>Re: How to verify user task assignment at runtime?</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/how-to-verify-user-task-assignment-at-runtime/m-p/52865#M31164</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Once the engine is created, the ProcessEngineConfiguration shouldn't be altered, so adding parselisteners indeed won't do anything…&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Don't see much advantage in creating annotations for that, since it's not commonly used…&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Jun 2011 13:42:53 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/how-to-verify-user-task-assignment-at-runtime/m-p/52865#M31164</guid>
      <dc:creator>frederikherema1</dc:creator>
      <dc:date>2011-06-20T13:42:53Z</dc:date>
    </item>
    <item>
      <title>Re: How to verify user task assignment at runtime?</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/how-to-verify-user-task-assignment-at-runtime/m-p/52866#M31165</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Once the engine is created, the ProcessEngineConfiguration shouldn't be altered&lt;/BLOCKQUOTE&gt;&lt;SPAN&gt;yet adding custom groupmanager and usermanager implementations via the SpringProcessEngineConfiguration requires us to do exactly that, and that's even the "official" way of doing it AFAIK &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Jun 2011 14:51:15 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/how-to-verify-user-task-assignment-at-runtime/m-p/52866#M31165</guid>
      <dc:creator>heymjo</dc:creator>
      <dc:date>2011-06-20T14:51:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to verify user task assignment at runtime?</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/how-to-verify-user-task-assignment-at-runtime/m-p/52867#M31166</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;The official way? &lt;img id="smileywink" class="emoticon emoticon-smileywink" src="https://connect.hyland.com/i/smilies/16x16_smiley-wink.png" alt="Smiley Wink" title="Smiley Wink" /&gt; Should be added before the buildEngine() is called (the engine is created). In spring, the factory-bean calls the buildEngine method. Adding stuff to it is offcourse possible, but not all configuration is updatable (like the bpmn-listeners, since they are added to the BPMNParser only once, when process-engine is built).&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Jun 2011 14:57:25 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/how-to-verify-user-task-assignment-at-runtime/m-p/52867#M31166</guid>
      <dc:creator>frederikherema1</dc:creator>
      <dc:date>2011-06-20T14:57:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to verify user task assignment at runtime?</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/how-to-verify-user-task-assignment-at-runtime/m-p/52868#M31167</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I just tried autowiring the taskService into the listener to perform some task inquiries in the listener and it works ok. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;However, as per this discussion, should we not be using engine APIs (within listeners) even for inquiries?&amp;nbsp; This can be quite a limitation:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;When you use the API from within a taskListener, you actually execute a new command from within a running command. If the datasource is transaction-aware (in case of spring), you'll use the same connection as the command-context of the calling command. If not, a fresh one is used. In both cases, all changes done in the first command, aren't visible to the second command, since the changes aren't flushed yet&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt;When the datasource is transaction-aware, the same connection is used as the calling command. If the connection is the same across contexts, why can't other changes changes in the context be shared?&amp;nbsp; I mean, this sounds like there is no read-consistency within the same transaction.&amp;nbsp;&amp;nbsp; Maybe flushing those changes in the parent context to the sqlconnection without committing them would solve this? The alternative appears to be to use activiti internals (as frederikheremans points out earlier in this thread) and that's not a good option.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Jun 2011 17:24:55 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/how-to-verify-user-task-assignment-at-runtime/m-p/52868#M31167</guid>
      <dc:creator>mahavirj</dc:creator>
      <dc:date>2011-06-20T17:24:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to verify user task assignment at runtime?</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/how-to-verify-user-task-assignment-at-runtime/m-p/52869#M31168</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;As I stated in another thread (somewhere on the forum here, can't remember where &lt;img id="smileywink" class="emoticon emoticon-smileywink" src="https://connect.hyland.com/i/smilies/16x16_smiley-wink.png" alt="Smiley Wink" title="Smiley Wink" /&gt;), the changes from a single command are only flushed to the SQLConnection at the end of the command… So even when datasource is transaction-aware (and returning same connection) the changes still won't be visible in eg. a query launched from an executing tasklistener, since they aren't flushed yet.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;We can't just commit the changes before, this is done for optimization (creates, updates and deletes are optimized to limit the number of DB-queries).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So you CAN off course use the API from "within" (if you're using spring, the datasource is always transaction aware) as long as you don't WRITE anything related to the process the parent context is operating, this will cause optimistic lock exception and rollback when touching the same entity. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any way, any input is welcome. Since I answered the API/Context question many times, this indicates this is a frequently used feature and needs to be tackled.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Jun 2011 19:10:32 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/how-to-verify-user-task-assignment-at-runtime/m-p/52869#M31168</guid>
      <dc:creator>frederikherema1</dc:creator>
      <dc:date>2011-06-20T19:10:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to verify user task assignment at runtime?</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/how-to-verify-user-task-assignment-at-runtime/m-p/52870#M31169</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I think as a first thing it should be made easier to access the engine services through the listener interface, by providing a reference to them in the callback method signature. Then with javadoc you can mark methods as safe or not, or you handle this in code even if possible.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Jun 2011 10:13:07 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/how-to-verify-user-task-assignment-at-runtime/m-p/52870#M31169</guid>
      <dc:creator>heymjo</dc:creator>
      <dc:date>2011-06-21T10:13:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to verify user task assignment at runtime?</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/how-to-verify-user-task-assignment-at-runtime/m-p/52871#M31170</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Am very new to this , can you please explain in detail steps for how to achieve this .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. I cliked on task listner of userTask B ..... and event on Create and i gave task listner class(which is showing error that class not found exception&amp;nbsp; " &lt;SPAN style="color: #727174; background-color: #ffffff;"&gt;my.FourEyesTaskListener"&lt;/SPAN&gt;)&amp;nbsp;&lt;/P&gt;&lt;P&gt;2. Where to write this class and the below code&amp;nbsp; ... and how to get task A assigne here (&lt;SPAN style="color: #727174; background-color: #ffffff;"&gt;String userId = …&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Is it some thing like task.getAssignee():smileywink: please correct me if am wrong.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #727174; background-color: #ffffff;"&gt;public class FourEyesTaskListener implements TaskListener {&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #727174; background-color: #ffffff;"&gt;&amp;nbsp; // injected by activiti&lt;/SPAN&gt;&lt;BR style="color: #727174; background-color: #ffffff;" /&gt;&lt;SPAN style="color: #727174; background-color: #ffffff;"&gt;&amp;nbsp; private String fourEyesTask;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #727174; background-color: #ffffff;"&gt;&amp;nbsp; // see&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;A href="http://www.activiti.org/javadocs/org/activiti/engine/delegate/DelegateTask.html" rel="nofollow noopener noreferrer" style="color: #1e88e5; background-color: #ffffff; border: 0px; text-decoration: none; padding: 0px calc(12px + 0.35ex) 0px 0px;" target="_blank"&gt;http://www.activiti.org/javadocs/org/activiti/engine/delegate/DelegateTask.html&lt;/A&gt;&lt;BR style="color: #727174; background-color: #ffffff;" /&gt;&lt;SPAN style="color: #727174; background-color: #ffffff;"&gt;&amp;nbsp; public void notify(DelegateTask delegateTask) {&lt;/SPAN&gt;&lt;BR style="color: #727174; background-color: #ffffff;" /&gt;&lt;SPAN style="color: #727174; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // find out the user id that executed the four eyes task&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR style="color: #727174; background-color: #ffffff;" /&gt;&lt;SPAN style="color: #727174; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; String userId = ….&lt;/SPAN&gt;&lt;BR style="color: #727174; background-color: #ffffff;" /&gt;&lt;SPAN style="color: #727174; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; //&lt;/SPAN&gt;&lt;BR style="color: #727174; background-color: #ffffff;" /&gt;&lt;SPAN style="color: #727174; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; delegateTask.deleteCandidateUser(userId);&lt;/SPAN&gt;&lt;BR style="color: #727174; background-color: #ffffff;" /&gt;&lt;SPAN style="color: #727174; background-color: #ffffff;"&gt;&amp;nbsp; }&lt;/SPAN&gt;&lt;BR style="color: #727174; background-color: #ffffff;" /&gt;&lt;SPAN style="color: #727174; background-color: #ffffff;"&gt;}&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #727174; background-color: #ffffff;"&gt;Please help me with some screenshot example.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Apr 2019 04:50:08 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/how-to-verify-user-task-assignment-at-runtime/m-p/52871#M31170</guid>
      <dc:creator>raki1497</dc:creator>
      <dc:date>2019-04-10T04:50:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to verify user task assignment at runtime?</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/how-to-verify-user-task-assignment-at-runtime/m-p/52872#M31171</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; Please have a look at this blog post if you are using APS enterprise.&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.alfresco.com/community/bpm/blog/2016/11/16/activiti-enterprise-developer-series-process-and-task-listeners" rel="nofollow noopener noreferrer"&gt;https://community.alfresco.com/community/bpm/blog/2016/11/16/activiti-enterprise-developer-series-process-and-task-listeners&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; If you are using activiti 6 and want to accomplish the custom task assignement please use custom taskk listeners&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://www.activiti.org/userguide/#taskListeners" title="https://www.activiti.org/userguide/#taskListeners" rel="nofollow noopener noreferrer"&gt;Activiti User Guide&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Note: you can use the above code by just annotating it with @componenet steroetype from spring so that you will not get class not found exception.&lt;/P&gt;&lt;P&gt;I hope this much info is useful for you.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Apr 2019 05:20:21 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/how-to-verify-user-task-assignment-at-runtime/m-p/52872#M31171</guid>
      <dc:creator>mdtabrezmca</dc:creator>
      <dc:date>2019-04-10T05:20:21Z</dc:date>
    </item>
  </channel>
</rss>

