jbpm5 中的用户任务后工作流程不转发

发布于 2024-12-29 20:19:24 字数 923 浏览 4 评论 0原文

我在工作流程中有一个用户任务。 我能够处理人工任务,但流程无法进一步转发。 毫无例外,流程都会停止在那里,用户任务后面的其他任务不会被执行。

请在这方面帮助我。 1. jbpm5.0是否需要进行任何配置更改? 2.还有什么我遗漏的吗?

      KnowledgeBase kbase = readKnowledgeBase("taskprocess.rf");
        StatefulKnowledgeSession ksession = createKnowledgeSession(kbase);

        /*Create the knowledge base for HelloProcss.bpmn */

        KnowledgeRuntimeLogger logger = KnowledgeRuntimeLoggerFactory.newThreadedFileLogger(ksession, "testlog", 1000);
        CommandBasedWSHumanTaskHandler taskHandler = new CommandBasedWSHumanTaskHandler(ksession);
        ksession.getWorkItemManager().registerWorkItemHandler("Human Task", taskHandler);
        //JPAWorkingMemoryDbLogger logger = new JPAWorkingMemoryDbLogger(ksession);
        //taskHandler.connect();

        System.out.println(" started the humantask");
        ksession.startProcess("persistask");    
        ksession.fireAllRules();

I have a user task in a workflow.
Im able to process the human task but the flow is not forwarding further.
Without any exception the flow stops there, other tasks following the user task is not getting executed.

Kindly help me in this regard.
1. Could there be any configuration changes needed for jbpm5.0.
2. Is there anything else that im missing.

      KnowledgeBase kbase = readKnowledgeBase("taskprocess.rf");
        StatefulKnowledgeSession ksession = createKnowledgeSession(kbase);

        /*Create the knowledge base for HelloProcss.bpmn */

        KnowledgeRuntimeLogger logger = KnowledgeRuntimeLoggerFactory.newThreadedFileLogger(ksession, "testlog", 1000);
        CommandBasedWSHumanTaskHandler taskHandler = new CommandBasedWSHumanTaskHandler(ksession);
        ksession.getWorkItemManager().registerWorkItemHandler("Human Task", taskHandler);
        //JPAWorkingMemoryDbLogger logger = new JPAWorkingMemoryDbLogger(ksession);
        //taskHandler.connect();

        System.out.println(" started the humantask");
        ksession.startProcess("persistask");    
        ksession.fireAllRules();

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

勿挽旧人 2025-01-05 20:19:24

发生这种情况是因为注册人工任务处理程序的线程已死亡 (ksession.getWorkItemManager().registerWorkItemHandler("Human Task", taskHandler);)
您需要与附加的人工任务处理程序建立一个全局会话,以侦听人工任务组件以获取有关任务完成的通知。

干杯

That's happening because the thread that register the human task handler died (ksession.getWorkItemManager().registerWorkItemHandler("Human Task", taskHandler);)
You need to have a global session with the Human Task handler attached listening the Human Task component for notification about Task Completions.

Cheers

眼泪都笑了 2025-01-05 20:19:24

您能否澄清一下您是如何完成任务的,例如您使用的是 Eclipse 还是基于 Web 的客户端?启动进程后主类中会发生什么,它会终止吗?在这种情况下,Salaboy 可能是对的,因为创建任务并执行进程的线程可能在完成任务之前就已经死亡,因此它不会继续执行。

在主类中添加长 Thread.sleep 可能允许您继续执行测试。

Could you clarify how you are completing the task, are you using the Eclipse or web-based client for example? And what happens in your main class after starting the process, does it just terminate? In that case, Salaboy is probably right, as the thread that created the task and executing the process probably already died before you completed the task, so it will not continue execution.

Adding a long Thread.sleep in your main class would probably allow you to continue execution for testing.

你对谁都笑 2025-01-05 20:19:24

我们需要在“TaskServiceSession”中添加用户名管理员,

         taskSession.addUser(new User("administrator")); 

这样工作流程就会继续进行,并在用户任务完成后完成剩余的任务。
您必须具有管理员角色才能运行任何进程。这是一个要求

We need to add the user name administrator in the "TaskServiceSession"

         taskSession.addUser(new User("administrator")); 

With this the workflow progresses and completes the remaining tasks after the user task is completed.
You must have the administrator role in order to run any process. It is a requirement

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文