problem getting task list for a user in Bonita 6.0.0 with any Java environment, working with Jboss 2.7.2 portlet

1
0
-1

If I start a process with "processAPI.startProcess(userId,processDefinitionId);" getting the processInstanceId as result and soon after, without exiting from script, try to get task instances

with " processAPI.getPendingHumanTaskInstances(userId, startIndex, maxResults, ActivityInstanceCriterion.valueOf(criterion));"

or with "processAPI.getActivities(processInstanceId, startIndex, maxResults);"

the result list does not contain in every case the initial task instance for the newly created process instance;

I can get that instance only if I close the operating window, open another window and run the search again; so it works;

is there a way to get the new task ( not process ) instance directly ? Please help, I'll be very greateful.

Best Greetings.

mail address: rossavol@gmail.com

4 answers

1
0
-1

Hi Rosavol,

this is for the 6.2.8 bpm server release, I guess it would be compliant with the 6.0.0

let me know if your problem is solved

Comments

Submitted by rossavol on Tue, 07/14/2015 - 10:28

Hi David,

I'm afraid I couldn't go on with those trials, I needed a faster ad more reliable solution avoiding the use of a plugin needing more advanced releases of Bonita. I solved the problem with an application bypass. Anyway, my best thanks for your kind help and taking interest in this problem. Maybe, in the forthcoming releases of the application, it should be possible to try the functioning of the tool you suggested. Again, best thanks and best regards. Rossano

1
0
-1

Hi rossavol,

I downloaded the bonita engine projet from github and opened it with Eclipse Kepler SR2.

1
0
-1

Hi Rosavol,

by looking at startProcess references in bonita project, i see those in CallActivityTest :

...
final ProcessInstance mainProcessInstance = getProcessAPI().startProcess(process.getId(), definitionPid);
final ActivityInstance step1 = waitForUserTask("Step1");
...

    private HumanTaskInstance waitForUserTask(final String taskName, final long processInstanceId, final int timeout) throws Exception {
        final Map<String, Serializable> readyTaskEvent;
        if (processInstanceId > 0) {
            readyTaskEvent = ClientEventUtil.getReadyTaskEvent(processInstanceId, taskName);
        } else {
            readyTaskEvent = ClientEventUtil.getReadyTaskEvent(taskName);
        }
        final Long activityInstanceId = ClientEventUtil.executeWaitServerCommand(getCommandAPI(), readyTaskEvent, timeout);
        final HumanTaskInstance getHumanTaskInstance = getHumanTaskInstance(activityInstanceId);
        assertNotNull(getHumanTaskInstance);
        return getHumanTaskInstance;
    }

    public HumanTaskInstance waitForUserTask(final String taskName) throws Exception {
        return waitForUserTask(taskName, -1, DEFAULT_TIMEOUT);
    }

It seems to me than process calls are asynchronous, and you ask for the server to wake you up when the task is complete.

Regards

Comments

Submitted by rossavol on Tue, 06/30/2015 - 17:17

Many thanks, I'll try and give response. Regards.

Submitted by rossavol on Wed, 07/01/2015 - 10:19

I'm afraid I can't reach in any way the package org.bonitasoft.engine.test containing classes and relative methods necessary to use the above code. Could anyone give informations about thies ? Many thanks and regards.

Submitted by rossavol on Wed, 07/01/2015 - 10:20

Anyway, I suppose that, if existing as download object, that package could be non compatible with release 6.0.0 of the Bonita server...

Notifications