Friday, June 14, 2019

Fusion BIP : How to show one parameter in report and pass different value to the datamodel

Hi All,

There can be a scenario where we might need to show one value in the report and a different value to the actual query. Lets say a person_name to the user and person_id to the underlying data model.

Here the query builder for the parameter shows only single query field :
==>




So in this case we can write the query as below

select A , B from dual;

Here  the field A will be shown to the user and the field B would be passed to the data model.


Thanks,
Srikanth

Thursday, March 14, 2019

How to get name of the day in Fusion BIP env


If you have already worked in BIP reports ,getting the name of the day from SQL query might seem not feasible.

Lets say if we run below query, it is always going to return a number denoting the day.

==> select to_char( SYSDATE , 'DAY' ) Todays_name from dual;  -- considering today is friday

Todays_name
==========
6

However if you want the result to be either FRIDAY or Saturday, then we need to pass an additional parameter to the TO_CHAR() function. This is 'nls_date_language = American'.

===> select to_char(sysdate, 'DAY' , 'nls_date_language = American' ) Todays_name from dual;

Todays_name
==========
FRIDAY

For more info on this please refer to official Oracle documentation.

===> https://docs.oracle.com/cd/B13789_01/server.101/b10749/ch9sql.htm


Hope this helps.


Thanks,
Srikanth

Tuesday, February 12, 2019

Fusion BIP : How to accomodate a big table in MS-WORD page

While working in BIP, you might encounter a requirement where a huge table ( say with 30 columns ) need to be accomodated in a single page. For example below is the page which shows the table partially.








 In that case even when we select any of the below page sizes, the table would not be shown completely.

                       



To view the table in its entirety we can select the below option. This is called WebLayout and is present in the bottom right corner of the document.

                                       






Now the complete table can be viewed and the prompts can be edited as we wish.





Thanks for reading.

Regards,
Srikanth

Tuesday, November 20, 2018

What to do if HCM Extract definition is not editable : Rel 13 18C / 18D

If you are suddenly seeing that you are not able to edit the HCM Extract definition, which you were able to edit earlier, then there is a new feature from 18C/18D patch bundle that is causing it.

The extract would be in read only format as shown below :






The solution for this is to open the extract and uncheck the "Lock Definition" and provide the comments.



Once the extract is saved, the extract would become editable again.

Thanks,
Srikanth

Wednesday, September 5, 2018

HCM Extracts : How to find ESS job id for a scheduled extract to be cancelled

Hi ,

Many times we may not find the exact ESS job to be cancelled, when we want to cancel an already scheduled extract.

In that case we can use below SQL to identify the ESS job ID. Here we just need to key in the extract run name which we have entered while scheduling the extract :


select pfi1.INSTANCE_NAME , pfi1.flow_instance_id , essrh1.requestid  from
pay_flow_instances pfi1 ,
pay_requests pr1,
ess_request_history essrh1
where pfi1.INSTANCE_NAME like '<Extract Run Name>'
and pfi1.flow_instance_id = pr1.flow_instance_id
and pr1.call_id = essrh1.requestid

Hope this helps.

Thanks,
Srikanth

Monday, April 23, 2018

Fusion BIP : How to get current logged in user in report

I would like to share a very small topic, yet very useful in Fusion reports space.

Many times we want to query records/ transactions related to the logged in user. (i.e, the user who is currently running the report ).

For this we can use the below query :

SQL>> select SYS_CONTEXT( 'USERENV', 'CLIENT_IDENTIFIER' )  from dual;


Happy learning and sharing,
Srikanth

Wednesday, March 21, 2018

HCM Extracts : How to specify dynamic date in HCM Extracts Schedule


It is very rare that the HCM Extracts would be developed to be run on ad-hoc basis.
Most of the times the extracts are scheduled on a periodic basis.

Saying so, we might need to pass dynamic value for its parameters for ex: effective date. ( in place of SYSDATE which is by default )

Lets say we want the extract to run with date range of 15 days in future. ( i.e EffectiveDate is SYSDATE+15 )

To achieve this, we need to go to Data Exchange ==> HCM Extracts ==> Refine Extracts ==>
Search for the extract and click on edit.



Select the Effective Date parameter and click on edit. Enter below values :
a. Parameter Basis : Post SQL Bind
b. Basis Value : select sysdate+15 from dual
c. Save and then Submit.
 


Bingo, now whenever the extract runs the effective date would be Todays date + 15.

Thanks for reading,
Srikanth






Tuesday, March 20, 2018

Fusion BIP : How to view the report output submitted by any user.

Many times we need to view the report outputs submitted by others. This might be to debug an issue or just for data validation.

We can achieve this from the same BIP login of the Fusion Apps, from where we generally create the reports.

