unreachable variable for groovy script


Hi.. I am doing a similar script to configure DB. Above is my script.

    public class ConfigurationDB {
    public static final instance = new ConfigurationDB ();
    def String url
    def String server
    def String port
    def String database
    def String user
    def String password
    static getInstance() {
    return instance;
    public ConfigurationDB () {
    this.server = "localhost";
    this.port = "5432";
    this.database = "db";
    this.user = "user";
    this.password = "pass";
    this.url = "jdbc:postgresql://"+this.server+":"+this.port+"/"+this.database;

when I do the test separately for each value, I obtain the correct result for each one, but when I tried to test the total connector I have the next error:

    Tipo de Expresion no admitido para la prueba:
    Parametro de entrada script esta usando una expresion que contiene una referencia inalcanzable.
    Type of expression unadmitted for the test:
    Imput Parameter 'script' is using a expression that contain a unreachable variable.

thank you.. regards...

2 answers



It shouldn't happen....

one solution is to extract the connector from zip to a folder, look at the files inside,

and create a connector definition & implementation with the code as in the connector I gave you.


Submitted by clara.lopez on Mon, 07/20/2015 - 15:40

I tried to do that, but when I go in: development -> connector -> new definition I don't see Java connector option.. :(

No sé si tiene que ver con mi versión de Bonita, estaba mirando otros ejemplos y en todos aparece como que yo puedo usar directamente ese conector, pero cuando descargue el mismo conector de otro lado, me da el mismo error.

Thank you..

Submitted by david.doumeche.itk on Mon, 07/20/2015 - 15:45

You must create a definition first,

and then the java connector is created automatically when you create an implementation


Submitted by clara.lopez on Tue, 07/21/2015 - 15:38

Hi David..

Yesterday, I download again the connector and I import in Bonita, It's work. Perhaps the file was damaging when I download.

Now I can read the properties file and the problem is solved...

Thank you, thank you for your time.. :) regards.. que estes bien!!!

Submitted by david.doumeche.itk on Tue, 07/21/2015 - 15:41

I am very glad it finally work.

Beware to put the connector where it will always be read when necessary : - as the first connector in the task when it's needed - at the process pool connector

Bien à toi


Hi Johana,

I dont understand why you need to write a script to connect to a postgresql database server (if I understand well). You have Jdbc postgresql connectors for that.

The message : Imput Parameter 'script' is using a expression that contain a unreachable variable <-- where do you use that expression 'script' ?


Submitted by clara.lopez on Tue, 06/30/2015 - 18:50

Hi David,

thank you for your time...

I need manage a configuration in one place because I use many connectors in my process, and my idea is when I update parameter(example change the database name or a username) in configuration, I only change in one place (in the script file in this case).

I tried create a Java Object Properties to read a properties file but I get the same error.

When I configure my connection I tried similar bellow: In connector configuration I put parameters; url, username, password Example: In username parameter I put ConfigurationDB.instance.user (when I do this I get the error "unreachable variable")

http://www.ibm.com/developerworks/library/j-bpm2/Figure26.jpg (this link is a bonita interface when I configure a connection) In this parameters I tried get the script instance. Lo que no quiero hacer es poner los parámetros en duro, por que entonces cada cambio en mi configuración implicaría tocar todos los conectores que he definido. (Sorry!! I speak spanish)

regards :)

Submitted by david.doumeche.itk on Wed, 07/01/2015 - 09:08

Hello Johana,

I had the same issue and resolved it this way : first, I adapted a properties connector to bonita 6. You can import it in your bonita workspace with menu Developpement > Connectors >import connector and change the namespace

Next, I created a properties file inside bonita home folder : in developpement mode : C:\BonitaBPMCommunity-6.3.8bis\workspace\tomcat\bonita in hosting mode : C:\BonitaBPMCommunity-6.3.8-JBoss-5.1.0.GA\bonita

Finally, you must configure the LoadProperties and postgresql connectors according to the following screenshot

configure loadproperties Please tell me if it solve your problem.

muchos saludos

Submitted by clara.lopez on Wed, 07/08/2015 - 16:01

Hi David,

I´m try do this, but don´t work for me. When I try import your connector example in my bonita (6.5.1) I get this error: "Importación ha fallado. Descriptor file not found".

When I tried create a connector definition in development -> connector -> new definition I do not see the Java connector.

Submitted by david.doumeche.itk on Mon, 07/20/2015 - 10:53

Hi Johana,

you must import the connector in menu developement > connector > import connector

Submitted by clara.lopez on Mon, 07/20/2015 - 13:33

Hi.. When I import the connector in menu developement > connector > import connector, I qet this error: "Importación ha fallado. Descriptor file not found".