添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
相关文章推荐
健壮的烤地瓜  ·  RK3568 Android11 获取 ...·  2 月前    · 
爱玩的黑框眼镜  ·  ZYMAD - VIDAL·  7 月前    · 
气势凌人的红豆  ·  Could not perform ...·  8 月前    · 

Hi all, i’m trying to make a post call through http connector. I’ve followed the following blog . Here’s how my bpmn file looks like.

<?xml version="1.0" encoding="UTF-8"?>
<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" id="Definitions_1l230i5" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="3.7.2">
  <bpmn:process id="MSTeam" isExecutable="true">
    <bpmn:startEvent id="StartEvent_1">
      <bpmn:outgoing>Flow_18ctwbo</bpmn:outgoing>
    </bpmn:startEvent>
    <bpmn:sequenceFlow id="Flow_18ctwbo" sourceRef="StartEvent_1" targetRef="Activity_0yrauta" />
    <bpmn:endEvent id="Event_029y4fl">
      <bpmn:incoming>Flow_0lfdhj8</bpmn:incoming>
    </bpmn:endEvent>
    <bpmn:sequenceFlow id="Flow_0lfdhj8" sourceRef="Activity_0yrauta" targetRef="Event_029y4fl" />
    <bpmn:serviceTask id="Activity_0yrauta" name="Send MS Team Message">
      <bpmn:extensionElements>
        <camunda:connector>
          <camunda:inputOutput>
            <camunda:inputParameter name="url">https://graph.microsoft.com/beta/me/chats/19:[email protected]/messages</camunda:inputParameter>
            <camunda:inputParameter name="method">POST</camunda:inputParameter>
            <camunda:inputParameter name="headers">
              <camunda:map>
                <camunda:entry key="Content-Type">application/json</camunda:entry>
                <camunda:entry key="Authorization">${token}</camunda:entry>
                <camunda:entry key="Accept">application/json</camunda:entry>
              </camunda:map>
            </camunda:inputParameter>
            <camunda:inputParameter name="payload">
              <camunda:script scriptFormat="JavaScript">'{"body": {"content" : "Test from camunda"}}';</camunda:script>
            </camunda:inputParameter>
          </camunda:inputOutput>
          <camunda:connectorId>http-post</camunda:connectorId>
        </camunda:connector>
      </bpmn:extensionElements>
      <bpmn:incoming>Flow_18ctwbo</bpmn:incoming>
      <bpmn:outgoing>Flow_0lfdhj8</bpmn:outgoing>
    </bpmn:serviceTask>
  </bpmn:process>
  <bpmndi:BPMNDiagram id="BPMNDiagram_1">
    <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="MSTeam">
      <bpmndi:BPMNEdge id="Flow_18ctwbo_di" bpmnElement="Flow_18ctwbo">
        <di:waypoint x="215" y="117" />
        <di:waypoint x="320" y="117" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="Flow_0lfdhj8_di" bpmnElement="Flow_0lfdhj8">
        <di:waypoint x="420" y="117" />
        <di:waypoint x="532" y="117" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNShape id="_BPMNShape_StartEvent_2" bpmnElement="StartEvent_1">
        <dc:Bounds x="179" y="99" width="36" height="36" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="Event_029y4fl_di" bpmnElement="Event_029y4fl">
        <dc:Bounds x="532" y="99" width="36" height="36" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="Activity_1v1tqko_di" bpmnElement="Activity_0yrauta">
        <dc:Bounds x="320" y="77" width="100" height="80" />
      </bpmndi:BPMNShape>
    </bpmndi:BPMNPlane>
  </bpmndi:BPMNDiagram>
</bpmn:definitions>

But when I run the application it generates the following error. Would appreciate any help/guidance thank you.

