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.