The BusinessProcess component allows you to access information about a deployed business process, search for process instances in that process and execute Global Interactive activities.
Each instance of BusinessProcess operates on a single business process. For operating on multiple processes use ProcessService.
You must initialize new instances of BusinessProcess 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.
This component is only compatible with activities that are executed on the server side. If you need this functionality on the client side (i.e. from a presentation form or dashboard), use component ClientBusinessProcess instead. In addition, you don't need to provide URL, user and password to ClientBusinessProcess's connectTo() method because the component re-uses the current WorkSpace's PAPI session.
You must call method disconnectFrom() on your BusinessProcess instance once it's no longer used.
do
// Connect to our Orders Management process
ordersProcess = BusinessProcess()
connectTo ordersProcess
using url = Fuego.Server.directoryURL,
user = "test",
password = "test",
process = "/TestOU/OrdersManagement"
// Obtain process instances in the "Pending Approval" activity
pendingOrders = getInstancesByActivity(ordersProcess,
activity : "pending_approval")
// Unselect each order. In order words, un-assign the instance so that
// any user with access to the "Pending Approval" activity can see it
// and work on it
for each order in pendingOrders do
unSelect order
end
on exit
disconnectFrom BusinessProcess
end