Problemas al consumir desde el eclipse las tareas del Bonita

1
0
-1

Cuando trato de ejecutar una tarea manual en el Bonita desde el eclipse, me sale el siguiente error.

POST http://localhost:8080/bonita/serverAPI/org.bonitasoft.engine.api.ProcessAPI/updateActivityInstanceVariables HTTP/1.1

2019-05-23 16:47:01,406 ERROR c.e.b.s.BPMService:206 - Exception org.bonitasoft.engine.exception.UpdateException: USERNAME=usuario | Some data does not exists, wanted to update [param1, param2] but there is only [] at org.bonitasoft.engine.api.HTTPServerAPI.invokeMethod(HTTPServerAPI.java:128) at org.bonitasoft.engine.api.impl.ClientInterceptor.invoke(ClientInterceptor.java:86) at com.sun.proxy.$Proxy6.updateActivityInstanceVariables(Unknown Source) at com.example.bonita.service.BPMServiceImpl.updateProcess(BPMServiceImpl.java:144) at com.example.bonita.service.BPMServiceImpl.executeBPMTask(BPMServiceImpl.java:221) at com.example.bonita.service.BPMService.obtenerToken(BPMService.java:197) at com.example.demo.Application.main(Application.java:209) at < ========== Beginning of the server stack trace ========== >. ( ) at org.bonitasoft.engine.api.impl.ProcessAPIImpl.updateActivityInstanceVariables(ProcessAPIImpl.java:2617) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.bonitasoft.engine.api.impl.ServerAPIImpl.invokeAPI(ServerAPIImpl.java:462) at org.bonitasoft.engine.api.impl.ServerAPIImpl$2.call(ServerAPIImpl.java:431) at org.bonitasoft.engine.transaction.JTATransactionServiceImpl.executeInTransaction(JTATransactionServiceImpl.java:274) at org.bonitasoft.engine.api.impl.ServerAPIImpl.invokeAPIInTransaction(ServerAPIImpl.java:438) at org.bonitasoft.engine.api.impl.ServerAPIImpl.invokeAPI(ServerAPIImpl.java:272) at org.bonitasoft.engine.api.impl.ServerAPIImpl.invokeMethod(ServerAPIImpl.java:124) at org.bonitasoft.engine.api.internal.servlet.HttpAPIServletCall.doPost(HttpAPIServletCall.java:111) at org.bonitasoft.engine.api.internal.servlet.HttpAPIServlet.doPost(HttpAPIServlet.java:35) at javax.servlet.http.HttpServlet.service(HttpServlet.java:661) at javax.servlet.http.HttpServlet.service(HttpServlet.java:742) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at org.tuckey.web.filters.urlrewrite.RuleChain.handleRewrite(RuleChain.java:176) at org.tuckey.web.filters.urlrewrite.RuleChain.doRules(RuleChain.java:145) at org.tuckey.web.filters.urlrewrite.UrlRewriter.processRequest(UrlRewriter.java:92) at org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:394) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:198) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:493) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342) at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:800) at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:806) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1498) at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:745)

Mi codigo fuente es:

boolean resolved = false;
String result = "";

APISession apisession = bpmService.createLogin(username, password);

pendingTasks.clear();
pendingTasks = processAPI.getPendingHumanTaskInstances(apiSession.getUserId(), 0, 30, null);

for (Iterator<HumanTaskInstance> i = pendingTasks.iterator(); i.hasNext();) {
    HumanTaskInstance item = i.next();
    if (item.getRootContainerId() == request.getInstanceId()) {
        taskid = item.getId();
        processAPI.updateActivityInstanceVariables(taskid,    request.getVariables());

        resolved = true;
        break;
    }
}

Mi archivo de propiedades es:

<BonitaProperties>
    <Name>bonita</Name>
    <Server>localhost</Server>
    <Port>8080</Port>
    <ProcessName>Proceso X</ProcessName>
    <ProcessVersion>1.0</ProcessVersion>
    <GenericUser>usuario</GenericUser>
    <GenericPwd>password</GenericPwd>
</BonitaProperties>
<profiles>
    <profile>member</profile>
</profiles>

Mi Pom es:

  <groupId>com.example</groupId>
    <artifactId>PermisosMatricula</artifactId>
    <version>1.4</version>
    <packaging>jar</packaging>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
        <java.version>1.8</java.version>
        <bonita.bpm.version>7.8.4</bonita.bpm.version>
    </properties>
    <dependencies>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.httpcomponents</groupId>
            <artifactId>httpclient</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-core</artifactId>
        </dependency>
        <dependency>
            <groupId>org.bonitasoft.engine</groupId>
            <artifactId>bonita-client</artifactId>
            <version>7.8.4</version>
        </dependency>
        <dependency>
            <groupId>org.bonitasoft.engine</groupId>
            <artifactId>bonita-server</artifactId>
            <version>7.8.4</version>
        </dependency>
        <dependency>
            <groupId>net.sf.json-lib</groupId>
            <artifactId>json-lib</artifactId>
            <version>2.4</version>
            <classifier>jdk15</classifier>
        </dependency>
    </dependencies>

Mi versión del Bonita en Maven es 7.8.4 y utilizo Eclipse.

¿Tienen alguna idea de que puede ser?

Gracias.

Comments

Submitted by delphine.coille... on Fri, 06/07/2019 - 16:21

Hola Ingrid,

Vamos a contestar tu pregunta. Pero antes de todo, te queria avisar que voy a remover una de tus preguntas, porque lo has duplicado en íngles y español. Que idioma te parece más sencillo? Gracias

Submitted by imendoza_1401133 on Fri, 06/07/2019 - 16:25

Hola, mas fácil podría ser en español?

Submitted by delphine.coille... on Fri, 06/07/2019 - 16:51

Sin problema, contestamos pronto y de momento voy a remover la version en ingles.

2 answers

1
0
-1
This one is the BEST answer!

Hola que tal, ya pude resolver este problema reemplazando el método "updateActivityInstanceVariables" por "executeUserTask(userId, taskid, listVariablesSerializable)".

Gracias.

1
0
-1

Cómo contado en el Bonita bug tracker BBPMC-553 que abriste, el problema parece relacionado con la comprensión de la manera de transmitir los datos del lado del cliente (tu aplicación Java) hasta las variables de negocio de Bonita a través del contrato, usando operaciones y la metodología API.

Para entrar en más detalles, te dejo referirte por favor a la respuesta de mi compañero en el BBPMC-553.

Notifications