cancel
Showing results for 
Search instead for 
Did you mean: 

Mule Integration

brianrook
Champ in-the-making
Champ in-the-making
Hello, I'm working on a project where I intend to call Mule from inside of an Activiti process.  I have downloaded and installed Activiti 5.6 and I've got the database setup.

From my bpmn20.xml file:


   <process id="createInboundDocument">
      <startEvent id="start" />

      <sequenceFlow sourceRef="start" targetRef="create_workitem_action" />

      <serviceTask id="create_workitem_action"
         name="Create a WorkItem from the InboundDocumentAction"
         activiti:class="com.stoneriver.iip.document.bpm.CreateWorkItemFromInboundDocument" />


      <sequenceFlow sourceRef="create_workitem_action"
         targetRef="create_workitem" />

      <sendTask id="create_workitem" activiti:type="mule">
         <extensionElements>
            <activiti:field name="endpointUrl"
               expression="vm://createWorkItem.in?connector=vmSync" />
            <activiti:field name="language">
               <activiti:string>juel</activiti:string>
            </activiti:field>
            <activiti:field name="payloadExpression">
               <activiti:string>#{createWorkItemAction}</activiti:string>
            </activiti:field>
            <activiti:field name="resultVariable">
               <activiti:string>workItemCollection</activiti:string>
            </activiti:field>
         </extensionElements>
      </sendTask>

      <sequenceFlow sourceRef="create_workitem" targetRef="end" />

I can see the first task being called (create_workitem_action).  However, as soon as it tries to call the second task, I get this error in my console:


SEVERE: Error while closing command context
org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'muleContext' is defined
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanDefinition(DefaultListableBeanFac
tory.java:521)

The Activiti process is being called from a Mule endpoint, so I'm positive that Mule is communicating with Activiti, but it appears that Activiti doesn't have access to the Mule context for some reason.  How do I fix that?


Thanks!
18 REPLIES 18

georgegao
Champ in-the-making
Champ in-the-making
hello,I am from China, About your configuration, I want to know
<bean id="_muleContext" factory-bean="muleFactory" factory-method="createMuleContext">
  <constructor-arg type="java.lang.String" value="src/main/resources/application-context.xml"/>
</bean>

what the content about application-context.xml??


or  can you give a complete example about activiti+mule?

I am not good at english, sorry!

mathiasd
Champ in-the-making
Champ in-the-making
I'm back ! Not sure actually that the problem is a Mule problem. Is it possible to do some transformation on the response of the Mule ?
I would like to do something like :


<sendTask id="sendMule" activiti:type="mule">
   <extensionElements>
    <activiti:field name="endpointUrl">
     <activiti:string>http://localhost:8080/hello/</activiti:string>
    </activiti:field>
    <activiti:field name="language">
     <activiti:string>juel</activiti:string>
    </activiti:field>
    <activiti:field name="payloadExpression">
     <activiti:expression>${message}</activiti:expression>
    </activiti:field>
    <activiti:field name="resultVariable" >
     <activiti:expression>${var1 = result.getContent().toString()}</activiti:expression>
    </activiti:field>
        </extensionElements>
</sendTask>

Is it possible ?

Thanks

trademak
Star Contributor
Star Contributor
Hi,

Great to have you back!
No transformation is actually something you would want to do in the Mule container. Mule is very well capable of doing all kinds of transformations.
The resultVariableName is only a string value that's used to set the result in the execution.

Best regards,

mathiasd
Champ in-the-making
Champ in-the-making
Thanks but I think a HTTP mule will always returns a http-response. So the decoding should be done by the client (here the client is the workflow). Plus, the Mule forum is a real nightmare 😕

But don't worry, I will find something Smiley Wink

mask87
Champ in-the-making
Champ in-the-making
I'm a new adapter of activiti et a will be integrete with mule
but this syntax doesn't work when a deploye in activiti-explorer

