简体   繁体   English

将变量从正在运行的进程传递到另一个进程(Alfresco-Activiti)

[英]Pass a variable from a running process to another process (alfresco - activiti)

Greetings to the community, I am using Alfresco 6.0.0 (Community Edition) and I am wondering if the following scenario would be possibly achieved. 问候社区,我正在使用Alfresco 6.0.0(社区版),我想知道是否可以实现以下方案。

Step 1 第1步

Start a process through the alfresco workflow console with definition = 'process1' 通过afrresco工作流控制台启动流程, 定义为'process1'

Step 2 第2步

Start a second process through the alfresco workflow console with definition = 'process2' 通过alfresco工作流控制台启动第二个流程, 定义为'process2'

I wonder if I somehow could "interact" with the process1 from process2 我不知道如果我能以某种“互动”与过程2过程1

(for example, update a variable that exists in the process1 from process2 ) (例如, 从process2更新process1中存在的变量

In case the above scenario is feasible, I would prefer to do that either inside the .bpmn file of my process2 or maybe using a serviceTask extending a custom JavaDelegate method. 如果上述情况下是可行的,我宁愿做,要么我的过程2的.bpmn文件中或可能使用扩展的自定义JavaDelegate方法serviceTask。

Any help would be greatly appreciated, thanks :) 任何帮助将不胜感激,谢谢:)

Ideally, process instances should be isolated. 理想情况下,应该隔离流程实例。 but for your case, you can create a JAVA Bean (singleton) that holds the values and inject that bean wherever required. 但对于您的情况,您可以创建一个保存值的JAVA Bean(单个),并在需要时将其注入。 just make sure it initializes in the engine context. 只要确保它在引擎上下文中初始化即可。 update the bean with one process and use the bean instance values using activiti expression ie ${myBean.getVaue("yourVariable")} 使用一个进程更新Bean,并使用activiti表达式使用Bean实例值,即${myBean.getVaue("yourVariable")}

your bean definition should look like - 您的bean定义应类似于-

@Component("myBean")
public class MyBean {

    // your variables

    public Object getVaue(String variableName) {
        // return your variable value
    }
}

Note: keep your variables thread safe 注意:确保变量线程安全

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

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