Fuego.Papi : ProcessService

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

You must initialize new instances of ProcessService by calling its connectTo() method, which requires a URL, user and password to access the Oracle BPM Directory. For the URL, you may use Fuego.Server.directoryURL if the business process executing your code and the processes you want to access belong to the same Oracle BPM Directory.

Important:

This component is only compatible with activities that are executed on the server side. Use component ClientProcessService instead if you need this functionality on the client side (i.e. from a presentation form or dashboard). In addition, you don't have to provide URL, user and password to ClientProcessService's connectTo() method because the component re-uses the current WorkSpace's PAPI session.

You must call method disconnectFrom() on your ProcessService instance once it's no longer used.

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

do
  connectTo ProcessService 
      using url = Fuego.Server.directoryURL, 
      user = "test", 
      password = "test" 

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

on exit
  disconnectFrom ProcessService
end

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

do
  connectTo ProcessService 
      using url = Fuego.Server.directoryURL, 
      user = "test", 
      password = "test" 

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

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

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