<sendTask id="create_workitem" activiti:type="mule">
         <extensionElements>
            <activiti:field name="endpointUrl"
               expression="vm://createWorkItem.in?connector=vmSync" />
            <activiti:field name="language">
               <activiti:string>juel</activiti:string>
            </activiti:field>
            <activiti:field name="payloadExpression">
               <activiti:string>#{createWorkItemAction}</activiti:string>
            </activiti:field>
            <activiti:field name="resultVariable">
               <activiti:string>workItemCollection</activiti:string>
            </activiti:field>
         </extensionElements>
      </sendTask>

I use Activiti 5.8
Smiley Sad

mask87
Champ in-the-making
Champ in-the-making
Hello, I'm working on a project where I intend to call Mule from inside of an Activiti process. I have downloaded and installed Activiti 5.6

From my bpmn20.xml file:

<serviceTask id="servicetask1" activiti:type="mule">
    <extensionElements>
       <activiti:field name="endpointUrl">
         <activiti:string>vm://in</activiti:string>
       </activiti:field>
       <activiti:field name="language">
         <activiti:string>juel</activiti:string>
       </activiti:field>
       <activiti:field name="payloadExpression">
         <activiti:expression>${processVariable1}</activiti:expression>
       </activiti:field>
       <activiti:field name="resultVariable">
         <activiti:string>processVariable2</activiti:string>
       </activiti:field>
      </extensionElements>
    </serviceTask>

but The type can't be understanding by activti
the error is 
cvc-attribute.3: The value 'mule' of attribute 'activiti:type' on element 'serviceTask' is not valid with respect to
its type, 'null'.

where is the problem of this synthax??

trademak
Star Contributor
Star Contributor
Hi,

That's because you should use a sendTask instead of a serviceTask.

Best regards,

mask87
Champ in-the-making
Champ in-the-making
Hi,

I  use both a sendTask and serviceTask and I have the same problem.

pksahoo
Champ in-the-making
Champ in-the-making
Hi I got following error while integrate activiti 5.17 with Mule

any thought??


