cancel
Showing results for 
Search instead for 
Did you mean: 

How to view My request

hemamalini
Champ in-the-making
Champ in-the-making
i want to implement MyRequest  feature like in Activiti explorer in my webapplication. How can i see the Myrequest (both running and completed instance) and in which stage it is in if it is not completed.How can i achieve this in Java API
10 REPLIES 10

jbarrez
Star Contributor
Star Contributor
I have no idea what you mean with a 'MyRequest'. Could you elaborate in that?

hemamalini
Champ in-the-making
Champ in-the-making
i want to get the process instances id started by a user using userid. In activiti explorer we have my request tab where we can see the list of process instances started by the logged in user. how to achieve this?  I want to see both the active and completed process instances id. Is it possible?

jbarrez
Star Contributor
Star Contributor
In the Java API, you'd need the HistoricProcessInstanceQuery with following methods:

  /** Only select historic process instances that are completely finished. */
  HistoricProcessInstanceQuery finished();

and

/** Only select historic process instance that are started by the given user. */
  HistoricProcessInstanceQuery startedBy(String userId);

hemamalini
Champ in-the-making
Champ in-the-making
thank you very much.

sunilkumartk
Champ on-the-rise
Champ on-the-rise
How can i find the list of Process instances started By a particular user
in Rest API ?

for eg: I am looking for processes that are started by me and is not completed.

jbarrez
Star Contributor
Star Contributor
Don't think the 'started by' is there … but the query does take in an 'involvedUser' parameter.

sunilkumartk
Champ on-the-rise
Champ on-the-rise
InvolvedUser return instances that are startedBy me and are assigned to me, both.

The Problem I am facing is that,
we are unable to differentiate the instances that are startedBy me and that are assigned to my group/queue.

How do you suggest that i differentiate these requests ?

jbarrez
Star Contributor
Star Contributor
It's not yet in the REST API, but it is in the Java API.
The quickest way to get it, is to add it yourself to the REST API in a custom @RestController class.

sunilkumartk
Champ on-the-rise
Champ on-the-rise
in version 5.19
i think this is still an issue.

i tried
taskService.createTaskQuery()
                            .taskCandidateGroup("techassessment")
                            .includeProcessVariables()
                            .list();

as I have NOT used .taskUnassigned(), it should have returned everything. It doesnt!!
I think it should have returned everything as default and only unassigned when taskUnassigned is used.

i tried using the Native Query also but i am unable to add process Variables data with it..