AnsweredAssumed Answered

TaskQuery processVariableValueEquals

Question asked by tepani on Dec 14, 2011
as I can see in the Activiti Engine API
TaskQuery has a method processVariableValueEquals <<< Only select tasks which have are part of a process that have a variable with the given name set to the given value.

how ever i search for the opposite of processVariableValueEquals  which is processVariableValueNotEquals….
why method processVariableValueNotEquals is not available??

I make a custom TaskQueryImpl like the following:

public class CustomTaskQueryImpl extends TaskQueryImpl {

   public CustomTaskQueryImpl() {
   }

   public CustomTaskQueryImpl(CommandContext commandContext) {
      super(commandContext);
   }

   public CustomTaskQueryImpl(CommandExecutor commandExecutor) {
      super(commandExecutor);
   }

   public TaskQuery processVariableValueNotEquals(String variableName,
         Object variableValue) {
      variables.add(new TaskQueryVariableValue(variableName, variableValue,
            QueryOperator.NOT_EQUALS, false));
      return this;
   }
}

and use that class as following

CustomTaskQueryImpl taskQuery = CustomTaskQueryImpl(taskService.getCommandExecutor())
taskQuery.processVariableValueEquals("catagory", "aa")
taskQuery.processVariableValueNotEquals("username", "notme")


but why it search all taskQuery that has variable with category "aa" and username "notme" ??
why the processVariableValueNotEquals still behave like processVariableValueEquals???

how to make it right?
please help…thanks

Outcomes