org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'muleContext' is defined
at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanDefinition(DefaultListableBeanFactory.java:529)
at org.springframework.beans.factory.support.AbstractBeanFactory.getMergedLocalBeanDefinition(AbstractBeanFactory.java:1095)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:277)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)
at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1093)
at org.activiti.engine.impl.cfg.SpringBeanFactoryProxyMap.get(SpringBeanFactoryProxyMap.java:39)
at org.activiti.mule.MuleSendActivitiBehavior.getMuleContext(MuleSendActivitiBehavior.java:138)
at org.activiti.mule.MuleSendActivitiBehavior.execute(MuleSendActivitiBehavior.java:71)
at org.activiti.engine.impl.pvm.runtime.AtomicOperationActivityExecute.execute(AtomicOperationActivityExecute.java:60)
at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:96)
at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:631)
at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:626)
at org.activiti.engine.impl.pvm.runtime.AtomicOperationTransitionNotifyListenerStart.eventNotificationsCompleted(AtomicOperationTransitionNotifyListenerStart.java:52)
at org.activiti.engine.impl.pvm.runtime.AbstractEventAtomicOperation.execute(AbstractEventAtomicOperation.java:56)
at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:96)
at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:631)
at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:626)
at org.activiti.engine.impl.pvm.runtime.AbstractEventAtomicOperation.execute(AbstractEventAtomicOperation.java:49)
at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:96)
at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:631)
at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:626)
at org.activiti.engine.impl.pvm.runtime.AtomicOperationTransitionCreateScope.execute(AtomicOperationTransitionCreateScope.java:49)
at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:96)
at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:631)
at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:626)
at org.activiti.engine.impl.pvm.runtime.AtomicOperationTransitionNotifyListenerTake.execute(AtomicOperationTransitionNotifyListenerTake.java:80)
at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:96)
at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:631)
at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:626)
at org.activiti.engine.impl.pvm.runtime.AtomicOperationTransitionDestroyScope.execute(AtomicOperationTransitionDestroyScope.java:116)
at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:96)
at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:631)
at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:626)
at org.activiti.engine.impl.pvm.runtime.AtomicOperationTransitionNotifyListenerEnd.eventNotificationsCompleted(AtomicOperationTransitionNotifyListenerEnd.java:35)
at org.activiti.engine.impl.pvm.runtime.AbstractEventAtomicOperation.execute(AbstractEventAtomicOperation.java:56)
at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:96)
at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:631)
at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:626)
at org.activiti.engine.impl.pvm.runtime.AbstractEventAtomicOperation.execute(AbstractEventAtomicOperation.java:49)
at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:96)
at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:631)
at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:626)
at org.activiti.engine.impl.persistence.entity.ExecutionEntity.take(ExecutionEntity.java:450)
at org.activiti.engine.impl.persistence.entity.ExecutionEntity.take(ExecutionEntity.java:428)
at org.activiti.engine.impl.bpmn.behavior.BpmnActivityBehavior.performOutgoingBehavior(BpmnActivityBehavior.java:140)
at org.activiti.engine.impl.bpmn.behavior.BpmnActivityBehavior.performDefaultOutgoingBehavior(BpmnActivityBehavior.java:66)
at org.activiti.engine.impl.bpmn.behavior.FlowNodeActivityBehavior.leave(FlowNodeActivityBehavior.java:44)
at org.activiti.engine.impl.bpmn.behavior.FlowNodeActivityBehavior.execute(FlowNodeActivityBehavior.java:36)
at org.activiti.engine.impl.pvm.runtime.AtomicOperationActivityExecute.execute(AtomicOperationActivityExecute.java:60)
at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:96)
at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:631)
at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:626)
at org.activiti.engine.impl.pvm.runtime.AtomicOperationProcessStartInitial.eventNotificationsCompleted(AtomicOperationProcessStartInitial.java:45)
at org.activiti.engine.impl.pvm.runtime.AbstractEventAtomicOperation.execute(AbstractEventAtomicOperation.java:56)
at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:96)
at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:631)
at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:626)
at org.activiti.engine.impl.pvm.runtime.AtomicOperationProcessStart.eventNotificationsCompleted(AtomicOperationProcessStart.java:62)
at org.activiti.engine.impl.pvm.runtime.AbstractEventAtomicOperation.execute(AbstractEventAtomicOperation.java:56)
at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:96)
at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:631)
at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:626)
at org.activiti.engine.impl.persistence.entity.ExecutionEntity.start(ExecutionEntity.java:378)
at org.activiti.engine.impl.cmd.StartProcessInstanceCmd.execute(StartProcessInstanceCmd.java:111)
at org.activiti.engine.impl.cmd.StartProcessInstanceCmd.execute(StartProcessInstanceCmd.java:37)
at org.activiti.engine.impl.interceptor.CommandInvoker.execute(CommandInvoker.java:24)
at org.activiti.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:57)
at org.activiti.spring.SpringTransactionInterceptor$1.doInTransaction(SpringTransactionInterceptor.java:47)
at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:130)
at org.activiti.spring.SpringTransactionInterceptor.execute(SpringTransactionInterceptor.java:45)
at org.activiti.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:31)
at org.activiti.engine.impl.cfg.CommandExecutorImpl.execute(CommandExecutorImpl.java:40)
at org.activiti.engine.impl.cfg.CommandExecutorImpl.execute(CommandExecutorImpl.java:35)
at org.activiti.engine.impl.RuntimeServiceImpl.startProcessInstanceByKey(RuntimeServiceImpl.java:81)
at com.bofa.cps.bpm.util.BPMUtil.startProcessInstance(BPMUtil.java:62)
at test.CPSFileProcessTest.testStartMuleProcessInstance(CPSFileProcessTest.java:39)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:60)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
at java.lang.reflect.Method.invoke(Method.java:611)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
at org.junit.runners.BlockJUnit4ClassRunner.runNotIgnored(BlockJUnit4ClassRunner.java:79)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:71)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:49)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)