Navigation :
a. Open the URL : https://< FusionApps hostname>/xmlpserver
b. Click on the Home link.
c. Click on the "Report Job History" on the bottom left.


d. This opens a search window, enter the Report Job Id and click on Search.
    (  In case of HCM Extracts, the ESS JobID of the BIP Job can be entered in the ReportJobName field ).
     The search results will be shown which is irrespective of the user who has submitted them.
     The output can also be downloaded from the same.
   

             
Now click on the "Report Job Name" and this takes us to the page where we can download the report output.

Thanks for reading,
Srikanth

Monday, February 12, 2018

What to do if we are unable to build a JET app and getting unexpected token issue.

Sometimes when we try to build or deploy the JET application with the below two commands ..
a. ojet build --release
b. grunt build:release

..we get the below error stack.

node_modules\uglify-js\tools\node.js:27:1), <anonymous>
:86:23)
    at formatError (util.js:642:16)
    at formatValue (util.js:544:18)
    at inspect (util.js:324:10)
    at format (util.js:191:12)
    at Console.log (console.js:127:21)
    at tooling.build.then.catch.error (C:\Users\AppData\Roaming\npm\nod
e_modules\@oracle\ojet-cli\lib\tooling\build.js:29:27)
    at <anonymous>
  message: 'Unexpected token: name (binary)',
  filename: 0,
  line: 239,
  col: 22,
  pos: 11651 }

At the first glance we might not be able to decide if the error is from the
a. Our developed source code
b. node_modules libraries
c. or the files in the directory structure : C:\Users\AppData\Roaming\npm\nod
e_modules

However by doing the modifying the below function in the file : /node-modules/uglify-js/lib/parse.js ...


  1. function unexpected(token) {  
  2.   console.trace()  //  HERE THE DIAGNOSTIC CHANGE TO DETERMINE THE FAILURE  
  3.    if (token == null)  
  4.   token = S.token;  
  5.   token_error(token, "Unexpected token: " + token.type + " (" + token.value + ")");  
  6. };  

.. we can get hold of token that is causing the issue.

{ SyntaxError: Unexpected token: name (binary)
    at JS_Parse_Error.get (eval at <anonymous> (D:\node_modules\uglify-js\tools\node.js:27:1), <anonymous>
:86:23)

Here binary is the culprit and we can search this keyword in our entire application and fix the issue.

In my case I was using an expression like below.. where in let keyword was not being identified by the build tools.

let binary = '';

Thanks,
Srikanth

Courtesy : Oracle community thread

Tuesday, January 30, 2018

How to identify the correct JDeveloper version for your JCS / PaaS

Working in JCS / PaaS, many times we would be in cross roads as to which JDeveloper version needs to be picked up for the development.

I was recently made aware of the perils of choosing the wrong JDev version by my teammates, before which I slightly turned a blind eye on what might become a grave mistake.

However it is always recommented to verify the version from the JCS itself, before proceeding to downloading the appropriate JDeveloper.

Simply login into your JCS console ( i.e, Weblogic console ) and verify the version at the bottom left corner.



Also to check if your JDev is at the correct version level. Check the version from Help --> About.





Though this seems to be a trivial matter, if advanced version Jdev ( more than current JCS version ) is used to develop an application, it can never be downgraded to a lower version.
This would mean a complete re-work of the application in a lower version JDev.

Thanks for reading,
Srikanth

Friday, January 19, 2018

"To JET or not to JET !! " : How to choose between ADF and JET

In the beginning of a Oracle based/ scoped Web project we have to take a decision whether to go the conventional ADF path or tread the now trending JET path.

Many a times we get lured by the latest cutting edge technologies and incline towards that. However I would like to share my learnings in this scenario.

I feel JET is more apt choice :

a. If the application is accessed from mobile devices ( responsive applications ).

b. If it is not a very data intensive application. We can tap the full power of JET if user acts on limited set of data. That is the data is already fetched and the data is manipulated in the ViewModel layer.

c. If application uses third party Javascript libraries. Ex: cordova plugins, Camera feature, QR code scanning etc

d. The Oracle JET community is very proactive and we can expect help whenever we are in an issue.


I feel JET is not a appropriate in below scenarios : 

a. If the UI needs to show data from multiple sources. In such cases we need to go with Master-Detail screens, Cascading LOVs. 
                This becomes timetaking specially when all the sections are based on different sources ( Ex: REST services ) and the onus is on developer to handle the dependencies, filtering, sorting, searching. etc. I wish if JET could also come up with the 

b. If we need Search region, Advance search region, table level filtering, table level sorting etc there needs to be extensive coding to be done. If the project timelines provide enough bandwidth then this additional task can be compensated.

c. Even though there are a vast number of  JET Visualizations are available in JET, to feed these components with the data in appropriate format, it needs lot of data massaging which means more time obviously.

d. If the OAuth needs to be implemented more time needs to be pumped in, as it is different from SSO or weblogic based authentication.



        Finally as ADF is around for a long long time, all the features are matured enough and in a tight time lined project this allways proves to be a better choice.
Given the extensive documentation, Blogs and Support we are not stuck at particular issue.

Though I have shared my experiences, it is upto the requirement of the project and ofcourse the client preferences !! :)

