List all BPM Processes for a user

Hello,

Happy to start contributing to this blog.. 

The title of the blog is probably deceptively simple and warrants an elaboration.

Customized BPM workspaces/user interfaces are a fairly common requirement. One of our marquee customers in the online stock trading business, envisioned this user interaction for their BPM application:

  1. User logs in to the internal portal
  2. Use will have list of roles which he is granted as a drop down list
  3. Once user selects the role, a list of processes which user is part of appear. Logged in user can be part of any swimlane role of the process
This can be a fairly common/reasonable user-UI interaction pattern. 1. and 2. are easily achievable and hence the subject matter of this blog is the requirement in 3.
Objective: Given a username and a role, list all the BPM processes that the user is part of, in any swimlane of any process.
Here is quick overview of the major steps/logic in the code:

  1. Intialize workflow/BPM  context as usual
  2. Get a handle on InstanceQueryService(getInstanceQueryService), InstanceManagementService,        ProcessMetadataService and ProcessModelService
  3. List all Processes for that bpmcontext (listProcessMetadataSumary) and get Granted roles to that user
  4. For each of the processes [method  getAccessibleProcesss(ProcessMetadataSummary, Set)]for each of the lanes in the process, check if the role granted to the user, matches the roleName for that swimlane. If so, add to output.

Notes:

  • The usual caveats apply including BPM APIs are subject to change.
  •  JDeveloper method introspection is your better friend than API documentation :-)...

(I am going to try upload the source code  and if it doesnt work, will follow this blog up with the corresponding source code.)

Hope this helps. 

Ack: Yogesh K, BPM Dev team.

Editing the blog to include source code from java.net: http://java.net/projects/bpmapiusage

Comments:

This is a good post. How will this work if using parametric role where a user access to process instance is based on the static role (defined in swim lane) and some of the instance data values?

Posted by Kumar on April 20, 2012 at 09:32 AM PDT #

Hi,

The link "http://java.net/projects/bpmapiusage" is broken, you have some other?

Herberson

Posted by guest on October 03, 2012 at 11:25 AM PDT #

>>> Editing the blog to include source code from java.net:
>>>>http://java.net /projects/bpmapiusage
Can you please provide correct URL to source code.

Posted by guest on October 10, 2012 at 10:41 AM PDT #

Post a Comment:
  • HTML Syntax: NOT allowed
About

Technical and in-depth articles and samples on BPM 11g.

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today