Connecteur retournant un object de type Map semple être typer come String par Bonita

Bonjour,

J’utilise la version la version 2022.1 de Bonita

J’ai un connecteur qui retourne un object de type Map selon le code du connecteur  suivant :

Map<String,String> result = new HashMap<String,String>();
//for test result.put("TEST","TEST");
setOutputParameter(OUTPUT_DATA, result);

Je map le retour du connecteur sur une variable de type process typé Map , et j’obtiens l’erreur suivante:

2022-09-15T16:46:54,485+0200 | ZRH30479n | WARN  | [ConnectorExecutor-6|305] o.b.e.w.RetryingWorkExecutorService - THREAD_ID=305 | HOSTNAME=ZRH30479n | TENANT_ID=1 | Work ExecuteConnectorOfActivity: flowNodeInstanceId = 1280024, connectorDefinitionName = DataPreparationDemo failed. The element will be marked as failed. Exception is: org.bonitasoft.engine.expression.exception.SExpressionEvaluationException: FLOW_NODE_INSTANCE_ID=1280024 | Declared return type interface java.util.Map is not compatible with evaluated type class java.lang.String for expression outputData

                wrapped by org.bonitasoft.engine.core.operation.exception.SOperationExecutionException: org.bonitasoft.engine.expression.exception.SExpressionEvaluationException: FLOW_NODE_INSTANCE_ID=1280024 | Declared return type interface java.util.Map is not compatible with evaluated type class java.lang.String for expression outputData

                wrapped by org.bonitasoft.engine.core.connector.exception.SConnectorException: org.bonitasoft.engine.core.operation.exception.SOperationExecutionException: org.bonitasoft.engine.expression.exception.SExpressionEvaluationException: FLOW_NODE_INSTANCE_ID=1280024 | Declared return type interface java.util.Map is not compatible with evaluated type class java.lang.String for expression outputData

                wrapped by org.bonitasoft.engine.connector.exception.SConnectorException: Unable to evaluate output operations of connectors and continue

Cordialement

david

 

Bonjour Romain,

Oui , mais en faite c'est du a une erreur d'implementation qui provoqué une exception, dont je n'ai malheuresement pas detecter le cas ( je viens de m'en rendre compte) 

Je m'excuse aupres de la communauté et cette question peut être effacé

david

 

Quelque pécisions supplémentaire , viue que j n'arrive pas a updater la question initiale

Je vois bien ds l'interface Bonita le bon type en sortie du connecteur, lors de la configuration de mon connecteur (l'image n'apparait pas dans le message)

 

j’obtiens l’erreur suivante avec un peu plus de détail:

2022-09-15T16:46:54,485+0200 | ZRH30479n | WARN  | [ConnectorExecutor-6|305] o.b.e.w.RetryingWorkExecutorService - THREAD_ID=305 | HOSTNAME=ZRH30479n | TENANT_ID=1 | Work ExecuteConnectorOfActivity: flowNodeInstanceId = 1280024, connectorDefinitionName = DataPreparationDemo failed. The element will be marked as failed. Exception is: org.bonitasoft.engine.expression.exception.SExpressionEvaluationException: FLOW_NODE_INSTANCE_ID=1280024 | Declared return type interface java.util.Map is not compatible with evaluated type class java.lang.String for expression outputData

                wrapped by org.bonitasoft.engine.core.operation.exception.SOperationExecutionException: org.bonitasoft.engine.expression.exception.SExpressionEvaluationException: FLOW_NODE_INSTANCE_ID=1280024 | Declared return type interface java.util.Map is not compatible with evaluated type class java.lang.String for expression outputData

                wrapped by org.bonitasoft.engine.core.connector.exception.SConnectorException: org.bonitasoft.engine.core.operation.exception.SOperationExecutionException: org.bonitasoft.engine.expression.exception.SExpressionEvaluationException: FLOW_NODE_INSTANCE_ID=1280024 | Declared return type interface java.util.Map is not compatible with evaluated type class java.lang.String for expression outputData

                wrapped by org.bonitasoft.engine.connector.exception.SConnectorException: Unable to evaluate output operations of connectors and continue

exception was generated here:    at org.bonitasoft.engine.expression.impl.ReturnTypeChecker.checkReturnType(ReturnTypeChecker.java:82)
    at org.bonitasoft.engine.expression.impl.ExpressionServiceImpl.evaluate(ExpressionServiceImpl.java:173)
    at org.bonitasoft.engine.core.expression.control.api.impl.ExpressionResolverServiceImpl.evaluateExpressionsOfKind(ExpressionResolverServiceImpl.java:253)

Au niveau du source de Bonita retrouvé sur GIT dans la methode  org.bonitasoft.engine.expression.impl.ReturnTypeChecker.checkReturnType(ReturnTypeChecker.java:82), tous semble a croire que l'objet retrourner n'est pas celui que configuré?

 

Bonjour,

Avez vous bien défini le type de retour de l’output outputData dans la définition (.def) de votre connecteur ?