简体   繁体   English

Spring Activiti跳过/传递任务

[英]Spring Activiti Skip / Passthrough a task

I'm new at this, so please bear with me. 我是新来的,所以请忍受我。 I've got a sample of the activiti diagram here: 我在这里有一个活动图示例:

在此处输入图片说明

Assume I'm on task "Validate if Budgeted or Unbudgeted". 假设我正在执行任务“验证预算还是未预算”。 If I choose "Budgeted", I go to task "Approve Laptop Request - IT Governance (Ron)". 如果选择“预算”,则转到任务“批准笔记本电脑请求-IT治理(Ron)”。 At this point, I can either say yes or no. 在这一点上,我可以说是或否。

Saying yes gets me to "Approve Laptop Request - IT Governance (2)", while saying no returns me to ISGOC. 说“是”使我进入“批准笔记本电脑请求-IT治理(2)”,而说“否”则使我回到ISGOC。

Here's the caveat - saying no as either the IT Governance (Ron) or the IT Governance (2) would make the process skip you next time around. 需要注意的是-不回答,因为IT治理(Ron)或IT治理(2)都会使该过程在下一次跳过您。

So, if I, as IT Governance (Ron) said no, which would then take me back to ISGOC, to which I said budgeted, the process would skip over me, and jump straight to IT Governance (2). 因此,如果我像IT管治(Ron)所说的那样拒绝,然后带我回到我说过预算的ISGOC,则该过程将跳过我,直接跳到IT管治(2)。 Should IT Governance (2) say no as well, he would get skipped over as well should ISGOC choose budgeted. 如果IT治理部门(2)也不同意,那么如果ISGOC选择预算,他也会被跳过。

Currently, I'm using the create and complete listeners per task to modify an entry in a database, denoting which approvers had declined my request. 当前,我正在使用每个任务的创建和完成侦听器来修改数据库中的条目,以指示哪些批准者拒绝了我的请求。

So my question is, is there a function of sorts that allows me to bypass a task? 所以我的问题是,有没有一种功能可以让我绕过任务?

Thanks. 谢谢。

I am not sure if I understood your question correctly. 我不确定我是否正确理解了您的问题。 In my opinion you should just change your process and save information about declining tasks in activiti variables and add additional conditionals to omit tasks which were declined. 在我看来,您应该更改流程,并在activiti变量中保存有关任务下降的信息,并添加其他条件以省略已拒绝的任务。

The problem you have is that you are using process variables for managing state of the decisions but are not reseting the decision state when you enter the approval loop. 您遇到的问题是,您正在使用过程变量来管理决策状态,但是在进入批准循环时没有重置决策状态。

All Entry and Return paths to ISGOC need to go through either a service or script task that sets the two approval decision variables to false. ISGOC的所有进入和返回路径都需要通过将两个批准决策变量设置为false的服务或脚本任务。 This way, each time you re-enter the approval loop, you will start from a known state, 这样,每次您重新进入批准循环时,都将从一个已知状态开始,

Hope this helps. 希望这可以帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM