Bonita Conector using Spring Boot

Hi, 

I'm trying to create a Bonita Conector (using Bonita connector archetype) but I can't use the @Value from Spring Boot (returns null).

The implementation that I'm using is:

Conector.properties: 

bpm.url=${BPM_URL:http://docker.localhost}

 

Class:

@Value("${bpm.url}"
private String url;

 

pom.xml:

<dependency>
   <groupId>org.springframework</groupId>
   <artifactId>spring-context</artifactId>
   <version>5.2.9.RELEASE</version>
</dependency>
;
<dependency>
   <groupId>org.springframework</groupId>
   <artifactId>spring-core</artifactId>
   <version>5.2.9.RELEASE</version>
</dependency>

When I try, for example, print the value of "url" it returns null. Can someone help me?

 

Thanks in advance

Diana

Hi Diana,
I’m afraid this is currently not possible. Connectors are not spring beans so they are not aware of the spring context.
It is however a good improvement feedback.

Thanks for sharing.
Romain

Hi Romain, thanks for your help! Is there another option for the problem (without using Spring Boot)? The problem is: I'm using an external API for a project and I don't pretend to have in code the username and password to create a valid token to do all the operations that I need.

Thanks,

Diana

Username and password should be connector input in the connector definition. Then use a parameter when configuring the connector in a process