Thanks for reading,
Srikanth




Thursday, January 11, 2018

Oracle JET : How to populate a Combobox from a REST service

We can statically populate a combobox in the HTML as shown in the cook book :

 <oj-combobox-one id="combobox" value="{{val}}"
            style="max-width:20em">
            <oj-option value="Internet Explorer">Internet Explorer</oj-option>
            <oj-option value="Firefox">Firefox</oj-option>
            <oj-option value="Chrome">Chrome</oj-option>
            <oj-option value="Opera">Opera</oj-option>
            <oj-option value="Safari">Safari</oj-option>
          </oj-combobox-one>

However if the option list is long and if we would want to source it from a REST service.

Please note that I would not confirm this is the best way to fetch, however this worked for me and performance wise also its not bad.

To do this we would need to create a new helper javascript file apart from the JET component ( .html and .js )

A. Lets say we want to populate the Colours LOV. Create a new .js viewModel as below :
     Write the code to fetch from Colours REST url. The main method is the fetch() method highlighted in yellow : 


define(['ojs/ojcore', 'knockout', 'ojs/ojmodel', 'ojs/ojtable','ojs/ojcollectiontabledatasource',
        'jquery', 'ojs/ojbutton', 'ojs/ojinputtext'], function (oj, ko) {

    function coloursLOVHelperViewModule() {
        var self = this;
        
         self.urlcoloursLOVURL = ko.observable("YOUR URL ") ;

        self.coloursArray = ko.observableArray([]);
        self.ColoursLOVCol = ko.observable();
        self.ColoursLOVDataSource = ko.observable();
        
        self.fetch = function(successCallBack) {
                        // populate the collection by calling fetch()
                        self.ColoursLOVCol().fetch({
                        success: successCallBack,
                        error: function(jqXHR, textStatus, errorThrown){
                        console.log('WorkRequestIDHelper : Error in fetch: ' + textStatus);
                        }
                        });
                        };
        
        
        // Colours LOV
        parseColour = function (response) {
            if (response['items']) {
            var innerResponse = response['items'][0];
           
                    return {ColourId: innerResponse['ColourId'],
                            ColourName: innerResponse['ColourName']
                            };
            }            
            return {
                    ColourId: response['ColourId'],
                    ColourName: response['ColourName']
                  };
        };
        
         var ColourLOVModel  = oj.Model.extend({
                urlRoot: self.urlColoursLOVURL() , // urlWorkRequests,
                parse: parseColour,
                idAttribute: "ColourId"
            });     
        
         var myColourLOVModel = new ColourLOVModel();
            
         var collectionColoursLov = oj.Collection.extend({
                    url: self.urlColoursLOVURL(),
                    //fetchSize: -1,
                    model: myColourLOVModel
                });
                
         
         self.ColoursLOVCol(new collectionColoursLov());
         self.ColoursLOVDataSource(new oj.CollectionTableDataSource(self.ColoursLOVCol()));
}
    return new coloursLOVHelperViewModule();
});


B. Import the above .js in our main viewModel .js file :

define(['ojs/ojcore', 'knockout', 'viewModels/common/coloursLOVHelper',...)
], function (oj, ko, colourLOV )...........

C. Call the fetch method as below :

        self.colorsArray= ko.observableArray([]); 
       colourLOV.fetch(
                                function(collection, response, options)
                                    {
                                                                             
                                        if(self.colorsArray.length == 0) 
                                        {
                                            for (var i = 0; i < collection.size(); i++) 
                                            {
                                                var coloursModel = collection.at(i);
                                                self.colorsArray.push({value: coloursModel.attributes.colorId, label: coloursModel.attributes.colourName});
                                            }
                                        }
                                    }
                             )

D. Now in the main html page use the above populated array variable :

    <oj-combobox-one id="coloursCombobox" options="[[colorsArray]]" value="{{colorsSelectedValue}}" 

Hope this helps.
Srikanth

Friday, December 29, 2017

Deploying Oracle JET application ( .war file ) to Weblogic/ JCS

These steps are tested for Oracle JET 4.X release as well.

I was searching for the details on how to generate WAR file out of JET application and then deploy it to JCS / Weblogic.

I have found some really nice articles, however i would like to present the same in the way I understood them.

Not demeaning the content from those posts, I would like to condense the steps a little bit, so that it would be a reference to me as well. So here we go : 