org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.camunda.bpm.engine.spring.SpringProcessEngineServicesConfiguration': Unsatisfied dependency expressed through field 'processEngine'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'processEngineFactoryBean': FactoryBean threw exception on object creation; nested exception is org.camunda.bpm.engine.ParseException: ENGINE-09005 Could not parse BPMN process. Errors: 
* One of the attributes 'class', 'delegateExpression', 'type', or 'expression' is mandatory on serviceTask. | resource C:\Camunda\projects\WorkflowEngine.SOP.Unistad\emergency-evacuation\target\classes\MSTeam.bpmn | line 12 | column 73
	at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:643) ~[spring-beans-5.2.4.RELEASE.jar:5.2.4.RELEASE]
	at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:130) ~[spring-beans-5.2.4.RELEASE.jar:5.2.4.RELEASE]
	at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessProperties(AutowiredAnnotationBeanPostProcessor.java:399) ~[spring-beans-5.2.4.RELEASE.jar:5.2.4.RELEASE]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1422) ~[spring-beans-5.2.4.RELEASE.jar:5.2.4.RELEASE]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:594) ~[spring-beans-5.2.4.RELEASE.jar:5.2.4.RELEASE]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:517) ~[spring-beans-5.2.4.RELEASE.jar:5.2.4.RELEASE]
	at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:323) ~[spring-beans-5.2.4.RELEASE.jar:5.2.4.RELEASE]
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) ~[spring-beans-5.2.4.RELEASE.jar:5.2.4.RELEASE]
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:321) ~[spring-beans-5.2.4.RELEASE.jar:5.2.4.RELEASE]
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202) ~[spring-beans-5.2.4.RELEASE.jar:5.2.4.RELEASE]
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:879) ~[spring-beans-5.2.4.RELEASE.jar:5.2.4.RELEASE]
	at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:878) ~[spring-context-5.2.4.RELEASE.jar:5.2.4.RELEASE]
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:550) ~[spring-context-5.2.4.RELEASE.jar:5.2.4.RELEASE]
	at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:141) ~[spring-boot-2.2.5.RELEASE.jar:2.2.5.RELEASE]
	at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:747) ~[spring-boot-2.2.5.RELEASE.jar:2.2.5.RELEASE]
	at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397) ~[spring-boot-2.2.5.RELEASE.jar:2.2.5.RELEASE]
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:315) ~[spring-boot-2.2.5.RELEASE.jar:2.2.5.RELEASE]
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1226) ~[spring-boot-2.2.5.RELEASE.jar:2.2.5.RELEASE]
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1215) ~[spring-boot-2.2.5.RELEASE.jar:2.2.5.RELEASE]
	at com.jci.bmp.Application.main(Application.java:10) ~[classes/:na]
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'processEngineFactoryBean': FactoryBean threw exception on object creation; nested exception is org.camunda.bpm.engine.ParseException: ENGINE-09005 Could not parse BPMN process. Errors: 
* One of the attributes 'class', 'delegateExpression', 'type', or 'expression' is mandatory on serviceTask. | resource C:\Camunda\projects\WorkflowEngine.SOP.Unistad\emergency-evacuation\target\classes\MSTeam.bpmn | line 12 | column 73
	at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.doGetObjectFromFactoryBean(FactoryBeanRegistrySupport.java:178) ~[spring-beans-5.2.4.RELEASE.jar:5.2.4.RELEASE]
	at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.getObjectFromFactoryBean(FactoryBeanRegistrySupport.java:101) ~[spring-beans-5.2.4.RELEASE.jar:5.2.4.RELEASE]
	at org.springframework.beans.factory.support.AbstractBeanFactory.getObjectForBeanInstance(AbstractBeanFactory.java:1818) ~[spring-beans-5.2.4.RELEASE.jar:5.2.4.RELEASE]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.getObjectForBeanInstance(AbstractAutowireCapableBeanFactory.java:1266) ~[spring-beans-5.2.4.RELEASE.jar:5.2.4.RELEASE]
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:260) ~[spring-beans-5.2.4.RELEASE.jar:5.2.4.RELEASE]
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202) ~[spring-beans-5.2.4.RELEASE.jar:5.2.4.RELEASE]
	at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:276) ~[spring-beans-5.2.4.RELEASE.jar:5.2.4.RELEASE]
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.addCandidateEntry(DefaultListableBeanFactory.java:1510) ~[spring-beans-5.2.4.RELEASE.jar:5.2.4.RELEASE]
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.findAutowireCandidates(DefaultListableBeanFactory.java:1467) ~[spring-beans-5.2.4.RELEASE.jar:5.2.4.RELEASE]
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1250) ~[spring-beans-5.2.4.RELEASE.jar:5.2.4.RELEASE]
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1207) ~[spring-beans-5.2.4.RELEASE.jar:5.2.4.RELEASE]
	at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:640) ~[spring-beans-5.2.4.RELEASE.jar:5.2.4.RELEASE]
	... 19 common frames omitted
Caused by: org.camunda.bpm.engine.ParseException: ENGINE-09005 Could not parse BPMN process. Errors: 
* One of the attributes 'class', 'delegateExpression', 'type', or 'expression' is mandatory on serviceTask. | resource C:\Camunda\projects\WorkflowEngine.SOP.Unistad\emergency-evacuation\target\classes\MSTeam.bpmn | line 12 | column 73
	at org.camunda.bpm.engine.impl.util.EngineUtilLogger.exceptionDuringParsing(EngineUtilLogger.java:66) ~[camunda-engine-7.12.0.jar:7.12.0]
	at org.camunda.bpm.engine.impl.util.xml.Parse.throwExceptionForErrors(Parse.java:254) ~[camunda-engine-7.12.0.jar:7.12.0]
	at org.camunda.bpm.engine.impl.bpmn.parser.BpmnParse.execute(BpmnParse.java:272) ~[camunda-engine-7.12.0.jar:7.12.0]
	at org.camunda.bpm.engine.impl.bpmn.deployer.BpmnDeployer.transformDefinitions(BpmnDeployer.java:105) ~[camunda-engine-7.12.0.jar:7.12.0]
	at org.camunda.bpm.engine.impl.AbstractDefinitionDeployer.transformResource(AbstractDefinitionDeployer.java:99) ~[camunda-engine-7.12.0.jar:7.12.0]
	at org.camunda.bpm.engine.impl.AbstractDefinitionDeployer.parseDefinitionResources(AbstractDefinitionDeployer.java:74) ~[camunda-engine-7.12.0.jar:7.12.0]
	at org.camunda.bpm.engine.impl.AbstractDefinitionDeployer.deploy(AbstractDefinitionDeployer.java:64) ~[camunda-engine-7.12.0.jar:7.12.0]
	at org.camunda.bpm.engine.impl.persistence.deploy.cache.CacheDeployer$1.call(CacheDeployer.java:54) ~[camunda-engine-7.12.0.jar:7.12.0]
	at org.camunda.bpm.engine.impl.persistence.deploy.cache.CacheDeployer$1.call(CacheDeployer.java:51) ~[camunda-engine-7.12.0.jar:7.12.0]
	at org.camunda.bpm.engine.impl.interceptor.CommandContext.runWithoutAuthorization(CommandContext.java:537) ~[camunda-engine-7.12.0.jar:7.12.0]
	at org.camunda.bpm.engine.impl.persistence.deploy.cache.CacheDeployer.deploy(CacheDeployer.java:51) ~[camunda-engine-7.12.0.jar:7.12.0]
	at org.camunda.bpm.engine.impl.persistence.deploy.cache.DeploymentCache.deploy(DeploymentCache.java:67) ~[camunda-engine-7.12.0.jar:7.12.0]
	at org.camunda.bpm.engine.impl.persistence.entity.DeploymentManager.insertDeployment(DeploymentManager.java:65) ~[camunda-engine-7.12.0.jar:7.12.0]
	at org.camunda.bpm.engine.impl.cmd.DeployCmd.deploy(DeployCmd.java:255) ~[camunda-engine-7.12.0.jar:7.12.0]
	at org.camunda.bpm.engine.impl.cmd.DeployCmd$1.call(DeployCmd.java:156) ~[camunda-engine-7.12.0.jar:7.12.0]
	at org.camunda.bpm.engine.impl.cmd.DeployCmd$1.call(DeployCmd.java:142) ~[camunda-engine-7.12.0.jar:7.12.0]
	at org.camunda.bpm.engine.impl.interceptor.CommandContext.runWithoutAuthorization(CommandContext.java:537) ~[camunda-engine-7.12.0.jar:7.12.0]
	at org.camunda.bpm.engine.impl.cmd.DeployCmd.doExecute(DeployCmd.java:142) ~[camunda-engine-7.12.0.jar:7.12.0]
	at org.camunda.bpm.engine.impl.cmd.DeployCmd.execute(DeployCmd.java:102) ~[camunda-engine-7.12.0.jar:7.12.0]
	at org.camunda.bpm.engine.impl.cmd.DeployCmd.execute(DeployCmd.java:82) ~[camunda-engine-7.12.0.jar:7.12.0]
	at org.camunda.bpm.engine.impl.interceptor.CommandExecutorImpl.execute(CommandExecutorImpl.java:28) ~[camunda-engine-7.12.0.jar:7.12.0]
	at org.camunda.bpm.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:110) ~[camunda-engine-7.12.0.jar:7.12.0]
	at org.camunda.bpm.engine.spring.SpringTransactionInterceptor$1.doInTransaction(SpringTransactionInterceptor.java:46) ~[camunda-engine-spring-7.12.0.jar:7.12.0]
	at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:140) ~[spring-tx-5.2.4.RELEASE.jar:5.2.4.RELEASE]
	at org.camunda.bpm.engine.spring.SpringTransactionInterceptor.execute(SpringTransactionInterceptor.java:44) ~[camunda-engine-spring-7.12.0.jar:7.12.0]
	at org.camunda.bpm.engine.impl.interceptor.ProcessApplicationContextInterceptor.execute(ProcessApplicationContextInterceptor.java:70) ~[camunda-engine-7.12.0.jar:7.12.0]
	at org.camunda.bpm.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:33) ~[camunda-engine-7.12.0.jar:7.12.0]
	at org.camunda.bpm.engine.impl.RepositoryServiceImpl.deployWithResult(RepositoryServiceImpl.java:102) ~[camunda-engine-7.12.0.jar:7.12.0]
	at org.camunda.bpm.engine.impl.repository.DeploymentBuilderImpl.deployWithResult(DeploymentBuilderImpl.java:270) ~[camunda-engine-7.12.0.jar:7.12.0]
	at org.camunda.bpm.engine.impl.repository.DeploymentBuilderImpl.deploy(DeploymentBuilderImpl.java:266) ~[camunda-engine-7.12.0.jar:7.12.0]
	at org.camunda.bpm.engine.spring.SpringTransactionsProcessEngineConfiguration.autoDeployResources(SpringTransactionsProcessEngineConfiguration.java:144) ~[camunda-engine-spring-7.12.0.jar:7.12.0]
	at org.camunda.bpm.engine.spring.SpringTransactionsProcessEngineConfiguration.buildProcessEngine(SpringTransactionsProcessEngineConfiguration.java:64) ~[camunda-engine-spring-7.12.0.jar:7.12.0]
	at org.camunda.bpm.engine.spring.ProcessEngineFactoryBean.getObject(ProcessEngineFactoryBean.java:55) ~[camunda-engine-spring-7.12.0.jar:7.12.0]
	at org.camunda.bpm.engine.spring.ProcessEngineFactoryBean.getObject(ProcessEngineFactoryBean.java:34) ~[camunda-engine-spring-7.12.0.jar:7.12.0]
	at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.doGetObjectFromFactoryBean(FactoryBeanRegistrySupport.java:171) ~[spring-beans-5.2.4.RELEASE.jar:5.2.4.RELEASE]
	... 30 common frames omitted
    @Ingo_Richtsmeier after adding the camunda-engine-plugin-connect dependency also the issue persists. 
