-1

请分享任何链接以使用骆驼配置 activiti。我能得到的所有示例都显示 SERVICETASK->CAMELROUTE->FILE 然后 FILE->RECIEVETASK(Activiti)

这涉及到一些 BUSINESS_KEY,我无法弄清楚究竟是什么

我需要一个显示 SERVICE TASK -> CAMEL ROUTE-> RECEIEVTASK(Signal the Activiti) 的示例。我不知道为什么,但这个例子给了我错误

文件:activiti-flow.bpmn20.xml:

<process id="camelprocess" name="My process" isExecutable="true">
<startEvent id="startevent1" name="Start"></startEvent>
<serviceTask id="servicetask1" name="Service Task" activiti:async="true" activiti:delegateExpression="${camel}"></serviceTask>
<receiveTask id="receivetask1" name="Receive Task"></receiveTask>
<endEvent id="endevent1" name="End"></endEvent>
<sequenceFlow id="flow1" sourceRef="startevent1" targetRef="servicetask1"></sequenceFlow>
<sequenceFlow id="flow2" sourceRef="servicetask1" targetRef="receivetask1"></sequenceFlow>
<sequenceFlow id="flow3" sourceRef="receivetask1" targetRef="endevent1"></sequenceFlow>

activiti-camel-spring.xml

<bean id="camel" class="org.activiti.camel.CamelBehaviour">
    <constructor-arg index="0">
        <list>
            <bean class="org.activiti.camel.SimpleContextProvider">
                <constructor-arg index="0" value="camelprocess" />
                <constructor-arg index="1" ref="camelContext" />
            </bean>
        </list>
    </constructor-arg>
</bean>

<camel:camelContext id="camelContext">

    <camel:route>
        <camel:from uri="activiti:camelprocess:servicetask1"/>
        <camel:to uri="bean:serviceActivator?method=doSomething(${body})"/>
        <camel:to uri="activiti:camelprocess:receivetask1"/>
    </camel:route> 

</camel:camelContext>

错误是:

 1|ERROR|org.slf4j.helpers.MarkerIgnoringBase:161||||>> Failed delivery for (MessageId:    ID-viscx73-PC-49557-1376961951564-0-1 on ExchangeId: ID-viscx73-PC-49557-1376961951564-0-2). Exhausted after delivery attempt: 1 caught:       org.activiti.engine.ActivitiIllegalArgumentException: Business key is null 

at   org.activiti.engine.impl.ProcessInstanceQueryImpl.processInstanceBusinessKey(ProcessInstanceQueryImpl.java:87)
at org.activiti.camel.ActivitiProducer.findProcessInstanceId(ActivitiProducer.java:78)
at org.activiti.camel.ActivitiProducer.signal(ActivitiProducer.java:58)
at org.activiti.camel.ActivitiProducer.process(ActivitiProducer.java:49)
at         org.apache.camel.util.AsyncProcessorConverterHelper$ProcessorToAsyncProcessorBridge.process     (AsyncProcessorConverterHelper.java:61)
at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)

所有具有 ACTIVITI->CAMELROUTE(FILE) 然后在其他路线 CAMEL_FILE->RECIEVETASK 的论坛/链接

他们建议添加一些键,例如 PROCESS_KEY_PROPERTY 或 PROCESS_ID_PROPERTY 我不知道这些属性适合的位置

我正在尝试从链接 http://bpmn20inaction.blogspot.in/2013/03/using-camel-routes-in-activiti-made.html的示例中工作

我不确定向骆驼提供服务任务后的进程是否根本没有移动以接收任务并在那里等待或CAMEL无法找到接收任务

请就此分享一些建议

谢谢

4

2 回答 2

0

它通过添加内置的骆驼队列来工作,如示例所示。我认为它们只是作为各种路线的示例。但是实际上通过传递给队列,ServiceTask 在骆驼中是异步的,后来从队列中读取它们并在 activiti 中调用接收任务

<camel:to uri="seda:tempQueue"/>
<camel:from uri="seda:tempQueue"/>

谢谢

于 2013-08-20T17:12:14.873 回答
0

我不知道你是否解决了这个问题,但实际上我遇到了同样的问题。

最后,我找到了问题的解决方案。

实际上,必须提供PROCESS_ID_PROPERTY属性是正确的,否则activiti引擎不知道执行哪个流程实例。所以,我只是在将 JMS 发送到 activemq 时在标头中设置 PROCESS_ID_PROPERTY 值,当消息返回时,只需从标头设置属性。喜欢的东西:

from("activiti:process:simpleCall").setHeader("PROCESS_ID_PROPERTY", simple("${property.PROCESS_ID_PROPERTY}")).to("activemq:queue:request");

from("activemq:queue:reply").setProperty("PROCESS_ID_PROPERTY", simple("${header.PROCESS_ID_PROPERTY}")).to("activiti:process:simpleReceive");

希望它会帮助你。

于 2015-12-22T05:46:09.460 回答