cancel
Showing results for 
Search instead for 
Did you mean: 

Activiti explorer should consider the startableByUser value

b_schnarr
Champ in-the-making
Champ in-the-making
Hello at all,

I am of the opinion that the activiti explorer is a great frontend and api Demo of activiti. But I think that it would be good if the explorer would not show all processes to all users. In addition, the concept of hiding processes is implemented in the api with candidateGroups and candidateUsers. Even queries are very easy with the startableByUser attribute.

Therefore my question: Do you consider to make the activiti explorer aware of this? It would be more than helpful.

Another question to this topic. Right now, you can just add candidateUsers and groups via API. It would be great if an admin could set those values in the activiti explorer.

Lets say an Admin deploys a new process via explorer. It would be great if he also could set candidates.

What do you think about this idea?

Best regards and thanks for your answer.
Ben
6 REPLIES 6

b_schnarr
Champ in-the-making
Champ in-the-making
No opinions concerning my suggestion?

jbarrez
Star Contributor
Star Contributor
Of course I agree that would be a good addition. The problem is always juggling between features and priorities … ( we would really love to do it all). Currently, we're investing heavily in some core features (eg multi tenancy) so there is little time for anything else (and furthermore, it still remains a 'demo' app as you mentioned).

b_schnarr
Champ in-the-making
Champ in-the-making
Ok, I assume that this feature isn´t on the roadmap? Could you give me some hints which classes and queries I have to extend that the explorer considers this value? I looked through the source code but I didn´t find the right place. In theory, I just have to extend the query which is fetching the process definitions of the db with the startableByUser-Value, isn´t it? But I do not find this query.

Thank you very much for your help

Best regards
Ben

b_schnarr
Champ in-the-making
Champ in-the-making
Would this here be right? :

<code>
    protected ProcessDefinitionQuery getBaseQuery(RepositoryService repositoryService) {
    return repositoryService
            .createProcessDefinitionQuery()
            .startableByUser(ExplorerApp.get().getLoggedInUser().getId())
            .latestVersion()
            .active();
  }
</code>

Can I achieve with this code that just those process definitions were shown in the explorer which a user is allowed to see? How can I achieve that a user can´t see all process models (Tab Model Workspace)?

Best regards

jbarrez
Star Contributor
Star Contributor
The code you probably want to change is the org.activiti.explorer.ui.process.ProcessDefinitionListQuery class

The modal workspace is a bit trickier: that would be the org.activiti.editor.ui.EditorProcessDefinitionPage class, these lines

<code>
   List<Model> modelList = repositoryService.createModelQuery().list();
    for (Model modelData : modelList) {
      Item item = processDefinitionTable.addItem(modelData.getId());
      item.getItemProperty("name").setValue(modelData.getName());
    }
</code>

b_schnarr
Champ in-the-making
Champ in-the-making
Thank you very much, with this code here in the DefaultProcessDefinitionFilter.java, it worked very well:

<code>
  protected ProcessDefinitionQuery getBaseQuery(RepositoryService repositoryService) {
    return repositoryService
            .createProcessDefinitionQuery()
            .startableByUser(ExplorerApp.get().getLoggedInUser().getId())
            .latestVersion()
            .active();
  }
</code>