dependencies added for mail-connectors are: 
compile group: 'org.camunda.bpm', name: 'camunda-engine-plugin-connect', version: '7.11.0'
compile group: 'org.camunda.connect', name: 'camunda-connect-connectors-all', version: '1.2.2'
compile group: 'org.camunda.connect', name: 'camunda-connect-core', version: '1.2.2'
compile group: 'org.camunda.bpm.extension', name: 'camunda-bpm-mail-core', version…

If you’re using camunda.cfg.xml then add below entry to register connector plugin:

<property name="processEnginePlugins">
       <bean class="org.camunda.connect.plugin.impl.ConnectProcessEnginePlugin" />
     </list>
</property>

(or) Just provide a bean instance it will get auto registered in spring boot environment.

@Bean
public ConnectProcessEnginePlugin getConnectProcessEnginePlugin {
   return new ConnectProcessEnginePlugin();
    @rizwan, In modeler, you can configure in which service task can use connector, and can set the connector related configurations. But in order to work with connectors, you need to configure connect plugin and add required dependencies to the classpath which are pre-requisites for connector execution. Refer this docs for Configure Camunda Connect. 
Read about Http Connector here: https://docs.camunda.org/manual/7.12/reference/connect/http-connector/ 
Read this blog: https://blog.camunda.com/post/…
    @markivkc25 did you configure/included the dependencies mentioned in configure-camunda-connect  docs? 
In Service Task are you making any REST/SOAP request? 
Did you register the ConnectProcessEnginePlugin to the process engine configuration? 
<plugins>
   <plugin>
      <class>org.camunda.connect.plugin.impl.ConnectProcessEnginePlugin</class>
   </plugin>
</plugins>
              

Hi Thanks for sharing it. I’ve gone through it and seem a complicated solution. I’ve tried adding the camunda.cfg.xml in the resources folder and added the missing dependency in the pom.xml file. But still the issue is still there. For your reference I’m uploading a complete project file, so it would be easier to look into the configuration. Would appreciate any help, thank you.

Project.zip

Hi @hello.aliasad,

the camunda spring boot starter ignores the camunda.cfg.xml file.

Spring black magic loads the connector, once the right dependencies are available.

Hope this helps, Ingo

Hi @hello.aliasad,

well, when I learned Java a long time ago, you had to explicitly write code to get all the things done.

With the Spring framework this changed. They brought a lot of XML configuration for the components you combine to a running application. (camunda.cfg.xml is one example)

With Spring Boot, there is no need to write XML configurations any more. Looking at this with the experience from the past, it’s sometimes a bit scary and you think by yourself: “How does this happen? I havn’t written any code to do it”. This is what I refer to black magic. On the Spring boot homepage, they just name it “Spring magic”: https://spring.io/projects/spring-boot.

If you want to get familar with this, I recommend to have a look at the spring boot docs.

Hope this helps, Ingo