Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SOS The previous task node has a task listener, and the next one will also use the listener. #1937

Open
qiaolin-li opened this issue Jul 18, 2018 · 16 comments

Comments

@qiaolin-li
Copy link

The previous task node has a task listener, and the next one will also use the listener.

I have a problem. It's strange!It's about the task listener!

image

####The xml code

   <userTask id="SupervisorApprove" name="驻地办审核">
      <documentation>等待驻地办审核</documentation>
      <extensionElements>
        <activiti:taskListener event="create" delegateExpression="${tzkzTaskListener}">
          <activiti:field name="company">
            <activiti:string><![CDATA[supervisorCompany]]></activiti:string>
          </activiti:field>
          <activiti:field name="role">
            <activiti:string><![CDATA[tzkzSupervisor]]></activiti:string>
          </activiti:field>
        </activiti:taskListener>
      </extensionElements>
    </userTask>
    <userTask id="EngineerApprove" name="总监办审核" activiti:candidateGroups="tzkzEngineer">
      <documentation>等待总监办审核</documentation>
    </userTask>
    <userTask id="LeaderApprove" name="项目领导审核" activiti:candidateGroups="tzkzLeader">
      <documentation>等待项目领导审核</documentation>
    </userTask>
    <userTask id="ContractorApprove" name="建管办审核" activiti:candidateGroups="tzkzContract">
      <documentation>等待建管办审核</documentation>
    </userTask>

We can see that only SupervisorApprove task node has a listener

When I start the process, the engine defaults to creating the first task, calling the task listener, which is true, of course

qq 20180718160510

image

However, when I complete this first task, the engine creates a second task and it calls again, but my second task node has no task listener configured!My other flowcharts are the same

image

thank

@salaboy
Copy link
Contributor

salaboy commented Jul 18, 2018

@liqiaolin520 hi there.. thanks for reporting this issue. Is it possible to know which version of Activiti are you using and can you create a small maven project with a reproducer of the problem?

@qiaolin-li
Copy link
Author

I used 5.21.0
Do you want a created maven project to test this problem for you, or do I redo the environment test myself?

@salaboy
Copy link
Contributor

salaboy commented Jul 18, 2018

@liqiaolin520 if you can create a small maven project to reproduce the issue that will be great. Also have you tried upgrading to 5.22 ?

@qiaolin-li
Copy link
Author

Ok, no problem. I will test 5.22 first. If 5.22 doesn't work, then I will send my test case to you together. Is that ok?

@salaboy
Copy link
Contributor

salaboy commented Jul 18, 2018

@liqiaolin520 yeah, that is ok

@qiaolin-li
Copy link
Author

Hello, I know the answer, is set to 0 after obtaining processEngineConfiguration processDefinitionCacheLimit, otherwise I again deployment is also wrong,

####The conclusion of my analysis is as follows:

image

image

image

We can see SupervisorApprove task , execute - > activity - > activityBehavior - >
TaskDefinition SupervisorApprove task of listener!But this is already a EngineerApprove so SupervisorApprove is completed When the engine to create EngineerApprove task will enter SupervisorApprove task listener

Can you tell me that the operation defined by this caching process is not refreshed for the redeployed process?

Or will the cache not disappear when the server restarts?Because I see that your cache is a Map

Thank you

@qiaolin-li
Copy link
Author

This problem is resolved when I don't use caching!But it's slower

@qiaolin-li
Copy link
Author

嗯,我发现不使用缓存时并不能解决问题,我有多个流程,第一个节点都是存在任务监听器的!
如果我随机开启这三个流程,就会有一个以上会出现第二个节点 task对象 中的 execution对象 出现了第一个节点相同的任务监听器!

@salaboy
Copy link
Contributor

salaboy commented Jul 20, 2018

@liqiaolin520 please use english here

@qiaolin-li
Copy link
Author

Well, I've found that it doesn't solve the problem without caching. I have multiple process definitions, and the first node has the same task listener!
If I start these three processes at random, it is possible that an execution object in the task object of the second node appears with the same task listener of the first node!

@salaboy
Copy link
Contributor

salaboy commented Jul 20, 2018

If you provide a reproducer we can fix the issue for sure, please create a simple maven project and push it to github and share the link.. so we can run it here and reproduce the error.

@qiaolin-li
Copy link
Author

There is a batch start process on my side

@qiaolin-li
Copy link
Author

Ok, I'll try to get a maven project out

@qiaolin-li
Copy link
Author

Thank you for your help

@salaboy
Copy link
Contributor

salaboy commented Jul 21, 2018

@liqiaolin520 thank you for reporting the issue :)

@salaboy
Copy link
Contributor

salaboy commented Nov 1, 2018

@liqiaolin520 any progress on this side?

@salaboy salaboy added this to the NonActiviti7 milestone Nov 1, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Activiti 5.x
  
Awaiting triage
Development

No branches or pull requests

2 participants