Sunday, September 20, 2015

How to progress Errored workflow using back end api

DECLARE
   CURSOR c1
   IS
     SELECT c.INSTANCE_LABEL,a.line_id
        FROM oe_order_lines_all a,
        apps.wf_item_activity_statuses b,
        apps.wf_process_activities c
       WHERE header_id = 602953547
       and b.item_key = to_char(a.line_id)
       and b.item_type ='OEOL'
       and b.activity_status='ERROR'
       and b.process_activity = c.instance_id;

BEGIN
   FOR c1_rec IN c1
   LOOP
      wf_engine.handleerror (
         'OEOL',
         TO_CHAR (c1_rec.line_id),
         C1_REC.INSTANCE_LABEL,
         'RETRY',
         NULL
      );
   END LOOP;
   commit;
EXCEPTION
   WHEN OTHERS
   THEN
      DBMS_OUTPUT.put_line (SQLERRM);
END;

Wednesday, July 22, 2015

How to release the Hold automatically when it reaches the hold until date

If any of the user enters the Hold Until date while applying the Hold then the hold should be released automatically when it reaches to the Hold Until Date. 

The below concurrent program should be scheduled based on the requirement. So that the program will check are there any holds which are reached hold until date and ready to release the holds. 

Concurrent Program Name : Release Expired Hold

Friday, March 13, 2015

How to raise business event manually using script

DECLARE
   l_event_name             VARCHAR2 (240)
                                  := 'oracle.apps.ont.genesis.outbound.update';
   l_event_parameter_list   wf_parameter_list_t := wf_parameter_list_t ();

BEGIN
      wf_event.addparametertolist (
         p_name=> 'HEADER_ID',
         p_value=> '96567456745',
         p_parameterlist=> l_event_parameter_list
      );
      wf_event.addparametertolist (
         p_name=> 'LINE_ID',
         p_value=> '865875768',
         p_parameterlist=> l_event_parameter_list
      );
      wf_event.addparametertolist (
         p_name=> 'HOLD_SOURCE_ID',
         p_value=>'54326456',
         p_parameterlist=> l_event_parameter_list
      );
      wf_event.addparametertolist (
         p_name=> 'CHANGE_TYPE',
         p_value=> 'APPLY',
         p_parameterlist=> l_event_parameter_list
      );

      BEGIN
         wf_event.RAISE (
            p_event_name=> l_event_name,
            p_event_key=> SYS_GUID (),
            p_parameters=> l_event_parameter_list
         );
      EXCEPTION
         WHEN OTHERS
         THEN
            DBMS_OUTPUT.put_line (
                  ' Unexpected Error  : '
               || SUBSTR (SQLERRM, 1, 250)
            );
      END;


   COMMIT;
   l_event_parameter_list.DELETE;
EXCEPTION
   WHEN OTHERS
   THEN
      DBMS_OUTPUT.put_line (
            ' Unexpected Error in main  block  : '
         || SUBSTR (SQLERRM, 1, 250)
      );
END;

Thursday, January 8, 2015

Concurrent Request Status Codes

Concurrent Request Status Codes:

SELECT LOOKUP_CODE STATUS_CODE, MEANING
 FROM FND_LOOKUP_VALUES
 WHERE LOOKUP_TYPE = 
'CP_STATUS_CODE'
   AND ENABLED_FLAG = 
'Y'
   AND VIEW_APPLICATION_ID = 
0
ORDER BY LOOKUP_CODE;

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

Concurrent Request Phase Codes:

SELECT LOOKUP_CODE PHASE_CODE, MEANING
 FROM FND_LOOKUP_VALUES
 WHERE LOOKUP_TYPE = 
'CP_PHASE_CODE'
   AND ENABLED_FLAG = 
'Y'
   AND VIEW_APPLICATION_ID = 
0
ORDER BY PHASE_CODE;

STATUS_CODE
MEANING
C
Completed
I
Inactive
P
Pending
R
Running