Fuego.Papi : ClientProcessService

The ClientProcessService component allows you to access information about deployed business processes and to search for instances using filters or views.

The ClientProcessService component provides the same functionality as ProcessService but re-uses the current WorkSpace's PAPI session. This means you don't have to provide URL, user and password to ClientProcessService's connect() method.

Important:

This component must only be used from client-side methods, like those invoked from BPM Object Presentations (most commonly, Dashboards). If you need this functionality on the server side (e.g. from automatic activities), use component ProcessService instead.

Example 1: Iterate over all available business processes for the current user.

do
  connect ClientProcessService 

  for each process in ClientProcessService.processes do
    logMessage "I can see process "+process.name
  end

on exit
  disconnectFrom ClientProcessService
end

Example 2: Iterate over all process instances in the "test" user's inbox.

do
  connect ClientProcessService 

  inboxViewId = "unified_inbox"
  inbox = getInstancesByView(ClientProcessService, viewId : inboxViewId)

  for each instance in inbox do
    logMessage "I can see instances "+instance.id
  end

on exit
  disconnectFrom ClientProcessService
end
Related reference
Fuego.Papi : ProcessService
Fuego.Papi : ClientBusinessProcess
Fuego.Papi : BusinessProcess