a. Install the grunt-war using below command : 
         npm install grunt-war --save-dev

b. Verify if the directory "/grunt-war" is generated in the node_modules directory.

c. Create a javascript file as below in scripts folder : 


The file content is as below :

/*******************************************************************************/

module.exports =  {

  /*
   * Build a WAR (web archive) without Maven or the JVM installed.
   *
   * Template strings in the <%= %> tags are set in the data section of Gruntfile.js,
   *  or you can hardcode the strings here instead
   */
      
        target: {
          options: {
            war_dist_folder: '<%= distdir %>',      /* Folder to generate the WAR into, set in data section of Gruntfile.js */
            war_name: '<%= appname %>',            /* The name for the WAR file (.war will be the extension) */
            webxml_webapp_version: '2.5', /* I needed this older version for JCS-SX */  
            war_extras: [ {filename: 'grunt-war-credits.txt', data: 'This line will appear in the file!\n see http://likeahouseafire.com/2017/08/09/updated-using-grunt-to-create-war-jet3x/ '}, 
                          {filename: 'WEB-INF/weblogic.xml', data: '<?xml version="1.0" encoding="UTF-8"?>\n<weblogic-web-app xmlns="http://www.bea.com/ns/weblogic/90" xmlns:j2ee="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.bea.com/ns/weblogic/90 http://www.bea.com/ns/weblogic/90/weblogic-web-app.xsd">\n  <jsp-descriptor>\n    <keepgenerated>true</keepgenerated>\n    <debug>true</debug>\n  </jsp-descriptor>\n  <context-root>/<%= appname %></context-root>\n</weblogic-web-app>'}],
                                          /* the war_extras are extra files to be generated, needed since grunt-war doesn't create a weblogic.xml */                                          /* also notice that we're using the <%= appname %> variable in there */  
            webxml_welcome: 'index.html', /* to point web.xml to the default page */
            webxml_webapp_extras: [ '<login-config />\n', '<session-config>\n    <session-timeout>\n    30\n    </session-timeout>\n</session-config>\n' ]  
                                          /* some extra settings for web.xml to work with JCS-SX */

          },
          files: [
            {
              expand: true,
              cwd: '<%= appdir %>',             /* find the source files for the WAR in the /web folder, set in Gruntfile.js */
              src: ['**'],
              dest: ''
            }
          ]
        }
};

/*******************************************************************************/

Deploying an ADF application from JDev to JCS weblogic server directly

Hi,

I would like to share the steps to deploy the ADF application from JDEv to JCS Weblogic ( or any standalone weblogic server ).

1. Create an Application Server connection from the JDev by giving Hostname, Port, Credentials , Weblogic Domain from below navigation.

 

a. Select Standalone server as below : 

                                           b. Give connection name :
c. Give server credentials with which you login to weblogic console.

                                         d. Give hostname, ports, domain name
                                          e. Next click on Test. The Test status would be shown as below
f. If all the tests are successfull, click on finish.

2. Select the required deployment profile from below menu :

    Application ==> Deploy

                     
               

The log will show the status of the deployment.
If the application context names are already use in server, the deployment might fail.
In such case, change the J2EE context of the application and redeploy.

3. Verify the deployment from JCS.

Thanks for reading,
Srikanth


Wednesday, December 27, 2017

Oracle JET : How to control the number of records shown in Oj-Table, apart from pagination.


This post is to share a trivial issue I faced with OjTable and how I resolved the same.
This might be a simple and common issue, but might help those who have not figured out the root cause.

Here ADFBC REST service was returning expected data and the JET table was also set with correct pagination setup.


<oj-paging-control id="paging" data='[[localPagingDatasource]]' page-size='5' layout="auto" maxPageLinks="10" slot='bottom'>
</oj-paging-control>

Here I expected the table to show 5 rows per page. However the data exceeded this and showed all the data at once.

To resolve this , I have used fetchSize:5  in the oj collection as below : 


This will make sure only 5 rows are shown per page.

Thanks for reading,
Srikanth

Saturday, December 23, 2017

Oracle JET : How to get OJTables current selected rowkey

I would like to share a simple snippet which can be used to get the current selected rowkey.

This is useful in creating Master Detail oj data tables in JET.
This is also useful where you want a different section to be refreshed based on selected row.


In the view level , enter the below handler "[[actionSequence]]" for the "on-oj-before-current-row" attribute : 





Also in the corresponding viewModel javascript file, implement the handler as below :
   "data.detail.currentRow.rowKey"

Added this content/ topic as this snippet was not readily available on the net. Hope this helps and might save your lot of time in implementing the same.

Thanks for reading.

Fusion BIP : How to show one parameter in report and pass different value to the datamodel

Hi All, There can be a scenario where we might need to show one value in the report and a different value to the actual query. Lets say a...