Friday, November 14, 2014

implementing javascript continuous callback

trying to figure out how to implement Facebook's message badge notification

probably it's as simple as a function calling itself over and over again - javascript lends itself to this kind of style, taking advantage of the non-blocking attribute. Although this might not be the optimal way of doing it - probably setting a boolean variable inside the loop to deactivate/reactivate it would be a good idea (deactivate when user activity is not detected and just reactivate otherwise)

$scope.messageCount would later be interpolated within the badge elements

var monitor = function() {
    setTimeout(function() {
        console.log('monitoring ..');
        MessageFactory.getMessages('545846a622f1a2a188405579', function(messages) {
            $scope.messages = messages;
            $scope.messageCount = messages.length;
        });
        monitor();
    }, $scope.global.refreshInterval);
};
monitor();

or probably I'm better off with an infinite loop?

- Rain

Thursday, November 13, 2014

project re-code

for more than 3 years I haven't written a single update. things happened and many things definitely changed. I have began to explore and research other web technologies, though not to a point of abandoning Java - it's my first love after all. I wish I could've documented all the things I have learned for the past few months - which somehow had significantly shaped the way I think about web programming.

most of my recent projects involve REST technologies coupled with Single Page Application frameworks - call to AngularJS, which at first I was very skeptic with, but eventually began to fell in love with. this journey opened up many doors which led me to NodeJS and MongoDB - which finally made me realise how powerful Javascript has become recently.

well this is my wake up call to word-engrave my new journey. let's see where technology could lead me this time - and hopefully change the world with it eventually

cheers,

- Rain

I have a new twitter handle @7th_coder (which will be my main developer twitter account - so anything related with coding stuff, it goes there)

Wednesday, June 29, 2011

Java Assert

The assert keyword is mainly used for unit testing, enabling you to test variable (value) assumptions of your program during runtime. Assert checking could be enabled by configuring "-ea" on VM options - otherwise assert statements would be ignored. With the use of assert, you will be able to pin point potential bugs faster.



In practice I don't often use assert; so prolly I'm writing this entry to change that.

Tuesday, June 28, 2011

Functions on Responsibility

I wanted to configure the USD/PHP GL Daily Rates for the day but didn't know the responsibility that contains the setup function. So I used this query:


GL Super User contained it ~ not sure though if this is a custom responsibility or not.

Monday, June 27, 2011

Value Set Auto Filter based on a Parent Parameter

For scenarios you’re required to populate the selection list of the second parameter based on a parent parameter, you’ll need to use :$FLEX$.[parent_value_set_name] inside the where clause configuration of the second value set (table type)

parent parameter value set:


second parameter value set:


When you run the concurrent program, the parameter prompt will somehow look like this


- Rain

Tuesday, June 21, 2011

OAF File Upload

I tried to utilize an attachment image component as an attempt to work on a file upload function (because of the word "attachment") but failed miserably XDww Second attempt was with messageFileUpload component and yeah I finally got it right this time.


The only thing you need to take note is to link the component with a ViewObject attribute - which value will be used as a reference to retrieve the file for later viewing.


A null reference value will render the textfield + browse button combo, while a non-null value will render a view hyperlink and a clear button (which removes the reference value from the attribute)

TODO: clarify internal mecha / tables related.

Friday, May 27, 2011

Concurrent Phase and Status Codes

Return codes (OUT parameters) from FND_CONCURRENT.WAIT_FOR_REQUEST

Phase Codes


Value  Meaning
 C  Completed
 I  Inactive
 P  Pending
 R  Running

Status Codes


Value    Meaning
 D      Cancelled
 U  Disabled
 E  Error
 M  No Manager
 R  Normal
 I  Normal
 C  Normal
 H  On Hold
 W  Paused
 B  Resuming
 P  Scheduled
 Q  Standby
 S  Suspended
 X  Terminated
 T  Terminating
 A  Waiting
 Z  Waiting
 G  Warning

Phase Status Description
PENDING Normal Request is waiting for the next available manager.
PENDING Standby Program to run request is incompatible with other program(s) currently running.
PENDING Scheduled Request is scheduled to start at a future time or date.
PENDING Waiting A child request is waiting for its Parent request to mark it ready to run. For example, a request in a request set that runs sequentially must wait for a prior request to complete.
RUNNING Normal Request is running normally.
RUNNING Paused Parent request pauses for all its child requests to finish running. For example, a request set pauses for all requests in the set to complete.
RUNNING Resuming All requests submitted by the same parent request have completed running. The Parent request resumes running.
RUNNING Terminating Request is terminated by choosing the Cancel Request button in Requests window.
COMPLETED Normal Request completed successfully.
COMPLETED Error Request failed to complete successfully.
COMPLETED Warning Request completed with warnings. For example, a request is generated successfully but fails to print.
COMPLETED Cancelled Pending or Inactive request is cancelled by choosing the Cancel Request button in the Requests window.
COMPLETED Terminated Request is terminated by choosing the Cancel Request button in the Requests window.
INACTIVE Disabled Program to run request is not enabled. Contact your system administrator.
INACTIVE On Hold Pending request is placed on hold by choosing the Hold Request button in the Requests window.
INACTIVE No Manager No manager is defined to run the request. Check with your system administrator. A status of No Manager is also given when all managers are locked by run-alone requests.

Thursday, May 26, 2011

Programmatic Request Submission (FND_REQUEST.SUBMIT_REQUEST)



used when you need to issue a request within a PL/SQL block (normally from a parent request; parameters doesn’t include the errbuf and retcode). Oracle Apps will automatically assign a concurrent manager for this request. Once successful the function will return the request ID, otherwise it will return 0.

arguments (from source code)

application    - Short name of application under which the program is registered
program        - concurrent program name for which the request has to be submitted (short name)
description    - (optional) Will be displayed along with user concurrent program name
start_time    - (optional) Time at which the request has to start running
sub_request    - (optional) Set to TRUE if the request is submitted from another running request and has to be treated as a sub request. Default is FALSE
argument1..100    - (optional) Arguments for the concurrent request

After calling FND_REQUEST.SUBMIT_REQUEST, in case you want to wait for the sub request to be completed before proceeding with the rest of the PLSQL codes, you'll need to issue a COMMIT command and call FND_CONCURRENT.WAIT_FOR_REQUEST. Issuing COMMIT is required because during the process of submit request, records related to the request are inserted into relevant tables, which only becomes visible to the concurrent manager after the COMMIT. Otherwise, the concurrent manager will not be able to see the request and will not run it at all - which in effect FND_CONCURRENT.WAIT_FOR_REQUEST will keep on waiting for an nonexistent request and enter an endless loop.

arguments (from source code)

(IN) request_id    - Request ID to wait on
(IN) interval    - time between checks. Number of seconds to sleep (default 60 seconds)
(IN) max_wait    - Max amount of time to wait (in seconds) for request's completion
(OUT) phase         - Request phase (from meaning in fnd_lookups)
(OUT) status        - Request status(for display purposes)
(OUT) dev_phase    - Request phase as a constant string so that it can be used for comparisons
(OUT) dev_status    - Request status as a constatnt string
(OUT) message        - Completion message if request has completed

For instances you want to submit a request from OAF, you can utilize the oracle.apps.fnd.cp.request.ConcurrentRequest class and call its submitRequest method. It completely mirrors FND_REQUEST.SUBMIT_REQUEST arguments, the only thing is that you need to store the parameters inside a Vector (considering the PLSQL defaults the arguments to VARCHAR type, we could safely assume that the parameter Vector should contain String objects)

method signature

public int submitRequest(String ProgramApplication ,
                                      String ProgramName ,
                                      String ProgramDescription ,
                                      String StartTime,
                                      boolean SubRequest,
                                      Vector Parameters) throws RequestSubmissionException

(source)

Friday, May 20, 2011

ERRBUFF and RETCODE

hese are required parameters when you want to call a PLSQL procedure from Oracle Apps.

ERRBUF
varchar that holds error messages (I haven't tested this yet, but theoretically inside the program you must assign the error message string to this variable - being an IN OUT enables you modify this variable)

RETCODE
0 - success
1 - success with warnings
2 - with errors

Tuesday, May 17, 2011

Oracle Apps Concurrent Programs / Executable Table

Use this query (or parts of it) if you want to look for details regarding you concurrent programs. I find it tedious to use Oracle Apps interface =w=;;