Variable in DB Connector

1
0
-1

Hello I'm trying to pass a whole sql string into the connector.

For example i have the var SQLSTRING

then in the connector i only write ${SQLSTRING}

when i try to test the connector the following message appears

"Type of expression not admitted for test:
-Entry parameter ┬┤script' is using an expression that contains an unreachable reference"

why is this happening?

Thanks

Comments

Submitted by antoine.mottier on Thu, 10/01/2015 - 15:11

When configuring the connector, on the "Enter query" configuration page, did you clicked on "Switch editor..." link and then select your variable in the drop down list?

Submitted by ffernandezc on Thu, 10/01/2015 - 15:39

i did that also and still shows me that message.

This is what i inserted in the script

return ${SQLSTRING};

Submitted by antoine.mottier on Thu, 10/01/2015 - 16:02

How did you declare the SQLSTRING?

Also you should not open the Expression Editor but you be able to just select your variable in the drop down list.

Submitted by ffernandezc on Thu, 10/01/2015 - 16:16

The variable is a text process variable.

that process variable is populated data that comes in a message from another diagram

Submitted by antoine.mottier on Fri, 10/02/2015 - 09:40

Can you share your diagram so I can take a look?

Submitted by gael.tarot on Fri, 10/02/2015 - 11:09

The "Switch Editor" workaround worked for me, this is a bit more complicated but works fine.
In deed, you have to create a Groovy script which will return your request :

return "INSERT INTO MVT_PERSONNEL (NOM_COLLABORATEUR, DATE_CHGT_PHYSIQUE, DATE_CHGT_SECTION) VALUES ('"+assignmentChangeBDM.getCollaboratorName()+"','"+assignmentChangeBDM.getDatePhysicalAssignment()+"','"+assignmentChangeBDM.getDateSectionAssignment()+"');";

I think this is linked to this bug : https://bonita.atlassian.net/projects/BBPMC/issues/BBPMC-279?filter=allo...

1 answer

1
0
-1

The message sent to the diagram for the query
d2_zps5pwjte84.png

Here is the connector that querys the DB
d1_zpsoowpetrf.png

The way the connector calls the variable that contains the SQL string sent in the message
d3_zpsstwawwjz.png

Comments

Submitted by antoine.mottier on Mon, 10/05/2015 - 13:43

Did this version of the diagram run as expected or do you still have an issue? If you still have problems can you share the process files (export as a single .bos file)?

Note that if asynchronous execution is not mandatory I would recommend to use call activities instead of messages.

Also if possible try to use Business Data Model feature that make business data storage a lot easier.

Notifications