Task Connector can't reach a variable in Task Data in Service Task

1
+1
-1

I have several Service Tasks with a variable in Data (called valores, it's a map) and two Oracle Connectors that uses that variable. Sometimes I get this error:

2014-12-09 09:54:26 com.bonitasoft.engine.external.web.forms.ExecuteActionsAndTerminateTaskExt
INFORMACIÓN: THREAD_ID=174 | HOSTNAME=spot-paola | TENANT_ID=1 | The user <admin> has executed the task [name = <Generar / corregir pago>, display name = <Generar / corregir pago>, id = <59>, parent process instance = <2>, root process instance = <2>, process definition = <8383656428918893919>]
2014-12-09 09:54:26 org.bonitasoft.engine.execution.work.FailureHandlingBonitaWork
ADVERTENCIA: THREAD_ID=196 | HOSTNAME=spot-paola | TENANT_ID=1 | org.bonitasoft.engine.expression.exception.SExpressionEvaluationException : "PROCESS_DEFINITION_ID=8383656428918893919 | PROCESS_NAME=Proceso Reclamaciones | PROCESS_VERSION=2.0 | PROCESS_INSTANCE_ID=2 | ROOT_PROCESS_INSTANCE_ID=2 | FLOW_NODE_DEFINITION_ID=-6280809974700218583 | FLOW_NODE_INSTANCE_ID=60 | FLOW_NODE_NAME=Cambiar estatus a EN ESPERA DE AUTORIZACION | CONNECTOR_DEFINITION_IMPLEMENTATION_CLASS_NAME=INSERT ESTATUS | CONNECTOR_INSTANCE_ID=25 | Expression insert with content = <Funciones.Insert("BPM_HIST_MOV_ESTATUS", valores)> depends on valores is neither defined in the script nor in dependencies."

Images: Data Connectors

What comes to my atention is "depends on valores is neither defined in the script nor in dependencies", but IT IS defined! How come this same setup sometimes works, and sometimes don't? Should I do this differently?

1 answer

1
0
-1

Hi there,

I've found sometimes if I have the variable defined in a try block it works and sometimes doesn't depending on the results of the try.

Worthwhile checking the scope of the variable.

for example (very simplistic, but shows what I mean):

try{
   long x = 1/0;
}
catch(Exception e){
}
x=1;

can fail with "depends on x is neither defined in the script nor in dependencies"

My way round this is very simple:

long x = 0;
try{
   x = 1/0;
}
catch(Exception e){
}
x=1;

This will always work as it ensures x is always defined regardless of the result of the try.

Is this a bug? Not sure...still trying to try{}catch(){} a real example that is reproducible. It seems elusive as you have found.

Hope this helps, regards Seán

Comments

Submitted by epfalcon on Wed, 12/10/2014 - 17:32

Sean McP, the variable is not defined outside of the scope of where I'm using it, please read my question and see the images I atached to know what I mean. The variable is declared on Data, and I try to use that variable inside a Connector. Both on the Personal Task.

Submitted by Sean McP on Wed, 12/10/2014 - 20:31

@epfalcon, Sorry and thank you, yes I see that you are using the inbuilt connectors.

I'll be honest though, I don't use any of them (db connectors that is) at all, I write my own. I find mine much more reliable. Who is to say that the provided connectors are written the right way/in consideration of all events.

It is too easy to assume they are perfect and I've found some are not.

If this happens more than once, it is safe to say they do not work necessarily the way you hope, is there a timing issue, a capacity issue, a memory issue, who can say with this type of intermittent error.

But it is an intermittent error and therefore a problem, I only gave a partial solution for which I apologize, but I know my way works.

My suggestion is write your own connector, or take the source of the Oracle one and see what is happening...recoding if necessary.

Good luck, Best regards

Notifications