Groovy Unable to resolve - waitForUserTask

Hi there,

Bonita Studio 6.3.3, Java 1.7.0.67, Windows 8.1

using the following code - original sample code is here…

//wait till human step is available HumanTaskInstance userTask = waitForUserTask("step1", processInstance);

gives me an error :

Groovy: waitForUserTask cannot be resolved. It may lead to runtime errors.

My imports are:

import org.bonitasoft.engine.api.ProcessAPI;
import org.bonitasoft.engine.api.ProcessRuntimeAPI;

import org.bonitasoft.engine.bpm.flownode.ActivityInstance;
import org.bonitasoft.engine.bpm.flownode.TaskInstance;
import org.bonitasoft.engine.bpm.flownode.UserTaskInstance;
import org.bonitasoft.engine.bpm.flownode.HumanTaskInstance;

import org.bonitasoft.engine.bpm.process.ProcessDefinition;
import org.bonitasoft.engine.bpm.process.ProcessDeploymentInfo;
import org.bonitasoft.engine.bpm.process.ProcessDeploymentInfoCriterion;
import org.bonitasoft.engine.bpm.process.ProcessDeploymentInfoSearchDescriptor;
import org.bonitasoft.engine.bpm.process.ProcessInstance;

What other imports am I missing?

Many thanks and best regards
Seán

Hi,

waitForUserTask is a method for the tests of the engine.
It’s not on the artifacts of the final product.

So, you can’t use it in the studio.

To get a human task :

Thread.sleep(3000);
final SearchOptionsBuilder searchOptionsBuilder = new SearchOptionsBuilder(0, 1);
searchOptionsBuilder.filter(HumanTaskInstanceSearchDescriptor.NAME, “step1”);
final HumanTaskInstance userTask = getProcessAPI().searchHumanTaskInstances(searchOptionsBuilder.done()).getResult().get(0);

Best regards,
Céline

Hi Céline,

I could really do with this method… :slight_smile: I’ll have to write my own.

regards
Seán