Interacting with bpel_workflow_from_oracle_forms_11g

613 views

Published on

Published in: Technology, Business
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
613
On SlideShare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
14
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Interacting with bpel_workflow_from_oracle_forms_11g

  1. 1. Interacting with BPEL/Workflow from Oracle Forms 11g Authored by Alexander Reichman
  2. 2. Interacting with BPEL/Workflow from Oracle Forms 11gAuthored by Alex ReichmanNovember 2011© (2011) OracleContractors.com. All rights reserved.All other third party trademarks and registered trademarks are acknowledged.White Papers by Contractors Network LtdThis is one of a series of White Papers published by Contractors Network Ltd, each onefocussing on a specific aspect of Oracle.Further copies of this and other White Papers can be obtained free of charge by contacting usat whitepapers@Oraclecontractors.com or the address below.If you have found the content of this White Paper interesting and useful, and wish to explorethe subject matter further, we can introduce you to independent experts in this field.Interacting with BPEL/WF from Oracle Forms Page |1
  3. 3. CONTENTSWhite Papers by Contractors Network Ltd ............................................................... 1ABOUT CONTRACTORS NETWORK ........................................................................... 3ABOUT THE AUTHOR ................................................................................................ 4INTRODUCTION........................................................................................................ 5PURPOSE .................................................................................................................. 6WHO SHOULD READ THIS ........................................................................................ 6ORGANISATION OF THIS DOCUMENT ...................................................................... 7 Required software installation and configuration ............................................................. 8 Modifying BPEL Process and deploying Composite ........................................................... 9 Description of Java Class to interact with BPEL/WF ........................................................ 13 Embedding Java Class in Oracle Forms ......................................................................... 14 Running form to communicate with Oracle Workflow engine .......................................... 19SUMMARY ............................................................................................................... 22REFERENCES ........................................................................................................... 23GLOSSARY .............................................................................................................. 24Interacting with BPEL/WF from Oracle Forms Page |2
  4. 4. ABOUT CONTRACTORS NETWORKContractors Network Ltd is a Global Oracle Contractors Network with primary focus onOracles E-Business Suite.  We are operated by Contractors Network Ltd with 8 offices worldwide.  We offer Contractor Resourcing with access to over 10,000 pre-qualified Oracle Applications Contractors through our local offices.  We provide the only global Oracle specific job search engine with a view of 10,000 + Oracle specific roles.  We interact with over 15,000 client personnel involved with the Oracle E- Business Suite.  We promote a community spirit through an Apps Blog, with 50 + Regional Authors that produce 20 articles a months.  We are a Publishing House for White Papers authored by Oracle Contractors and distribute these free, to clients and Contractors alike.  We offer access for training and demonstration of the latest release via an online Vision environment at no cost.We exhibit & present at all Regional Oracle Conferences worldwide as well as local SpecialInterest Groups.Interacting with BPEL/WF from Oracle Forms Page |3
  5. 5. ABOUT THE AUTHORAlex is an certified Oracle DBA and has worked with Oracle Forms from versions 2.0 to 11g.He also has an experience in migration of forms from client server to WEB and installationand configuration of Oracle Weblogic Server and Fusion Middleware 11g.He worked with various industries like Retail, Banking Finance, Accounting, Pharmaceutical,AutomotiveYou can reach Alex on alexander.reichman@gmail.com if you have any comments or feedbackregarding this paper.Interacting with BPEL/WF from Oracle Forms Page |4
  6. 6. INTRODUCTIONSome companies which are using different systems are required to integrate the existingForms 11g application with Oracle BPEL Workflow included in the Fusion Middleware 11gplatform.This white paper illustrates how simple forms application can interact with BPEL/WFFigure 1 shows high-level overview of the process. Employee submit expenses from WebInterface and the task will be automatically assigned to jstein Oracle user ( standard userfrom Oracle Weblogic installation). jstein is automatically notified by email about the new taskand has to log on to BPM Worklist in order to approve/reject submitted expenses. ThisHuman Task can be done from Worklist Web Interface or implemented using Java API. In mycase I developed the Java class and embedded it to Oracle Forms using Java Importer. Afterapproving/rejecting submitted expenses employee should be notified about the status ofhis/her request.Figure 1 Expenses Approval processInteracting with BPEL/WF from Oracle Forms Page |5
  7. 7. PURPOSETodays business requires the integration of different systems and applications.Service Oriented Architecture (SOA) helps reducing the cost and complexity of integrationinitiatives.This white paper illustrates how a simple Oracle Forms Application can interact Oracle BPELWorkflow engine which is a part of Oracle SOA SuiteWHO SHOULD READ THISOracle Forms developers , SOA Architects, Project Managers and anyone else who isinterested in integration of Oracle Forms in SOAInteracting with BPEL/WF from Oracle Forms Page |6
  8. 8. ORGANISATION OF THIS DOCUMENT Section Contents Page Part 1 Required software installation and configuration 8 Part 2 Modifying BPEL Process and deploying Composite 9 Part 3 Description of Java Class to interact with BPEL/WF 13 Part 4 Embedding Java Class in Oracle Forms 14 Part 5 Running form to communicate with Oracle WF 19 engineInteracting with BPEL/WF from Oracle Forms Page |7
  9. 9. Required software installation and configurationStep 1. Download pre-built Virtual Machine for SOA Suitehttp://www.oracle.com/technetwork/middleware/soasuite/learnmore/vmsoa-172279.htmlStep 2. Install Forms 11g services for Linux on this machine to follow this example.Note: If you downloaded and installed Fusion Middleware 11.1.1.2 please download andinstall 11.1.1.3 patch because Installation of Forms 11.1.1.2 on WLS 10.3.3 is not supported(Oracle Support(Metalink) Note: ID 1099203.1)Check your installation before installing Forms and Reports: export MW_HOME=/oracle/fmwhome/ cat $MW_HOME/wlserver_10.3/.product.properties | grep WLS_PRODUCT_VERSION WLS_PRODUCT_VERSION=10.3.3.0 FMW installation 11.1.1.2Please also make sure Admin Server for SOA domain is up when you will install Forms andReports. Without that the admin server and manager of both installation can haveconfiguration problem (same port or overwrite of start-up script)Step 3. The composite application in this white paper is based on an application SimpleTask http://redstack.wordpress.com/2010/01/08/human-workflow-in-11g/#comment-298Follow the steps explained in this blog to create task in Human Workflow and ServiceComponent Architecture (SCA) Composite which should be deployed on local weblogic server.Interacting with BPEL/WF from Oracle Forms Page |8
  10. 10. Modifying BPEL Process and deploying CompositeI am considering you followed the steps in this blog to create task in Human Workflow andService Component Architecture (SCA) Composite.Lets have look at human task we just created. 1. Start Jdeveloper and open SimpleTask application 2. Open ApproveExpenseClaim.task in designer 3. Go to Assignment page than click on the <Stage1.Participant1> box to highlight it, and then click on the Edit buttonIn my case I assigned this task to John Steinbeck (jstein) demo user. In order to make surethis user will be notified about assigned task lets check his attributes. 1. Open Weblogic administration console (http://localhost:7001/console) 2. Click on Security Realms 3. Click on myrealm and then choose "Users and Groups" tab 4. Click on jstein user open his attributes 5. Specify email address where you want to send email notification about created task Now when new task will be assigned to jstein user he will be notified by email.Interacting with BPEL/WF from Oracle Forms Page |9
  11. 11. Note: In order to enable email notification to Oracle user about assigned task and informemployee about the status of his/her request you need to configure Oracle SOA Suite 11g forsending email notifications. Please read this article which explains how to implement ithttp://technology.amis.nl/blog/6019/configure-soa-suite-11g-for-sending-email-notifications-with-google-mailIn order to notify employee about the status of his/her request to approve submittedexpenses we need to customize ExpenseClaimProcess.bpelFigure 2 SimpleTask Modified BPEL Process 1. Open application SimpleTask in Jdeveloper 2. Open ExpenseClaimProcess.bpel in BPEL editor 3. Drag an Email activity from the Component Palette and drop it under the Assign Activity. 4. Click twice to specify the configuration for email activity.Note: In this example I have used my Gmail account alexander.reichman@gmail.com for bothjstein and employee but in real life it should be two different accounts.Interacting with BPEL/WF from Oracle Forms P a g e | 10
  12. 12. Figure 3 Email Activity 5. The content of the message body is defined as follows: Dear Sir/Madam, We would like to inform you that the status of your request <%bpws:getVariableData(ApproveExpenseClaim_1_globalVariable,payload ,/task:task/task:title)%>. is <%bpws:getVariableData(ApproveExpenseClaim_1_globalVariable,payload ,/task:task/task:systemAttributes/task:outcome)%>.Interacting with BPEL/WF from Oracle Forms P a g e | 11
  13. 13. 6. Close Email Activity and open composite.xml Figure 4 shows you final Composite ApplicationFigure 4 SCA Composite SimpleTask 7. Deploy the composite application to the SOA SuiteInteracting with BPEL/WF from Oracle Forms P a g e | 12
  14. 14. Description of Java Class to interact with BPEL/WFNow its time to create a Java Class to retrieve and complete a Human Workflow Task whichwill be called from Oracle Forms Application. This class will contain two methods 1. Query the worklist and retrieve the details for all tasks assigned to user .... 2. Complete ( Approve/Reject) Human Workflow Task ............... ................Interacting with BPEL/WF from Oracle Forms P a g e | 13
  15. 15. Jdeveloper project library settings:For more details about Human Workflow API please refer to SOA Developers Guide availableat http://download.oracle.com/docs/cd/E14571_01/integration.1111/e10224.pdfEmbedding Java Class in Oracle FormsFigure 5 shows the Oracle Forms application which will retrieve and complete a HumanWorkflow task. When user will press "Refresh" button getTaskdetails method from Java Classwill be called to retrieve the list of tasks assigned to user (jstein). If the task status isASSIGNED user can approve or reject the expenses by pressing Approve/Reject button. Afterpressing one of these buttons approveRejectExpenses method from Java Class will be calledand the status of task will be changed.Figure 5 Oracle Forms applicationInteracting with BPEL/WF from Oracle Forms P a g e | 14
  16. 16. The embedded class should be available for both Forms developer and the Forms serverbecause it will be used at design and runtime.For Forms developer on Unix the correct setting of FORMS_BUILDER_CLASSPATH infrmbld.sh script should be set (the registry key FORMS_BUILDER_CLASSPATH on Windows )Figure 6 FORMS_BUILDER_CLASSPATHOn Fusion Middleware server configuration file default.env should be modified. Please makesure to add the jar holding the Java class to the CLASSPATH variable.Figure 7 default.env CLASSPATHInteracting with BPEL/WF from Oracle Forms P a g e | 15
  17. 17. Now we can import Java Class in Oracle Forms.Select Program->Import Java Classes from Forms Builder Menu. You will see only the classesthat can be found in FORMS_BUILDER_CLASSPATH.Figure 8 Importing WorkflowTaskForms Java ClassJava Importer examines the Java Class and creates PL/SQL wrapper for it.Figure 9 shows the package specification containing PL/SQL version of Java methods wecreated in Part 3.Figure 9 PL/SQL wrapper for Java ClassInteracting with BPEL/WF from Oracle Forms P a g e | 16
  18. 18. Now we need to add the code to WHEN-BUTTON-PRESSED trigger behind Refresh button.Figure 10 shows a code excerpt for this triggerThe function WorkflowTasksForms.getTaskdetails returns the array of string objectscontaining the details for each task assigned to user. The main loop is using to retrieve thetask details and populate the form blockFigure 10 WHEN-BUTTON-PRESSED trigger REFRESH button. Loop through the listof tasks and populate the blockInteracting with BPEL/WF from Oracle Forms P a g e | 17
  19. 19. In order to complete the task we need to add the code to WHEN-BUTTON-PRESSED triggerbehind Approve and Reject buttonFigure 10 shows the code for Approve button. The code for the Reject button is the same asthe code in Figure 10, except that you replace the lineWorkflowTasksForms.approveRejectExpenses (:tasks.taskID , APPROVE) ;with the following line:WorkflowTasksForms.approveRejectExpenses (:tasks.taskID , REJECT) ;Figure 11 WHEN-BUTTON-PRESSED trigger APPROVE button. Approve the taskassigned to userInteracting with BPEL/WF from Oracle Forms P a g e | 18
  20. 20. Running form to communicate with Oracle Workflowengine1) Please follow the steps in this blog to submit expenses and create the task for jstein user.Figure 12 Submit expenses2) Oracle user jstein receives the following email notification about assigned taskFigure 13 Email notification sent to jsteinInteracting with BPEL/WF from Oracle Forms P a g e | 19
  21. 21. 3) Open BPM Worklist (http://localhost:7001/bpm/workspace/) to see the task assigned tojstein userFigure 14 Worklist human workflow web user interface to view assigned task4) Run Form ( http://localhost:9001/forms/frmservlet?config=default). After pressing Refreshbutton we can see the task 200222 was assigned to jsteinFigure 15 Form after querying tasks for jstein - task 200222 was assignedInteracting with BPEL/WF from Oracle Forms P a g e | 20
  22. 22. 5) Approve the Task 200222 which status is ASSIGNED by pressing Approve button6) Click on Refresh button again to check the task status. As you can see the status now iscompleted.Figure 16 Task 200222 status is COMPLETED7) Employee receives the following email notification that his request is approvedFigure 17 Email Notification after approving the expensesInteracting with BPEL/WF from Oracle Forms P a g e | 21
  23. 23. SUMMARYThis white paper demonstrated an example of how Oracle Forms Application can interact withBPEL Workflow engine and can be a part of Service Oriented Architecture. The Java Class thatacts as a bridge between Oracle BPEL and Oracle Forms is used to query and complete thetasks assigned to jstein user. Email notification has been sent to jstein user about createdtask and to employee to inform him that his/her request is completed.Interacting with BPEL/WF from Oracle Forms P a g e | 22
  24. 24. REFERENCESConfigure SOA Suite 11g for sending email notifications with Google Mailhttp://technology.amis.nl/blog/6019/configure-soa-suite-11g-for-sending-email-notifications-with-google-mailHumon Workflow in 11g (SimpleTask Composite Application)http://redstack.wordpress.com/2010/01/08/human-workflow-in-11g/#comment-298Oracle Support(Metalink) Note: 1099203.1Interacting with BPEL/WF from Oracle Forms P a g e | 23
  25. 25. GLOSSARYInteracting with BPEL/WF from Oracle Forms P a g e | 24

×