cancel
Showing results for 
Search instead for 
Did you mean: 

How Get processInstance for variable?

shaparak-smmira
Champ in-the-making
Champ in-the-making
hi to all

I want to get process Instance for specific variable,I find query for task

List<Task> tasks = taskService.createTaskQuery()
               .processVariableValueEquals("status", "12")
               .orderByProcessInstanceId().asc().list();

but I need query that get process Instance for "status" variable,it is possible?
8 REPLIES 8

frederikherema1
Star Contributor
Star Contributor
ProcessInstanceQuery (runtimeService.create….):


/**
   * Only select process instances which have a global variable with the given value. The type
   * of variable is determined based on the value, using types configured in
   * {@link ProcessEngineConfiguration#getVariableTypes()}.
   * Byte-arrays and {@link Serializable} objects (which are not primitive type wrappers)
   * are not supported.
   * @param name name of the variable, cannot be null.
   */
  ProcessInstanceQuery variableValueEquals(String name, Object value);

shaparak-smmira
Champ in-the-making
Champ in-the-making
ProcessInstanceQuery (runtimeService.create….):


/**
   * Only select process instances which have a global variable with the given value. The type
   * of variable is determined based on the value, using types configured in
   * {@link ProcessEngineConfiguration#getVariableTypes()}.
   * Byte-arrays and {@link Serializable} objects (which are not primitive type wrappers)
   * are not supported.
   * @param name name of the variable, cannot be null.
   */
  ProcessInstanceQuery variableValueEquals(String name, Object value);

Thanks  Smiley Wink   :roll:

frederikherema1
Star Contributor
Star Contributor
It help a lot of you read through our API-javadocs for a start, before asking on the forum. We try to make the API as clear as possible so it takes just a few minutes to run though it.

http://activiti.org/javadocs/index.html

shaparak-smmira
Champ in-the-making
Champ in-the-making
It help a lot of you read through our API-javadocs for a start, before asking on the forum. We try to make the API as clear as possible so it takes just a few minutes to run though it.

http://activiti.org/javadocs/index.html

that's right I'm sorry

i search for "processVariableValueEquals" function in runtiemservices and I was careless.

frederikherema1
Star Contributor
Star Contributor
No worries… Just making sure our hard-work in the documentation pays off in the best possible way Smiley Wink

shaparak-smmira
Champ in-the-making
Champ in-the-making
No worries… Just making sure our hard-work in the documentation pays off in the best possible way Smiley Wink

thank you  Smiley Wink

shaparak-smmira
Champ in-the-making
Champ in-the-making
is there any way to find who is update variable and get updated value in process? :?:

ronald_van_kuij
Champ on-the-rise
Champ on-the-rise
new questions in new topic please