cancel
Showing results for 
Search instead for 
Did you mean: 

Activiti with Camel with servicemix

rameshbabu
Champ in-the-making
Champ in-the-making
Hi ,

I want to do one application with Activiti with Camel with servicemix using spring


please share some samples.
2 REPLIES 2

vasile_dirla
Star Contributor
Star Contributor
Did you check the documentation ?
http://www.activiti.org/userguide

rameshbabu
Champ in-the-making
Champ in-the-making
I have gone through the document… I did not find good example for camel with activiti with spring for calling web service using activiti

can u please provide …?

My example is:
————-
helloworld.bpmn20.xml
——————–

<process id="webServiceInvocation" isExecutable="true">

  <startEvent id="theStart" />

  <sequenceFlow id="flow1" sourceRef="theStart" targetRef="webService" />
  <serviceTask id="webService" name="Web service invocation"
   implementation="org.example.newwsdlfile.ActualInterfaceImpl"
   operationRef="actual:actualOperation"
   activiti:class="org.activiti.camel.route.CamelDelegate">
   <extensionElements>
    <activiti:field name="wsdl"
     expression="http://localhost:8181/cxf/actualService?wsdl" />
    <activiti:field name="operation" expression="actualOperation" />
    <!– <activiti:field name="parameters" expression="" /> –>
    <activiti:field name="returnValue" expression="myReturn" />
   </extensionElements>
  </serviceTask>
  <sequenceFlow id="flow2" sourceRef="webService"
   targetRef="theEnd" />
  <endEvent id="theEnd" />
</process>

camel route :
———-

from("cxf:bean:HelloService")

  .to("log:requestreceived?showAll=true&multiline=true")

  .to("xquery:xquery/Actual-Service-Request.xq")

  .to("log:after converting hello service into actual servrice?showAll=true&multiline=true")

  .to("activiti:webServiceInvocation");
 

  .convertBodyTo(String.class)

  .to("xquery:xquery/Hello-Interface-Response.xq")

  .to("log:response?showAll=true&multiline=true");



activiti-application-context.xml
————————–

<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:context="http://www.springframework.org/schema/context" xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:jaxws="http://cxf.apache.org/jaxws"

xsi:schemaLocation="http://www.springframework.org/schema/beans   
                           http://www.springframework.org/schema/beans/spring-beans.xsd
                           http://www.springframework.org/schema/context 
                           http://www.springframework.org/schema/context/spring-context-3.0.xsd
                           http://www.springframework.org/schema/tx      
                           http://www.springframework.org/schema/tx/spring-tx-3.0.xsd
                           http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd">



<bean id="dataSource"
  class="org.springframework.jdbc.datasource.SimpleDriverDataSource">
  <property name="driverClass" value="org.h2.Driver" />
  <property name="url" value="jdbc:h2:mem:activiti;DB_CLOSE_DELAY=1000" />
  <property name="username" value="sa" />
  <property name="password" value="" />
</bean>

<bean id="transactionManager"
  class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
  <property name="dataSource" ref="dataSource" />
</bean>


<bean id="processEngineConfiguration" class="org.activiti.spring.SpringProcessEngineConfiguration">
  <property name="dataSource" ref="dataSource" />
  <property name="transactionManager" ref="transactionManager" />
  <property name="databaseSchemaUpdate" value="true" />
  <property name="jobExecutorActivate" value="true" />
  <property name="history" value="full" />
  <!– <property name="deploymentMode" value="single-resource" /> –>
      <property name="deploymentResources" value="classpath*:helloworld.bpmn20.xml" />
</bean>

<bean id="processEngine" class="org.activiti.spring.ProcessEngineFactoryBean">
  <property name="processEngineConfiguration" ref="processEngineConfiguration" />
</bean>





<bean id="repositoryService" factory-bean="processEngine"

  factory-method="getRepositoryService" />

<bean id="runtimeService" factory-bean="processEngine"

  factory-method="getRuntimeService" />

<bean id="taskService" factory-bean="processEngine"

  factory-method="getTaskService" />

<bean id="historyService" factory-bean="processEngine"

  factory-method="getHistoryService" />

<bean id="managementService" factory-bean="processEngine"

  factory-method="getManagementService" />

<bean id="identityService" factory-bean="processEngine"

  factory-method="getIdentityService" />




</beans>


camel-application-context.xml
————————–

<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:camel="http://camel.apache.org/schema/spring"
xmlns:cxf="http://camel.apache.org/schema/cxf" xmlnsSmiley Surprisedsgi="http://www.springframework.org/schema/osgi"
xmlns:jaxws="http://cxf.apache.org/jaxws"

xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
      http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd
      http://camel.apache.org/schema/cxf http://camel.apache.org/schema/cxf/camel-cxf.xsd
      http://www.springframework.org/schema/osgi  http://www.springframework.org/schema/osgi/spring-osgi.xsd
      http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd">

<camelContext id="camelProcess" xmlns="http://camel.apache.org/schema/spring">
  <packageScan>
   <package>org.activiti.camel.route</package>
  </packageScan>
 

</camelContext>


<cxf:cxfEndpoint id="HelloService" address="http://localhost:8282/hello"
  xmlns:hello="http://security.sample.com/" endpointName="hello:HelloWorldImplPort"
  serviceName="hello:HelloWorldImplService" wsdlURL="Hello-Interface.wsdl"
  serviceClass="com.sample.security.HelloWorld">

  <cxfSmiley Tongueroperties>
   <entry key="dataFormat" value="PAYLOAD" />
   <entry key="receiveTimeout" value="15000" />
   <entry key="connectionTimeout" value="2000" />
  </cxfSmiley Tongueroperties>

</cxf:cxfEndpoint>



<jaxws:endpoint id="ActualService"
  implementor="org.example.newwsdlfile.ActualInterfaceImpl" address="/actualService"
  endpointName="actual:NewWSDLFileSOAP" serviceName="actual:Actualservice"
  xmlns:actual="http://www.example.org/NewWSDLFile/" />


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



<bean id="connectionFactory" class="org.apache.activemq.spring.ActiveMQConnectionFactory">
  <property name="brokerURL" value="tcp://localhost:61616" />
</bean>

<osgi:reference id="runtimeService" interface="org.activiti.engine.RuntimeService" />


</beans>


I am facing issue as no process found with name "webServiceInvocation" like..please guide me…
Getting started

Tags


Find what you came for

We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.