Using ActiveVOS Eventing Services Technical Note © 2012 Active Endpoints Inc. ActiveVOS is a trademark of Active Endpoints, Inc. All other company and product names are the property of their respective owners. 2012 0 Content Introduction .................................................................................................................. 3 About the Project .......................................................................................................... 3 Steps to Deploy and Execute the Project......................................................................... 5 Triggering the Human Task System Event ................................................................... 5 Triggering the User Defined System Event.................................................................. 7 Invocation of Human task Service with Run As Policy: ..................................................... 9 Reference ...................................................................................................................... 9 About Active Endpoints .................................................................................................10 Copyright © 2012, Active Endpoints, Inc. Page 2 of 10 Introduction Business event processing (BEP) allows you to monitor activity of running or completed BPEL processes. This technical note describes by way of a simple example how to leverage BEP and process for built-in ActiveVOS system events generated by the engine, and those specified as user-defined events. To learn more about ActiveVOS business event processing capabilities please refer to our documentation. About the Project The project that accompanies this document is based on the Loan Approval sample. It demonstrates the following: 1. Invocation of task-based engine events (ActiveVOS System Event) When a human task is created the engine generates an AeHumanTaskCreated event that in turn can be used to invoke a process that implements the interface defined by the event action template. Using this process you can for example, notify a consumer when a human task is created and perform actions as a result. The trigger to the ‘event action template’ process contains the task id in the payload which serves as input. 2. Invocation of a user-defined engine event BEP provides you with the ability to identify process events of interest from the eventing tab of the process’ deployment descriptor. This type of event is based on the state of a specific process activity or link. When an event is triggered the service identified to process it is invoked. The eventing tab also allows the users to define certain business properties that will be passed along with the input to the ‘Event Action template’ process. Copyright © 2012, Active Endpoints, Inc. Page 3 of 10 A short description of the processes involved in the example project: # Name of the Process Definition Purpose 1 loanProcessHumanCompleted.bpel Human loan Approval Process. Based on the results from the Risk Assessment service, the loan is either approved or declined 2 HTCreationEvent.bpel The process is based on the Event Action Process template. This process is invoked whenever a Human Task is created. 3 NotifyCustomerServiceEvent.bpel The process is based on the Event Action Process template. This process is invoked when the Risk Assessment service determines that the loan requested falls into the High Risk category. This custom process then invokes the loanCRM process to notify a customer service representative, that the loan request is denied. 4. loanCRM.bpel The process contains the notification to the customer service representatives. 5. riskAssessment.bpel The process contains the structured activities and the logic to determine whether the Risk is ‘Low’, ‘High’ or ‘Review’ Copyright © 2012, Active Endpoints, Inc. Page 4 of 10 Steps to Deploy and Execute the Project Triggering the Human Task System Event 1. Import the attached orchestration project to ActiveVOS Designer. 2. Deploy EventingSample.bpr, riskAssessment.bpr, loanCRM.bpr contained within the project. 3. Instantiate the ‘loanProcessHumanCompleted’ Process with the following steps: a. Login to ActiveVOS Central – http://localhost:8080/activevos-central (change the host and port if it is different in our environment) using one of the users of either loanreps or loanmgrs group b. Click on Requests tab > choose Human Approval Completed Form. (This form gets deployed along with the bpr) c. Fill in the details: loanType - Auto first name - John Last name - Smith Day phone – 123-234-3456 Night phone – 987-876-7654 Social Security number - 111111 Amount Requested - 15000 Loan Description - forCar OtherInfo – Low Interest Rate Response Email – [email protected] First approval task ref - xyz Click on the ‘Send Request’ button Copyright © 2012, Active Endpoints, Inc. Page 5 of 10 d. As an alternative to steps a, b and c above, you can also send the following soap request to the endpoint http://localhost:8080/activebpel/services/LoanProcessHumanCompletedService?wsdl Request: <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:loan="http://schemas.activeendpoints.com/sample/LoanRequest/2008/02/loanRequest.xsd"> <soapenv:Header/> <soapenv:Body> <loan:loanProcessRequest> <loan:loanType>auto</loan:loanType> <loan:firstName>John</loan:firstName> <loan:lastName>Smith</loan:lastName> <loan:dayPhone>1232345436</loan:dayPhone> <loan:nightPhone>123876456</loan:nightPhone> <loan:socialSecurityNumber>345456567</loan:socialSecurityNumber> <loan:amountRequested>15000</loan:amountRequested> <loan:loanDescription>forCar</loan:loanDescription> <!--Optional:--> <loan:otherInfo>SplPurchase</loan:otherInfo> <loan:responseEmail>[email protected]</loan:responseEmail> <!--Optional:--> <loan:firstApprovalTaskRef>None</loan:firstApprovalTaskRef> <!--You may enter ANY elements at this point--> </loan:loanProcessRequest> </soapenv:Body> </soapenv:Envelope> 4. Because the Risk Assessment response will return as “Review”, the process will create a human task, which will trigger the creation of ‘HTCreationEvent’ process. 5. The HTCreationEvent process deployed with the service name – “AeHumanTaskCreated” (a Task-Based Engine System event) will be invoked. Please note that since this is a system event, you need not define anything in the eventing tab of the PDD to kick off this process. 6. Within the ‘HTCreationEvent’ Process note that the getTaskInfo operation (which belongs to Human task System Service) is invoked with the task id as input to the process. 7. You may want to complete the Human Task from ActiveVOS Central, in order to complete the loanProcessHumanCompleted’ process. Copyright © 2012, Active Endpoints, Inc. Page 6 of 10 Triggering the User Defined System Event 1. Instantiate the ‘loanProcessHumanCompleted’ Process with the following steps: a. Login to ActiveVOS –Central – http://localhost:8080/activevos-central (change the host and port if it is different in our environment) using one of the users of either loanreps or loanmgrs group b. Click on Requests tab > choose Human Approval Completed Form. (This form gets deployed along with the bpr) c. Fill in the details: loanType - Auto first name - James Last name - Jones Day phone – 123-234-3456 Night phone – 987-876-7654 Social Security number - 111111 Amount Requested - 5001 Loan Description - forCar OtherInfo – Low Interest Rate Response Email – [email protected] First approval task ref - xyz Click on the ‘Send Request’ button. d. Alternative to steps a, b and c, you could also send the following soap request to the endpoint http://localhost:8080/activebpel/services/LoanProcessHumanCompletedService?wsdl Request: <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:loan="http://schemas.activeendpoints.com/sample/LoanRequest/2008/02/loanRequest.xsd"> <soapenv:Header/> <soapenv:Body> <loan:loanProcessRequest> <loan:loanType>auto</loan:loanType> <loan:firstName>James</loan:firstName> <loan:lastName>Jones</loan:lastName> <loan:dayPhone>1232345436</loan:dayPhone> <loan:nightPhone>123876456</loan:nightPhone> Copyright © 2012, Active Endpoints, Inc. Page 7 of 10 <loan:socialSecurityNumber>345456567</loan:socialSecurityNumber> <loan:amountRequested>5001</loan:amountRequested> <loan:loanDescription>forCar</loan:loanDescription> <!--Optional:--> <loan:otherInfo>SplPurchase</loan:otherInfo> <loan:responseEmail>[email protected]</loan:responseEmail> <!--Optional:--> <loan:firstApprovalTaskRef>None</loan:firstApprovalTaskRef> <!--You may enter ANY elements at this point--> </loan:loanProcessRequest> </soapenv:Body> </soapenv:Envelope> 2. Because the Risk Assessment response will return a “High” response, the process will to trigger the “NotifyCustomerService” user-defined event as defined in the Eventing tab of the PDD. 3. Within the NotifyCustomerService process, the notify operation of the loanCRM service is invoked, and a notification is sent to the customer service agent. To view the notification, login to ActiveVOS Central with any of the users who belong to the ‘loancsrs’ group. 4. Also, note that the ‘HTCreationEvent’ process is triggered a well, as a result of creation of human task from within the loanCRM service. Copyright © 2012, Active Endpoints, Inc. Page 8 of 10 Invocation of Human task Service with Run As Policy: Please note that in the HTCreateEvent.pdd, the Human Task System service is invoked as a process, with ‘RunAs’ policy. Explanation on the use of the RunAs Policy: When the target process includes B4P interactions, the process needs to know the identity of the caller, which is what is passed as 'Run As' to the Human task Endpoint. By default, the Process Initiator, i.e. the person who instantiates the process that calls the People Activity, will be propagated to the Human task Endpoint, if the user does not specify anything for this policy. The process initiator will be passed as a valid user name if the server is secured, or with anonymous, if the server is not secured. In this specific case, it is suggested to include the ‘RunAs’ policy with a user name that will have access to the tasks (E.g.: A Potential Owner). Reference [1] Business Event Processing: http://infocenter.activevos.com/infocenter/ActiveVOS/v91/index.jsp?to pic=/com.activee.bpel.doc/html/UG26.html Copyright © 2012, Active Endpoints, Inc. Page 9 of 10 About Active Endpoints Active Endpoints, Inc. delivers a unique suite of process automation products and related services to develop, integrate and deploy custom applications quickly and easily. The company’s products —Socrates and ActiveVOS empower business users and IT project teams to collaborate more effectively. The company has hundreds of customers worldwide from large enterprises to SMBs, spanning multiple industries such as telecommunications, government, financial services, and media and entertainment. Active Endpoints is headquartered in Waltham, MA with development facilities in Shelton, CT. To find out how Active Endpoints can help your business, visit http://www.activevos.com, call +1 781 547 2900 and press 1 for Sales, or email us at [email protected]. Copyright © 2012, Active Endpoints, Inc. Page 10 of 10
© Copyright 2025