# Can't select custom connector in process diagram

**URL:** <https://community.ofelia.com/t/cant-select-custom-connector-in-process-diagram/11132>\
**Category:** Q&A\
**Created:** [18 March 2022 12:55 UTC](https://community.ofelia.com/t/cant-select-custom-connector-in-process-diagram/11132 "2022-03-18T12:55:42Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![oriol.puigbo](https://avatars.discourse-cdn.com/v4/letter/o/f9ae1b/32.png) [@oriol.puigbo](https://community.ofelia.com/u/oriol.puigbo)\
**Post date:** [18 March 2022 12:55 UTC](https://community.ofelia.com/t/cant-select-custom-connector-in-process-diagram/11132/1 "2022-03-18T12:55:42Z")

</div>

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&nbsp; 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&nbsp;&nbsp;"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

---

<div class="post-metadata">

**Author:** ![romain.bioteau](https://dub1.discourse-cdn.com/flex013/user_avatar/community.ofelia.com/romain.bioteau/32/720_2.png) [@romain.bioteau](https://community.ofelia.com/u/romain.bioteau)\
**Post date:** [23 March 2022 09:25 UTC](https://community.ofelia.com/t/cant-select-custom-connector-in-process-diagram/11132/2 "2022-03-23T09:25:54Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![oriol.puigbo](https://avatars.discourse-cdn.com/v4/letter/o/f9ae1b/32.png) [@oriol.puigbo](https://community.ofelia.com/u/oriol.puigbo)\
**Post date:** [25 March 2022 11:57 UTC](https://community.ofelia.com/t/cant-select-custom-connector-in-process-diagram/11132/3 "2022-03-25T11:57:00Z")

</div>

Hi!

Thanks for your answer. I tried using the command you provided and I can see that bonita doesn't find any connector&nbsp;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:&nbsp; 1.067 s  
[INFO] Finished at: 2022-03-25T12:42:30+01:00  
[INFO] ------------------------------------------------------------------------  
&nbsp;

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

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

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

Cheers,

Oriol

&nbsp;

&nbsp;

---

<div class="post-metadata">

**Author:** ![romain.bioteau](https://dub1.discourse-cdn.com/flex013/user_avatar/community.ofelia.com/romain.bioteau/32/720_2.png) [@romain.bioteau](https://community.ofelia.com/u/romain.bioteau)\
**Post date:** [25 March 2022 13:08 UTC](https://community.ofelia.com/t/cant-select-custom-connector-in-process-diagram/11132/4 "2022-03-25T13:08:32Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![oriol.puigbo](https://avatars.discourse-cdn.com/v4/letter/o/f9ae1b/32.png) [@oriol.puigbo](https://community.ofelia.com/u/oriol.puigbo)\
**Post date:** [25 March 2022 13:22 UTC](https://community.ofelia.com/t/cant-select-custom-connector-in-process-diagram/11132/5 "2022-03-25T13:22:14Z")

</div>

I do have the descriptors&nbsp;(\*.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.

&nbsp;

---

<div class="post-metadata">

**Author:** ![romain.bioteau](https://dub1.discourse-cdn.com/flex013/user_avatar/community.ofelia.com/romain.bioteau/32/720_2.png) [@romain.bioteau](https://community.ofelia.com/u/romain.bioteau)\
**Post date:** [26 March 2022 09:00 UTC](https://community.ofelia.com/t/cant-select-custom-connector-in-process-diagram/11132/6 "2022-03-26T09:00:00Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![oriol.puigbo](https://avatars.discourse-cdn.com/v4/letter/o/f9ae1b/32.png) [@oriol.puigbo](https://community.ofelia.com/u/oriol.puigbo)\
**Post date:** [28 March 2022 16:06 UTC](https://community.ofelia.com/t/cant-select-custom-connector-in-process-diagram/11132/7 "2022-03-28T16:06:59Z")

</div>

Hi!

mqtt-publish-ij.def:

```
<?xml version="1.0" encoding="UTF-8"?>
<definition:ConnectorDefinition xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:definition="http://www.bonitasoft.org/ns/connector/definition/6.1">
    <id>mqtt-publish-ij</id> <!-- Id of the definition -->
    <version>1.0.0</version> <!-- Version of the definition -->
    <icon>connector.png</icon> <!-- The icon used in the Studio for this definition -->
    <category icon="connector.png" id="Custom"/> <!-- The category of this definition, used in the Studio (e.g: http, script ...) -->

    <!-- Connector inputs -->
    <input mandatory="true" name="brokerHost" type="java.lang.String"/>
    <input mandatory="true" name="brokerPort" type="java.lang.Integer"/>
    <input mandatory="true" name="topic" type="java.lang.String"/>
    <input mandatory="true" name="qos" type="java.lang.String" />
    <input mandatory="true" name="message" type="java.lang.Integer" />

    <!-- Connector outputs -->
    <output name="result" type="java.lang.String"/>

    <!--
       Pages and widgets to use the connector in the Bonita Studio.
       - Each widget must be bound to an input
       - Page titles must be defined in the properties files
       - Widget labels must be defined in the properties files
       - Page and widget descriptions can be defined in the properties files (optional)
    -->
    <page id="mqttPublishPage">
        <widget xsi:type="definition:Text" id="brokerHostWidget" inputName="brokerHost"/>
        <widget xsi:type="definition:Text" id="brokerPortWidget" inputName="brokerPort"/>
        <widget xsi:type="definition:Text" id="topicWidget" inputName="topic"/>
        <widget xsi:type="definition:Select" id="qosWidget" inputName="qos">
            <items>0</items>
            <items>1</items>
            <items>2</items>
        <widget xsi:type="definition:Text" id="messageWidget" inputName="message"/>
    </page>

</definition:ConnectorDefinition>
```

mqtt-publish-ij.impl:

```
 
```

\<?xml version="1.0" encoding="UTF-8"?\>  
\<implementation:connectorImplementation xmlns:implementation="http://www.bonitasoft.org/ns/connector/implementation/6.0"\>  
&nbsp; \<implementationId\>mqtt-publish-ij-impl\</implementationId\> \<!-- Id of the implementation --\>  
&nbsp; \<implementationVersion\>1.0-SNAPSHOT\</implementationVersion\> \<!-- Version of the implementation --\>  
&nbsp; \<definitionId\>mqtt-publish-ij\</definitionId\> \<!-- Id of the definition implemented --\>  
&nbsp; \<definitionVersion\>1.0.0\</definitionVersion\> \<!-- Version of the definition implemented --\>  
&nbsp; \<implementationClassname\>eu.gtd.MqttPublishConnector\</implementationClassname\> \<!-- Path to the main implementation class --\>  
&nbsp; \<description\>Default mqtt-publish-ij implementation\</description\>

\<!-- retrieved from the pom.xml at build time --\>  
\<jarDependencies\>  
&nbsp; \<jarDependency\>mqtt-publish-ij-1.0-SNAPSHOT.jar\</jarDependency\>  
\</jarDependencies\>

\</implementation:connectorImplementation\>

---

<div class="post-metadata">

**Author:** ![romain.bioteau](https://dub1.discourse-cdn.com/flex013/user_avatar/community.ofelia.com/romain.bioteau/32/720_2.png) [@romain.bioteau](https://community.ofelia.com/u/romain.bioteau)\
**Post date:** [28 March 2022 19:01 UTC](https://community.ofelia.com/t/cant-select-custom-connector-in-process-diagram/11132/8 "2022-03-28T19:01:28Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![oriol.puigbo](https://avatars.discourse-cdn.com/v4/letter/o/f9ae1b/32.png) [@oriol.puigbo](https://community.ofelia.com/u/oriol.puigbo)\
**Post date:** [29 March 2022 07:30 UTC](https://community.ofelia.com/t/cant-select-custom-connector-in-process-diagram/11132/9 "2022-03-29T07:30:49Z")

</div>

```
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
```

---

<div class="post-metadata">

**Author:** ![romain.bioteau](https://dub1.discourse-cdn.com/flex013/user_avatar/community.ofelia.com/romain.bioteau/32/720_2.png) [@romain.bioteau](https://community.ofelia.com/u/romain.bioteau)\
**Post date:** [29 March 2022 08:31 UTC](https://community.ofelia.com/t/cant-select-custom-connector-in-process-diagram/11132/10 "2022-03-29T08:31:19Z")

</div>

😕

Weird… can you send me the jar file ?  
You may use a service like [WeTransfer](https://wetransfer.com/)

Thanks

---

<div class="post-metadata">

**Author:** ![oriol.puigbo](https://avatars.discourse-cdn.com/v4/letter/o/f9ae1b/32.png) [@oriol.puigbo](https://community.ofelia.com/u/oriol.puigbo)\
**Post date:** [29 March 2022 12:35 UTC](https://community.ofelia.com/t/cant-select-custom-connector-in-process-diagram/11132/11 "2022-03-29T12:35:14Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![romain.bioteau](https://dub1.discourse-cdn.com/flex013/user_avatar/community.ofelia.com/romain.bioteau/32/720_2.png) [@romain.bioteau](https://community.ofelia.com/u/romain.bioteau)\
**Post date:** [29 March 2022 15:37 UTC](https://community.ofelia.com/t/cant-select-custom-connector-in-process-diagram/11132/12 "2022-03-29T15:37:32Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![oriol.puigbo](https://avatars.discourse-cdn.com/v4/letter/o/f9ae1b/32.png) [@oriol.puigbo](https://community.ofelia.com/u/oriol.puigbo)\
**Post date:** [30 March 2022 09:19 UTC](https://community.ofelia.com/t/cant-select-custom-connector-in-process-diagram/11132/13 "2022-03-30T09:19:39Z")

</div>

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