Professional Documents
Culture Documents
Executive Overview ........................................................................... 1 Introduction ....................................................................................... 2 Functionality ...................................................................................... 3 Installation ......................................................................................... 6 Runtime Flow .................................................................................... 7 Configuration Changes ...................................................................... 8 Applets .......................................................................................... 8 Business Components ................................................................. 12 Business Components Fields ...................................................... 12 Table ........................................................................................... 13 Business Objects ......................................................................... 13 Link.............................................................................................. 14 Picklist ......................................................................................... 14 View ............................................................................................ 14 Workflow Process ........................................................................ 14 Business Service ......................................................................... 15 Testing ............................................................................................ 23 Workflow Process ........................................................................ 23
Executive Overview
This document details how to use the Siebel Reporting integration with Oracle BI Publisher for generating Siebel Proposal type documents. The Siebel CRM and Oracle BI Publisher integration exists for authoring and generating reports, however with the Report Business Service it can also be used to generate other types of document like Proposals or Quotes and attach the output to the chosen entity. This white paper is not intended to replace or reuse any of the standard Siebel Proposals functionality using the Document Server, it is intended to illustrate how to use a customised solution with the Report Business Service for generating standard documents and attaching the output to an entity as a standard Siebel attachment. The solution should work with any Siebel BI Publisher integration where the Report Business Service is available. For this white paper, the solution was tested with Siebel Web Client 8.1.1.5 and Oracle BI Publisher 10.1.3.4.1. Please note that this technical white paper details example configurations and the steps required may be different for various environments and architectures.
Introduction
The solution offered in this white paper could provide the following benefits: For customers already using Siebel BI Publisher integration for reporting, with similar requirements to generate standard Proposal or Quote documents and attach them to the parent entity, this solution can be used and would remove the requirement for a another document generation engine (Document Server), reducing total cost of ownership (TCO) in the enterprise. For multilingual requirements, using this solution only requires a single Proposal template since translation of the template is done via .xlf files registered on the BI Publisher server. This standardized process reduces the maintenance overhead of multilingual templates. Using BI Publisher for document generation offers many output formats, in particular the option to output in PDF (read only) format. This is in addition to .RTF format, which is the only format available with the Document Server solution. Using BI Publisher for document generation is much more scalable in comparison to the existing Document Server solution. The BI Publisher server can be scaled, load balanced, clustered for failover, and also handles high concurrency. It is also deployed as a java application that can run on many platforms. Document Server can only run on Microsoft Windows, cant be clustered or load balanced, and runs in a sequential mode.
Functionality
The solution offered in this white paper provides the following functionality:-
A new view and applet for an Opportunity, similar to the Proposals view where a user can generate documents against an Opportunity by clicking on the Generate Proposal button. The same concept can be applied to any Siebel entity. An Auto Proposal button which quickly creates a new record for the document generation with pre defined defaults.
Figure 1. Screenshot showing detail view / applet where user can click Generate Proposal and Auto Proposal.
The user has the ability to choose the output type from a pre defined List of Values. For example, RTF or PDF output format. All file types that can are supported by the Siebel Reporting integration with Oracle BI Publisher are possible. The user has the ability to choose a document output language, the generation of multilingual documents works in exactly the same manner as for Siebel Reports. The user can choose the report template to use for the document generation. Note that all templates must exist and be registered as a report template. If users wish to create their own templates and share them with other users, this is the same as standard Siebel reporting functonality.
In this concept the user can enter a query (also useful for testing purposes) for the document generation. In your solution you may want to add logic to pre define the query (QuerySpec input property) passed for document generation and remove this field. The value of the Query Spec used must be in the correct notation, similar to below:
Once the Generate Proposal button is clicked, the report is generated via the Report Business Service and the Oracle BI Pbulisher server. The output is retrieved and stored in the Siebel File System as an attachment to the parent entity. The report is also registered in the My BI Publisher Reports view.
Temporary documents stored are also cleaned up. Logging statements exist for easy debugging. An example Workflow Process is included to test the report generation via the Business Service Simulator. The Business Service is intended to be generic, meaning for each applet and entity where you wish to generate documents, you only need to change the Applet Server Script input properties for report generation and attaching the file.
The solution offered in this white paper does not provide the following: The Proposal library and template views and temapltes are not used in any way. All templates must exist as Siebel Reports templates and be registered in the Reports views. The Document Server is not used at all in this solution. This solution does not allow for BI Publisher reports to be included in Proposals generated via the Document Server. The solution was tested on the Siebel Web Client. It has not been tested on the Mobile / Dedicated Web Client.
Installation
An overview of the installation steps to enable this solution is detailed below; it is assumed that a working Siebel BI Publisher integration for Siebel reporting is already present and that the Report Business Service exists in the repository. For more information on the Report Business Service please see Oracle Support document Siebel BI Publisher 8 Reports Business Service (Doc ID 823360.1). The installation steps are as follows:-
Siebel Tools
Please note, the steps below using the archive files provided offer a fast way to import the new objects and changes into the repository. 1) Extract the .zip file. Lock projects (XMLP Integration, Table Opty, Oppty (SSE)) in Tools 2) Import BI Publisher Proposals.sif 3) Observe the proposed changes and choose to Overwrite changes or just keep the default Merge option. 4) Apply the table changes (click Apply/DDL > choose Apply) 5) Deploy the Workflow Process if required. 6) Stop Siebel Server, Compile SRF, Restart Siebel Server
Siebel Application
7) Add new view, create new responsibility (optional) and associate the new view (Opportunity BI Publisher Proposals View) to the relevant responsibility. 8) Add new List of Values for XMLP_PROPOSAL_OUTPUT_TYPE depending on which output types you want. This LOV can also be multilingual. 9) Clear cache, Re-login to Siebel application
Runtime Flow
A detailed overview of the runtime flow for this solution:User makes applet selection for Proposal
Input values for Report Generation Input values for where to Attach output
User can refresh the applet to see hyperlink for generated document. Document opened from Attachments applet
BIP Proposals Business Service method CleanUpDoc() called to remove temp file
Configuration Changes
The following configuration object changes and primary properties are contained in the archive files associated with this white paper:
Applets
APPLET
NAME
BUSCOMP
COMMENTS
Report Template BC
Search Specification to restrict certain report templates set to: [Report Name] ~LIKE "Proposal*"
Drilldown Object set to: Opportunity Attachment View The applet contains 2 buttons which are controls that invoke methods GenerateBIPReport and AutoBIPProposal Applet User Properties added to enable both buttons.
Opportunity BI Publisher Proposals List Applet function WebApplet_PreInvokeMethod (MethodName) { if (MethodName == "GenerateBIPReport") try {
//Method to retrieve applet defaults and instantiate the BIP Proposals Business Service LogFile("GenerateReport. 10. Started");
var QuerySpec = this.BusComp().GetFieldValue("Query Spec");//Bookmark query to pass to IO var ViewMode = "0";//Viewmode for report generation can also used named constants ie SalesRepView var OutputType = this.BusComp().GetFieldValue("Output Type"); var ReportLanguage = this.BusComp().GetFieldValue("Language Name"); var TemplateName = this.BusComp().GetFieldValue("Template");//Report Name var TemplateId = this.BusComp().GetFieldValue("Template Id");//Report Template Id
psInput1.SetProperty("Position Id", vPositionId);//User position id psInput1.SetProperty("Login Id", LoginId);//User login id psInput1.SetProperty("Query Spec", QuerySpec);//Query Spec psInput1.SetProperty("View Mode", ViewMode);//View Mode psInput1.SetProperty("Output Type", OutputType);//Output type i.e. pdf psInput1.SetProperty("Report Language", ReportLanguage);//ReportLanguage psInput1.SetProperty("Template Name", TemplateName);//report name psInput1.SetProperty("Template Id", TemplateId);//report template id
LogFile("GenerateReport. 25. Inputs: QuerySpec: " + QuerySpec + " TemplateName: " + TemplateName + " TemplateId: " + TemplateId); LogFile("GenerateReport. 30. Calling Business Service");
var sReportName = psOutput1.GetProperty("Report Output Name"); var sReportId = psOutput1.GetProperty("Report Output Id");
LogFile("GenerateReport. 41. Report Output Name: " + sReportName + " Report Output Id: " + sReportId); LogFile("GenerateReport. 43. Calling AttachReport.");
//Where to Attach inputs //var ProposalName = this.BusComp().GetFieldValue("Proposal Name");//to rename attached file if required
psInput2.SetProperty("Output Name", sReportName);//Report name generated psInput2.SetProperty("Entity Id", ParentEntityId);//Entity Parent Id psInput2.SetProperty("Entity Parent Field", "Oppty Id");//Entity Parent Fieldname psInput2.SetProperty("Entity Primary", "Opportunity");//Entity Primary psInput2.SetProperty("Entity Name", "Opportunity Attachment");//Name of the destination Attachment BC psInput2.SetProperty("Entity Object", "Opportunity");//Name of the destination Attachment B0 //psInput2.SetProperty("Entity Filename Field", "OpptyFileName"); //Filename field in Attach BC //psInput2.SetProperty("Propsosal Name", ProposalName);//Custom Proposal filename
LogFile("GenerateReport. 45. AttachReport. Inputs: Output Name: " + sReportName + " Entity Id: "+ ParentEntityId + " Report Id: "+ sReportId);
//this.BusComp().InvokeMethod("RefreshRecord"); }//end try finally { psInput1 = null; psOutput1 = null; psInput2 = null; psOutput2 = null; oService1 = null; oService2 = null;
return (CancelOperation); }
10
if (MethodName == "AutoBIPProposal") { //Method to specify default fields values that are set when user clicks this button. try { LogFile("AutoBIPProposal. 10. Started");
var currentDate = new Date; var genDate; Clib.strftime(genDate, "%m/%d/%Y %H:%M:%S", currentDate);
ProposalBC.NewRecord(NewAfter);
//ProposalBC.SetFieldValue("Name", genDate); ProposalBC.SetFieldValue("Output Type", "PDF"); ProposalBC.SetFieldValue("Language Name", "ENU"); ProposalBC.SetFieldValue("Template", "Proposal Opportunity"); ProposalBC.SetFieldValue("Template Id", "88-3H53D");//retrieval of this field value could be scripted
11
//Note the directory path below needs to be modified accordingly to an existing path to avoid error var MyFile = Clib.fopen("D:\\21219\\tempdir\\BIPProposals_Applet_Log.txt", "at"); var sTime = Clib.ctime(Clib.time()); Clib.fputs(sTime + ": " + sFile + "\n", MyFile); Clib.fclose(MyFile); }
Business Components
BUSINESS COMPONENT
NAME
TABLE
COMMENTS
S_OPTY_XM
NAME
JOIN
COLUMN
PICKLIST
DEFAULT
X_ATTACHMENT_ID X_LANG_ID
Language Name
LANG_CD
PickList Language
NAME PAR_ROW_ID
N Y
Field: 'Id'
X_OUTPUT_TYPE
FILE_NAME
12
Query Spec
X_QUERY_SPEC
Template
X_TEMPLATE
Template Id
X_TEMPLATE_ID
Type
TYPE
Table
TABLE COLUMNS (S_OPTY_XM)
COLUMN
TRANSLATE
TYPE
DEFAULT
LOV TYPE
LOV BOUNDED
X_ATTACHMENT_ID X_LANG_ID
X_OUTPUT_TYPE
S_LST_OF_VAL
Varchar(50)
OSAL_OUTPU T_TYPE
Business Objects
BUSINESS OBJECT
NAME
COMMENTS
Opportunity
Added Business Component Opportunity BI Publisher Proposals with Link property: Opportunity/Opportunity BI Publisher Proposals
13
Link
LINK
NAME
CASCADE DELETE
COMMENTS
Delete
New parent/child link between Business Components Opportunity and Opportunity BI Publisher Proposals
Picklist
PICKLIST
NAME
COMMENTS
New picklist which draws values from LOV Type XMLP_PROPOSAL_OUTPUT_TYPE (Bounded = TRUE, Static = TRUE)
New picklist which draws values from Report All Templates BC (Static = FALSE, Long List = TRUE)
View
VIEW
NAME
COMMENTS
Workflow Process
WORKFLOW PROCESS
NAME
COMMENTS
Business Object: Report Output Inserts new record into Report Output BC
14
Business Service
BUSINESS SERVICE
NAME
COMMENTS
BIP Proposals
BUSINESS SERVICE SERVER SCRIPT
Generic business service for creating reports and attaching to an entity based on inputs
function Service_PreInvokeMethod (MethodName, Inputs, Outputs) { if (MethodName == "AttachBIPReport") { AttachBIPReport(Inputs,Outputs); return (CancelOperation); } if (MethodName == "ExecuteBIPReport") { ExecuteBIPReport(Inputs,Outputs); return (CancelOperation); } return (ContinueOperation); } function LogFile(sFile) { //Note the directory path below needs to be modified accordingly to an existing path to avoid error var MyFile = Clib.fopen("D:\\21219\\tempdir\\BIPProposals_BS_Log.txt", "at"); var sTime = Clib.ctime(Clib.time()); Clib.fputs(sTime + ": " + sFile + "\n", MyFile); Clib.fclose(MyFile); } function CleanUpDoc(xFileName) { //Code to clean up temp file system
15
LogFile("CleanUpDoc. 10. Now deleting temp file - " + xFileName); Clib.remove(xFileName); } function AttachBIPReport(Inputs, Outputs) { /* Given a Report Id, pulls the merged document out of the File System and returns the path to the file
GetFile - The GetFile method copies a file in the Siebel File System that is attached to the current record into a temporary directory. The method returns the path to the file in the temporary directory. The temporary directory is defined in the cfg file for the Siebel application as the value of the TmpDir parameter in the [Siebel] section. This method allows a user to view or edit a file attachment.
Inputs: Report Id Outputs: The full path to the file name, attaches Report document to an entity */ try { LogFile("AttachBIPReport. 10. Starting");
var sReportId = Inputs.GetProperty("Report Id"); var sOutputName = Inputs.GetProperty("Output Name"); var sEntityId = Inputs.GetProperty("Entity Id"); var sEntityParentField = Inputs.GetProperty("Entity Parent Field"); var sEntityName = Inputs.GetProperty("Entity Name"); var sEntityObj = Inputs.GetProperty("Entity Object"); var sEntityPrimary = Inputs.GetProperty("Entity Primary"); var sEntityAttachBCFileNameField = Inputs.GetProperty("Entity Filename Field"); //var sProposalName = Inputs.GetProperty("Propsosal Name");
16
if (FirstRecord()) { var ReportName = GetFieldValue("Report Name"); var ReportFileExt = GetFieldValue("ReportOutputFileExt"); var ReportFileName = GetFieldValue("ReportOutputFileName");
LogFile("AttachBIPReport. 30. ReportName : " + ReportName + " ReportFileExt : " + ReportFileExt + " ReportFileName : " + ReportFileName); } else { throw("Unable to locate a Report with Id '" + sReportId + "'"); }
//If Success, Split the output of GetFile to just get the file path if (sFileName.indexOf("Success") > -1) { var xFileName = sFileName.substring(8); LogFile("AttachBIPReport. 40. GetFile Success xFileName : " + xFileName); Outputs.SetProperty("xFileName",xFileName); }//end if
else { throw("Unable to GetFile for Id '" + sFileName + "'"); }//end if } // end with
17
LogFile("AttachBIPReport. 51. boAtt: " + boAtt + " bcEntAtt: " + bcEntAtt + " sEntityName: " + sEntityName);
if (!FirstRecord()) throw("Unable to locate a record with Id '" + sEntityId + "'"); } // end with
with (bcEntAtt) { bcEntAtt.NewRecord(NewAfter); var AttachmentRowId = bcEntAtt.GetFieldValue("Id"); var RetValue = bcEntAtt.InvokeMethod("CreateFile", xFileName, sEntityAttachBCFileNameField, "Y"); bcEntAtt.WriteRecord();
if (RetValue.indexOf("Success") > -1) { LogFile("AttachBIPReport. 70. Attachment added to entity: " + sEntityId); }//end if } // end with
18
Outputs.SetProperty("AttRowId", AttachmentRowId);
LogFile("AttachBIPReport. 80. Attachment ROWID: " + AttachmentRowId); //return the ROW_ID of the attachment record to relate the BIP proposal to the attachment LogFile("AttachBIPReport. 90. Calling CleanUpDoc"); CleanUpDoc(xFileName); LogFile("AttachBIPReport. 100. End"); }
finally { // Release object variables bcReportOutput = null; boReport = null; bcAtt = null; bcEntAtt = null; boAtt = null;
} // end finally } function ExecuteBIPReport(Inputs, Outputs) { /* Given a Report Id, pulls the merged document out of the File System and returns the path to the file
GetFile - The GetFile method copies a file in the Siebel File System that is attached to the current record into a temporary directory. The method returns the path to the file in the temporary directory. The temporary directory is defined in the cfg file for the Siebel application as the value of the TmpDir parameter in the [Siebel] section. This method allows a user to view or edit a file attachment.
Inputs: Report Id Outputs: The full path to the file name, attaches Report document to an entity */ try { var sPositonId = Inputs.GetProperty("Position Id"); var sLoginId = Inputs.GetProperty("Login Id"); var sQuerySpec = Inputs.GetProperty("Query Spec");
19
var sViewMode = Inputs.GetProperty("View Mode"); var sOutputType = Inputs.GetProperty("Output Type"); var sReportLang = Inputs.GetProperty("Report Language"); var sTemplateName = Inputs.GetProperty("Template Name"); var sTemplateId = Inputs.GetProperty("Template Id");
LogFile("ExecuteBIPReport. 05. Query Spec: " + sQuerySpec + " sTemplateName: " + sTemplateName + " sTemplateId: " + sTemplateId); LogFile("ExecuteBIPReport. 10. Start"); LogFile("ExecuteBIPReport. 11. Get report template name and related IO details");
var reportBO = TheApplication().GetBusObject("Report Administration"); var reportBC = reportBO.GetBusComp("Report All Templates BC");
reportBC.ActivateField("Report Name"); reportBC.ActivateField("Integration Object Name "); reportBC.ActivateField("ReportTmplFileName"); reportBC.ClearToQuery(); reportBC.SetSearchSpec("Id", sTemplateId); reportBC.ExecuteQuery(ForwardOnly);
if (reportBC.FirstRecord()) { var sReportName = reportBC.GetFieldValue("Report Name"); var sPrimaryIO = reportBC.GetFieldValue("Integration Object Name");//PrimaryIO var sRepTmplFileName = reportBC.GetFieldValue("ReportTmplFileName");//rtf name } else { LogFile("ExecuteBIPReport. 12. Cant find report template"); }
reportBC = null;
20
var currentDate = new Date; var genDate; Clib.strftime(genDate, "%m/%d/%Y %H:%M:%S", currentDate);
reportBC.NewRecord(NewAfter);
reportBC.WriteRecord();
Outputs.SetProperty("Report Output Name", sReportName + "_" + Id); Outputs.SetProperty("Report Output Id", Id);
LogFile("ExecuteBIPReport. 20. Report Output Name: " + sReportName + "_" + Id + " Report Output Id: " + Id); LogFile("ExecuteBIPReport. 30. Generating Report Start");
inpargs.SetProperty("LDAPEnabled","False"); inpargs.SetProperty("MethodName","GenerateBIPReport"); inpargs.SetProperty("TimeZone","(GMT-08:00) Pacific Time (US & Canada)"); inpargs.SetProperty("ReportTemplateId",sTemplateId);//psInput inpargs.SetProperty("ReportOutputId",Id);//psInput inpargs.SetProperty("ReportOutputType",sOutputType);//psInput inpargs.SetProperty("BCViewMode",sViewMode);//psInput inpargs.SetProperty("PositionId", TheApplication().PositionId());//psInput inpargs.SetProperty("Synchronous","No");
21
inpargs.SetProperty("ReportName",sReportName);//psInput inpargs.SetProperty("TemplateName",sRepTmplFileName);//psInput inpargs.SetProperty("LanguageCode",sReportLang);//psInput inpargs.SetProperty("ReportOutputLang",sReportLang);//psInput inpargs.SetProperty("ReportOutputLocale",sReportLang);//psInput inpargs.SetProperty("IntegrationObject",sPrimaryIO);//psInput inpargs.SetProperty("LoginId",sLoginId);//psInput inpargs.SetProperty("BIPUserId","SADMIN");//Siebel username/password - depends on BIP security model inpargs.SetProperty("BIPPassword","MSSQL");//Siebel username/password - depends on BIP security model inpargs.SetProperty("Bookmark",sQuerySpec);//psInput Bookmark inpargs.SetProperty("ReportSelected",sReportName);//psInput
bs.InvokeMethod("GenerateBIPReport",inpargs,outargs); // at this point the report could take a long time to generate only way to tell is to requery BC until report row_id = success
return (CancelOperation); }
finally { // Release object variables reportBC = null; reportBO = null; bs = null; inpargs = null; outargs = null;
} // end finally }
22
Testing
This solution assumes a working Siebel BI Publisher integration already exists. It is useful to test the Report Business Service using the Workflow Process through the Business Service Simulator.
Workflow Process
To test using the Workflow Process, once deployed, follow the steps below: 1. 2. 3. 4. 5. Navigate to the Administration Business Service view. Click on Simulator Import file WF Process Simulator Service.xml into the Service Name applet. Import file WF Process Simulator Arguments.xml into the Input Arguments applet, change arguments as required Click Run. The report output should be created in the My BI Publisher Reports view.
If the report generation works successfully through the Business Service Simulator but not through the button click solution, it might be useful to check the following: Value used in the Query String should be in the correct syntax The input parameters in Applet Server Script might not be specified correctly Make sure the Report template already exists. If using Auto Proposal check the default values in the script are valid, especially for Template Name and Template Id.
23
Using BI Publisher for Siebel Proposals September, 2011 Author: John Bedford Oracle Corporation World Headquarters 500 Oracle Parkway Redwood Shores, CA 94065 U.S.A. Worldwide Inquiries: Phone: +1.650.506.7000 Fax: +1.650.506.7200 oracle.com 0109 Copyright 2009, Oracle and/or its affiliates. All rights reserved. This document is provided for information purposes only and the contents hereof are subject to change without notice. This document is not warranted to be error-free, nor subject to any other warranties or conditions, whether expressed orally or implied in law, including implied warranties and conditions of merchantability or fitness for a particular purpose. We specifically disclaim any liability with respect to this document and no contractual obligations are formed either directly or indirectly by this document. This document may not be reproduced or transmitted in any form or by any means, electronic or mechanical, for any purpose, without our prior written permission.
Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners.