Skip to main content
Solved

Run custom event in specific queue

  • February 19, 2025
  • 3 replies
  • 107 views

Forum|alt.badge.img+3

Hello,

I have a custom event that is triggered when new transport task is created.
This event is run in background because when not I receive an error because I want to change a record that is still locked.
This works fine. Only when there are a lot of background jobs there is a delay and that cause problems.
To avoid those problems I want to place the background in a specifiek queue so it is executed straight away.
See below my current code.

Those any one has a solution for that?

 

DECLARE
   attr_                VARCHAR2(32000);
   sql_msg_             VARCHAR2(32000);
   stmt_                VARCHAR2(32000);
BEGIN
      stmt_ :=
      'DECLARE
          info_ VARCHAR2(32000);
          objid1__ VARCHAR2(2000);
          objversion2__  varchar2(300);
          attr_ VARCHAR2(32000);
          row_key_   VARCHAR2(32000):=''&NEW:ROWKEY'';
          transport_task_   VARCHAR2(32000):=''&NEW:TRANSPORT_TASK_ID'';
         CURSOR get_objid IS
           SELECT OBJID, OBJVERSION
           from ifsapp.TRANSPORT_TASK
           WHERE ifsapp.TRANSPORT_TASK.OBJKEY =row_key_;
           
       BEGIN     
        FOR REC_ IN get_objid LOOP
            objid1__  := REC_.OBJID;
            objversion2__  := REC_.OBJVERSION ;
            Client_SYS.clear_attr(attr_);
            Client_SYS.add_to_attr(''FIXED_DB'',''TRUE'', attr_);
            ifsapp.TRANSPORT_TASK_API.Modify__(info_, objid1__, objversion2__, attr_, ''DO'');
            COMMIT;
        END LOOP;
       END;';

      sql_msg_ := Message_SYS.Construct('RELEASE');
      Message_SYS.Add_Attribute(sql_msg_, 'SQL', stmt_);

      Client_SYS.Clear_Attr(attr_);
      Client_SYS.Add_To_Attr('SQL_DATA_', sql_msg_, attr_);
      Client_SYS.Add_To_Attr('MSG_', '', attr_);

      Transaction_SYS.Deferred_Call('Fnd_Event_Action_API.Action_Executeonlinesql', 'PARAMETER', attr_,
      Language_SYS.Translate_Constant('Event', 'UPDREV: Transport task Fix' ));

END;

Best answer by Manulak

Hello ​@ZFTKMARTELE 

The procedure  Transaction_SYS.Deferred_Call itself contains a QUEUR_ID which is always defaulted to the default queue. You can provide the designated queue id as you wish.

Hope this helps

View original
Did this topic help you find an answer to your question?

3 replies

Manulak
Hero (Customer)
Forum|alt.badge.img+8
  • Hero (Customer)
  • 78 replies
  • Answer
  • February 19, 2025

Hello ​@ZFTKMARTELE 

The procedure  Transaction_SYS.Deferred_Call itself contains a QUEUR_ID which is always defaulted to the default queue. You can provide the designated queue id as you wish.

Hope this helps


Forum|alt.badge.img+3
  • Author
  • Do Gooder (Customer)
  • 6 replies
  • February 19, 2025
Manulak wrote:

Hello ​@ZFTKMARTELE 

The procedure  Transaction_SYS.Deferred_Call itself contains a QUEUR_ID which is always defaulted to the default queue. You can provide the designated queue id as you wish.

Hope this helps

Thanks for the quick response. I will tested on my AST environment tomorrow.
It will be like this I think, where x is my queue number
Client_SYS.Add_To_Attr('QUEUR_ID _', ‘x’, attr_);


Forum|alt.badge.img+3
  • Author
  • Do Gooder (Customer)
  • 6 replies
  • February 20, 2025
Manulak wrote:

Hello ​@ZFTKMARTELE 

The procedure  Transaction_SYS.Deferred_Call itself contains a QUEUR_ID which is always defaulted to the default queue. You can provide the designated queue id as you wish.

Hope this helps

I changed Transaction_sys.deferred call in to       Transaction_SYS.Deferred_Call('Fnd_Event_Action_API.Action_Executeonlinesql','PARAMETER',attr_,
      Language_SYS.Translate_Constant('Event', 'UPDREV: Transport task Fix' ),sysdate,'FALSE',12);

 

12 = Queue_id

For more info see
Deferred_Call


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings