Friday 27 December 2013

Host Concurrent Program check if file exists

Steps:
  • shell script is generally saved with ".sh". But here should be "prog" extension.
  • save the shell script with extension "prog". 
  • move this file to server.
  • place our script file in bin folder of any product top. 
  • create a soft link for this file by using ln command.
  • For example ln $FND_TOP/bin/fndcpesr <our script name without extension>

 

Create a .prog file in $XX_CUSTOM_TOP

echo "Start"
P_SOURCE_DIR=$5
P_FILENAME=$6
echo "File Path-->>" $P_SOURCE_DIR
echo "File Name-->>" $P_FILENAME
if [ ! -f $P_SOURCE_DIR/$P_FILENAME ]
then
    echo $P_SOURCE_DIR/$P_FILENAME " does not exist"
    echo "**************************************************" #>> $REPFILE
    echo "*$P_SOURCE_DIR/$P_FILENAME " does not exist" *" #>> $REPFILE
    echo "**************************************************" # >> $REPFILE
    PROBLEMS=1
    exit 1
else
    echo $P_SOURCE_DIR/$P_FILENAME " exist"
    exit 0
fi


Run below commands
------------------------

cd $XX_CUSTOM_TOP/bin
chmod 755 XX_FILE_CHECK.prog
$ dos2unix XX_FILE_CHECK.prog
$ ln -s $FND_TOP/bin/fndcpesr XX_FILE_CHECK


----------------------------

Create executable
Create Program.


How to Register a Host Concurrent Program in Applications

touch /u01/1153/visionappl/fnd/11.5.0/bin/TEST.txt
2. Register this as a concurrent executable in Application Object Library called TEST of type HOST.

3. Register this as a concurrent program in Application Object Library called TEST of type HOST.

4. Add this request to the System Administrators request group.

5. In the $FND_TOP/bin create the softlink from TEST.prog to fndcpesr:

        $ ln -s $FND_TOP/bin/fndcpesr  $FND_TOP/bin/TEST

6. IN $FND_TOP/bin type:
      TEST TEST.prog 
   The result will be a creation of a file called TEST.txt.

7. Delete the file TEST.txt: rm TEST.txt

8. Bounce the concurrent managers.

9. Test in Applications, by running TEST as a user with  the 'System Administrators' responsibility.

Friday 29 November 2013

Java Data Structure Examples

http://www.tutorialspoint.com/java/java_data_structures.htm

The data structures provided by the Java utility package are very powerful and perform a wide range of functions. These data structures consist of the following interface and classes:
  • Enumeration
  • BitSet
  • Vector
  • Stack
  • Dictionary
  • Hashtable
  • Properties

Thursday 28 November 2013

Using Lookups in OAF

Fetching values from Lookup


//returns lookup description
  public String getLookupDescription(String paramString1, String paramString2)
  {
    HashMap localHashMap = getLookupData(paramString1, paramString2);
    if (null != localHashMap) {
      return (String)localHashMap.get("DESCRIPTION");
    }
    return "";
  }

//returns lookup meaning
 public String getLookupMeaning(String paramString1, String paramString2)
 {
   HashMap localHashMap = getLookupData(paramString1, paramString2);
   if (null != localHashMap) {
     return (String)localHashMap.get("MEANING");
   }
   return "";
 }


//returns HashMap for meaning and Description

   public HashMap getLookupData(String paramString1, String paramString2)
   {
     if ((null == paramString1) || (null == paramString2)) {
       return null;
     }
     ViewObject localViewObject1 = findViewObject("LookupDataVO");
     if (null != localViewObject1) {
       localViewObject1.remove();
     }
     OADBTransactionImpl localOADBTransactionImpl = (OADBTransactionImpl)getOADBTransaction();
     String str1 = localOADBTransactionImpl.getCurrentLanguage();

     String str2 = "select meaning, description from fnd_lookup_values where lookup_type = :1 and lookup_code = :2 and language = :3 ";

   ViewObject localViewObject2 = createViewObjectFromQueryStmt("LookupDataVO", str2);
   localViewObject2.setWhereClauseParam(0, paramString1);
   localViewObject2.setWhereClauseParam(1, paramString2);
   localViewObject2.setWhereClauseParam(2, str1);

   Row localRow = localViewObject2.first();
   HashMap localHashMap = new HashMap();

   if (null != localRow)
   {
     localHashMap.put("MEANING", (String)localRow.getAttribute("MEANING"));
     localHashMap.put("DESCRIPTION", (String)localRow.getAttribute("DESCRIPTION"));
   }
   else
   {
     localHashMap.put("MEANING", "");
     localHashMap.put("DESCRIPTION", "");
   }
   localViewObject2.remove();
   return localHashMap;
 }

Wednesday 27 November 2013

wf_engine.completeactivity

CREATE PROCEDURE xx_continue_activity (
   errbuf            IN OUT NOCOPY   VARCHAR2,
   errcode           IN OUT NOCOPY   INTEGER,
   p_itemtype        IN              VARCHAR2,
   p_activity_name   IN              VARCHAR2
)
AS
   v_errorname      VARCHAR2 (30);
   v_errormsg       VARCHAR2 (2000);
   v_errorstack     VARCHAR2 (32000);
   invalid_action   EXCEPTION;
   PRAGMA EXCEPTION_INIT (invalid_action, -20002);

   CURSOR c1
   IS
      SELECT item_key
        FROM wf_item_activity_statuses
       WHERE item_type = p_itemtype
         AND activity_status = 'NOTIFIED'
         AND process_activity IN (
                SELECT MAX (instance_id)
                  FROM wf_process_activities
                 WHERE activity_item_type = p_itemtype
                   AND activity_name = p_activity_name);
--AND item_key = 1228692;
BEGIN
   FOR c1_rec IN c1
   LOOP
      BEGIN
         fnd_file.put_line (fnd_file.output,
                            'EXECUTING FOR ITEM-KEY: ' || c1_rec.item_key
                           );
         wf_engine.completeactivity (itemtype      => p_itemtype,
                                     itemkey       => c1_rec.item_key,
                                     activity      => p_activity_name,
                                     --'xx_INSUFF_RESPON_BLOCK',
                                     RESULT        => wf_engine.eng_null
                                    );
         COMMIT;
      EXCEPTION
         WHEN invalid_action
         THEN
            wf_core.get_error (v_errorname, v_errormsg, v_errorstack);
            fnd_file.put_line (fnd_file.LOG, 'ITEM-KEY: ' || c1_rec.item_key);
            fnd_file.put_line (fnd_file.LOG, 'ERROR NAME: ' || v_errorname);
            fnd_file.put_line (fnd_file.LOG, 'ERROR MESSAGE: ' || v_errormsg);
            fnd_file.put_line (fnd_file.LOG, 'ERROR STACK: ' || v_errorstack);
      END;
   END LOOP;
END xx_continue_activity;

Thursday 19 September 2013

Apache Bounce

Use below commands 

2) cd $ADMIN_SCRIPTS_HOME
3) adapcctl.sh stop
4) adoacorectl.sh stop
5) adapcctl.sh start
6) adoacorectl.sh start

Friday 17 May 2013

WF: Notification Reassign Mode


WF: Notification Reassign Mode

The WF: Notification Reassign Mode profile option determines the forwarding functionality that is available to employees. If you set the WF: Notification Reassign Mode profile option to Reassign, employees see the Reassign button on the notification. Clicking Reassign lets employees choose between transferring or delegating that notification. 

If you set the WF: Notification Reassign Mode profile option to Delegate, employees will see the Delegate button. When employees click Delegate and enter an employee name, the notification is delegated to the employee whose name is entered.

When a notification is delegated to employees the notification is forwarded to the delegated employee, but the original recipient of the notification remains the owner. 

If you set this option to Transfer, employees will see the Transfer button. When employees click Transfer and enter an employee name the notification is transferred to the whose name is entered. 

When a notification is transferred, the notification is forwarded and the new recipient becomes the owner of the notification.

Note: Assign the WF: Notification Reassign Mode profile option to the workflow responsibility.

Thursday 25 April 2013

Oracle Workflow - Standard Concurrent Manager Activities


Oracle Workflow - Standard Concurrent Manager Activities

Oracle workflow provides some standard activities for invoking concurrent programs from workflow. The follow gives a sneak peak into the features related to this.


  • Execute Concurrent Program Activity -> Calls FND_WF_STANDARD.EXECUTECONCPROGRAM
    • It submits an Oracle Applications concurrent program from your workflow process and waits for it to complete
  • Submit Concurrent Program Activity -> Calls FND_WF_STANDARD.SUBMITCONCPROGRAM
    • It submits an Oracle Applications concurrent program from your workflow process, but does not wait for it to execute or complete.
  • Wait for Concurrent Program Activity -> Calls FND_WF_STANDARD.WAITFORCONCPROGRAM
    • If you submit a concurrent program from your workflow process, you can use the Wait for Concurrent Program activity as a means of blocking the process from further execution until the concurrent program completes.


Wednesday 24 April 2013

Oracle Alert


Oracle Alert

1. What are the event alerts?
Triggered off when a particular event occurs in the Database.
Event can be Insert or Update.

2. What are Alert Action Level?
There are two levels of actions that can be performed
Detail Action and Summary Action.

3. What is a Summary Threshold?
Oracle Alerts automatically determine whether to perform a detail action or Summary action based on the number of exceptions in the database.

4. What are the different actions that can be performed in Alerts?
• Message Actions
• Concurrent Program Actions
• Operating Script Actions
• SQL Statement Script Actions

5. What are the steps involved in Creating Periodic alerts?
• Write a select statement
• Verify and Run the SQL
• Specify Alert Inputs
• Define Alert Outputs
• Create Periodic alert actions
• Define Periodic alert message actions
• Create a periodic alert action set
• Check your periodic alert.

6. What is the Distribution List in Alerts?
A Pre-defined set of electronic mail ids and printer Instructions that you can use on message actions instead of re-entering all the recipient names each time.

7. What are the Advance features available in alerts?
• Distribution List
• Periodic sets
• Summary Thresholds
• Action Set Checks

8. What are the four implicit Inputs in Alerts?
Mailid, rowid, org_id, date_last_checked

Workflow-2


Part-2

Oracle Workflows interview Questions
·                  Workflow processes represent business process flows and information routing.

·                  Each workflow process consists of a set of activities and transitions.

·                  Activities can be process activities, notification activities, and function activities.

·                  The business process flow in Oracle Workflow can have decision points (branches), parallel flows, and loops.


·                  The Workflow Builder is a graphical interface for diagramming the workflow process.

·                  The Workflow Engine enforces and executes the workflow process and drives items through the workflow processes.

·                  The Workflow Monitor displays any instances/items and their status within a workflow process.

·                  The Workflow Definitions Loader loads the workflow definition from a flat file or from another database.

·                  Workflow Directory Services obtains the email addresses for roles from the directory repository.

·                  The Notification System sends out messages and solicits responses.

·                  The Workflow Engine is a PL/SQL program that resides on the server and drives items through workflow processes defined in Oracle Workflow.

·                  Each item has a set of attributed values that contains information about the specific item. Each one of these items, with its own set of attribute values in the middle of the workflow process, is referred to as one instance of the workflow process.

·                  Valid states of an activity are Active, Complete, Deferred, Error, Notified, Suspended, and Waiting.

·                  If the state is Error, the changes will roll back to the last savepoint and the error-handling process will be initiated.

·                  Active activities are deferred to the background Workflow Engine if the operating cost is higher than the threshold specified in the Workflow Engine.

·                  If an activity is completed, the Workflow Engine will issue a savepoint and the activities that depend on the completed activity will be set to Active, if appropriate.

·                  If Loop Reset is on and the Workflow Engine comes to an activity that has been executed, then all of the activities will be reversed; otherwise, the transition will be ignored.

·                  Workflow Engine APIs are found in the WF_ENGINE package.

·                  The CreateProcess API creates a new runtime process for an item of an instance.

·                  The StartProcess API begins execution of the workflow process.

·                  The CompleteActivity API notifies the Workflow Engine that an activity has been completed for an item.

·                  GetItemAttrInfo obtains type information about an item attribute.

·                  Oracle Workflow obtains information about a role from three views: WF_USERS, WF_ROLES, and WF_USER_ROLES.

·                  Groups of users, as well as individual users, are assigned to roles.

·                  The Email field in WF_ROLES is used if Expand Role is not checked; otherwise, the Email field of the users in the role will be used.

·                  To add more roles and users, you can use the three local tables: WF_LOCAL_USERS, WF_LOCAL_ROLES, and WF_LOCAL_USER_ROLES.

·                  An item type consists of six components/objects: attributes, processes, notifications, functions, messages, and lookup types.

·                  The internal name of Workflow Builder components must be unique, typed in uppercase, and should not contain spaces.

·                  If there is more than one process attached to an item type, a selector is needed to select the correct process.

·                  Each notification activity must have an attached message.

·                  A message can have its own attributes, and a respond attribute will solicit users to select a valid respond value.

·                  You can attach a time-out to the notification activity. If time passes and a response is not received within the specified time, a <Timeout> transition will be executed.

·                  Lookup types are used to define lists of lookup codes. Result types must be lookup types.

·                  To monitor workflow and to view its progress, you can use either the Workflow Status form in Oracle Applications or the Java-based Workflow Monitor tool.

·                  There are two modes for both forms: ADMIN and USER.

·                  To diagram a workflow process, drag and drop activities into the Process window and draw lines between them by holding down the right mouse button.

·                  Fill in the performer for a notification activity.

·                  The Continue Flow function and Wait for Flow function work together to coordinate the master/detail process flow.

·                  The Oracle Applications Implementation Wizard—wizard for short—is a module in Oracle Applications that guides you through the setup steps of Oracle Applications.

·                  The Oracle Applications Implementation Method (AIM) is a methodology that guides you through every phase of the implementation process and is complemented by the Implementation Wizard.

·                  The process hierarchy ensures that the common setups are finished before the specific setups.

·                  Primary processes are common processes that span the entire application, requiring setup steps that cross multiple modules across the financial, distribution, and manufacturing product families.

·                  Secondary processes are common processes that cross modules within the product family.

·                  Final processes are processes that are specific to an individual module and have no cross-module dependencies. Enter the context for setup steps that are dependent on organization context. Organization contexts are Business Group, Set of Books, Operating Unit, and Inventory Organization. Start the implementation process by launching it through the Implementation Wizard form.

·                  If you are assigned a setup step through the wizard, you will receive notification through Workflow, and you can see the notification in the Notifications Summary form.

·                  You can complete the setup and respond with a Done result.

·                  You can respond with a Skipped result and ask the wizard to skip the setup steps.

·                  You can reassign the setup steps to another role.

·                  You can run the wizard installation process to ensure that the wizard is installed correctly.
1.      When will an activity be deferred?
A.       Activity cost = 0
B.       Activity cost < Workflow Engine threshold
C.       Activity cost > Workflow Engine threshold
2.      What is the primary purpose of a workflow?
A.       Routes information
B.       Sends notifications
C.       Creates audit trails
D        Defines process rules
3.      What job does the SetItemUserKey API perform?
A.       Sets the unique identifier for an item
B.       Sets the role to be notified
C.       Sets the user-friendly identifier for an item
D.       Sets the activity ID for an item
4.      How will you define the possible results of an activity in order to drive different transitions?
A.       As item attributes for an item
B.       As lookup codes for a lookup type
C.       Separate the activity into two
D.       Use a process activity
5.      Time-out parameters apply to which activity?
A.       Function
B.       Process
C.       Notification
D.       All of the above
6.      What will solicit responses from a notification activity?
A.       Having a time-out parameter
B.       Having a performer
C.       Having a Send message attribute
D.       Having a Respond message attribute
7.      Which Work Engine API should you use to begin execution of an activity?
A.       CreateProcess
B.       StartProcess
C.       ResumeProcess
D.       BeginActivity
8.      Which implementation process group comes before the product family processes?
A.       Common application processes
B.       Product family processes
C.       Product-specific processes
D        Common financial
9.      What is the proper format for an internal name in the Workflow Builder component?
A.       Uppercase
B.       No spaces
C.       Unique within item type
D.       All of the above
10.  Which of the following statements is true?
A.       Role can be created in Workflow Builder.
B.       A user is a role if it has at least one active responsibility.
C.       A role can only have one user.
D.       A user must be a role.
11.  Which component in Oracle Workflow is the graphical interface for workflow processes?
A. Workflow Builder
B.       Workflow Engine
C.       Workflow Monitor
D.       Workflow Definitions Loader
12.  When do you need a selector for an item type?
A.       When you must perform role resolution
B.       When performing a voting activity
C.       When more than one process is associated with an item type
D.       When multiple result codes are possible
13.  What does the Workflow Engine do when a function activity has finished?
A.       Issue a savepoint
B.       Issue a commit
C.       Generate a log file
D.       Notify the user

Answer to the above Questions
1.      C. Activity cost > Workflow Engine threshold
Explanation An activity is deferred when the activity cost is greater than the Workflow Engine threshold. If the activity cost = 0 or if the activity cost is less than the Workflow Engine threshold, the activity will become Active.

2.      A., B., D. Routes information, Sends notifications, Defines process rules
Explanation The primary purposes of a workflow are to route information, send notification, and define process rule. Although some history is maintained automatically by Oracle Workflow, it will not be considered as creating audit trails.

3.      C. Set the user-friendly identifier for an item
Explanation The SetItemUserKey API is used for setting a user-friendly identifier for an item.

4.      B. As lookup codes for a lookup type
Explanation You define the possible results of an activity to drive different transitions using lookup codes for a lookup type. You cannot use item attributes. Separating the activity into two does not make sense since you want to drive two transactions with the same activity, but with two result codes. A process activity will not help in this scenario.

5.      C. Notification
Explanation A time-out parameter only applies to a notification activity since the time-out parameters are used to measure when a notification expires. It does not apply to a function activity or a process activity.

6.      D. Having a Respond message attribute
Explanation Having a Respond message attribute will solicit responses from a notification activity. The display name will become the prompt and the description will be the instruction. Nothing else, such as a time-out parameter, a performer, or a Send message attribute, will have 
an affect in soliciting responses.

7.      B. StartProcess
Explanation The StartProcess API begins the execution of an activity. The CreateProcess API creates a new runtime process for an item. The ResumeProcess API resumes a suspended item. The BeginActivity determines if the specified activity may currently be performed on the item.

8.      A. Common application processes
Explanation Common application processes come before the product family processes, which come before product-specific processes. Common financial is one of the product family processes. It does not come before product family processes.

9.      D. All of the above
Explanation An internal name for a Workflow Builder component must be in uppercase, have no spaces, and be unique within item type.

10.  D. A user must be a role.
Explanation A user must be a role. A role cannot be created in the Workflow Builder. Having one active responsibility is not a requirement for a user to be a role. A role can have more than one user.

11.  A. Workflow Builder
Explanation The Workflow Builder in Oracle Workflow is the graphical interface for workflow processes. The Workflow Engine drives items through workflow processes. The Workflow Monitor allows you to view and monitor workflow process instances and the Workflow Definitions Loader loads workflow definitions from a text file or database.

12.  C. More than one process associated with an item type
Explanation When you have more than one process associated with an item type, you need a selector to select a process. You use the Role Resolution standard activity to perform role resolution. Voting is another standard activity. Multiple result codes drive different transitions, but this is not related to the selector.

13.  A. Issue a savepoint
Explanation The Workflow Engine issues a savepoint when a function activity is completed. The Workflow Engine never issues a commit; the calling application issues a commit. The Workflow Engine does not generate a log file or notify users.