Can't select custom connector in process diagram

1
0
-1

Hi,

I am having problems using a custom connector I just developed in Bonita Studio Community 2021.2.

I developed a custom connector using the connector maven archetype and I can successfully build it using 'mvn clean package'.

I imported it into bonita studio using New->Extension->Add a custom extension and selecting the .jar file built in the previous step. It appears correctly in the Extensions Overview of my project.

However, when I try to select it for a service task in my process using "Execution" -> "Connectors In" -> "Add", it doesn't appear as an option in the pop-up window "Select a connector definition".

What am I missing?

Oriol

1 answer

1
+1
-1
This one is the BEST answer!

Hi,

You can check that a connector definition has been found in your extension by clicking on the connector extension in the Project Overview.

If no definition is listed, then there is something wrong with your custom extension:

  • Check that there is a matching implementation for a connector definition (*.impl file)
  • Check that there is no typo in descriptors (ids, class names...)

You may run the following maven command line to check if the Bonita project analysis detect your extension properly:

(Maven installation required !) From the root of your Bonita project, execute:
mvn bonita-project:analyze

It should output something like this:

[INFO] Scanning for projects...
[INFO] 
[INFO] -----------------------< com.company:my-project >-----------------------
[INFO] Building My project 0.0.1
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] 
[INFO] --- bonita-project-maven-plugin:0.0.5:analyze (default-cli) @ my-project ---
[INFO] === 2 Connector definitions found ===
[INFO] email-1.2.0 in org.bonitasoft.connectors:bonita-connector-email:1.3.0
[INFO] ldap-1.1.0 in org.bonitasoft.connectors:bonita-connector-ldap:1.2.1
[INFO] === 2 Connector implementations found ===
[INFO] email-impl-1.3.0 for email-1.2.0 in org.bonitasoft.connectors:bonita-connector-email:1.3.0
[INFO] ldap-1.2.1 for ldap-1.1.0 in org.bonitasoft.connectors:bonita-connector-ldap:1.2.1
[INFO] === 1 Actor filter definitions found ===
[INFO] bonita-actorfilter-single-user-1.0.0 in org.bonitasoft.actorfilter:bonita-actorfilter-single-user:1.0.0
[INFO] === 1 Actor filter implementations found ===
[INFO] bonita-actorfilter-single-user-impl-1.0.0 for bonita-actorfilter-single-user-1.0.0 in org.bonitasoft.actorfilter:bonita-actorfilter-single-user:1.0.0
[INFO] === 0 Pages found ===
[INFO] === 0 Forms found
[INFO] === 0 Rest API Extensions found ===
[INFO] === 0 Themes found ===
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  1.103 s
[INFO] Finished at: 2022-03-23T10:24:35+01:00
[INFO] ------------------------------------------------------------------------

UPDATE: In this case it was an invalid .def xml file.

HTH
Romain

Comments

Submitted by oriol.puigbo on Fri, 03/25/2022 - 12:57

Hi!

Thanks for your answer. I tried using the command you provided and I can see that bonita doesn't find any connector implementation in my project.

$ mvn org.bonitasoft.maven:bonita-project-maven-plugin:analyze
[INFO] Scanning for projects...
[INFO] === 0 Connector implementations found ===
[INFO] === 0 Actor filter definitions found ===
[INFO] === 0 Actor filter implementations found ===
[INFO] === 0 Pages found ===
[INFO] === 0 Forms found
[INFO] === 0 Rest API Extensions found ===
[INFO] === 0 Themes found ===
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.067 s
[INFO] Finished at: 2022-03-25T12:42:30+01:00
[INFO] ------------------------------------------------------------------------

I find this weird as I do have a .def file and a matching .impl file:

./src/main/resources-filtered:
mqtt-publish-ij.def mqtt-publish-ij.impl mqtt-publish-ij.properties

I checked names, inputs/outpus, classnames, ... for typos but everything looks right to me.

Cheers,

Oriol

Submitted by romain.bioteau on Fri, 03/25/2022 - 14:08

Can you double-check the content of the produced jar file ? You should have the descriptors (*.def and *.impl) files at the root of the jar.

If you are developing an open source connector, I'm willing to take a look at the project to help you.

Submitted by oriol.puigbo on Fri, 03/25/2022 - 14:22

I do have the descriptors (*.def and *.impl) files at the root of the jar.

Right now it's just a rough test, I may open source it if I actually develop a nicely finished connector and my company is ok with it. I have no problem in sending you the source files if you want them.

Submitted by romain.bioteau on Sat, 03/26/2022 - 10:00

Can you share the .def and .impl content ? (the ones built in the jar file)

Submitted by oriol.puigbo on Mon, 03/28/2022 - 18:06

Hi!

mqtt-publish-ij.def:

<?xml version="1.0" encoding="UTF-8"?>

    mqtt-publish-ij 
    1.0.0 
    connector.png 
     

    
    
    
    
    
    

    
    

    
    
        
        
        
        
            0
            1
            2
        
    

mqtt-publish-ij.impl:

 

<?xml version="1.0" encoding="UTF-8"?>

mqtt-publish-ij-impl

1.0-SNAPSHOT

mqtt-publish-ij

1.0.0

eu.gtd.MqttPublishConnector

Default mqtt-publish-ij implementation


mqtt-publish-ij-1.0-SNAPSHOT.jar

Submitted by romain.bioteau on Mon, 03/28/2022 - 21:01

Can you double check that ‘eu.gtd.MqttPublishConnector’ class file is present in the built jar file ?

Submitted by oriol.puigbo on Tue, 03/29/2022 - 09:30
Yes, it is there:

OPG@ORIOL-NEW MINGW64 ~/intelij workspace/mqtt-publish-ij/target/mqtt-publish-ij-1.0-SNAPSHOT/eu/gtd (master)
$ ls
MqttPublishConnector.class
Submitted by romain.bioteau on Tue, 03/29/2022 - 10:31

:/

Weird... can you send me the jar file ? You may use a service like WeTransfer

Thanks

Submitted by oriol.puigbo on Tue, 03/29/2022 - 14:35

I uploaded the jar file here:

https://we.tl/t-UvKcT0sSjh

I can also upload the whole project if you want to take a look at it.

Submitted by romain.bioteau on Tue, 03/29/2022 - 17:37

The issue comes from the .def files. A closing </widget> tag is missing at line 33.

Submitted by oriol.puigbo on Wed, 03/30/2022 - 11:19

Thanks so much! This solved my issue and the connector appears now correctly in Bonita Studio.

Notifications