OM: Good informational package in OM: OE_MSG_PUB

本文介绍了如何通过使用OE_MSG_PUB.ADD方法来增强Oracle E-Business Suite中订单导入程序的日志输出,使异常消息更加清晰易读,并探讨了其在约束处理、默认规则及工作流程序中的应用。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Last week I started to working on an order import pragram. A sample program in our live system does similar thing but it has no price adjustment etc. To have more information when importing the order, I tried the oe_debug_pub using following code:

 

        IF g_debug_flag = 'Y' THEN
          oe_debug_pub.initialize;
          oe_debug_pub.debug_on;
          l_debug_file := oe_debug_pub.set_debug_mode('CONC');
          oe_debug_pub.setdebuglevel(5);
          --wsh_util_core.Enable_Concurrent_Log_Print;
          --wsh_util_core.Set_Log_Level(4);
        END IF;
        

         process_order;

 

        IF g_debug_flag = 'Y' THEN
          l_msg_count := oe_debug_pub.countdebug;
          FOR i IN 1..l_msg_count LOOP
            oe_debug_pub.getnext(l_err_msg);
            log(l_err_msg);
          END LOOP;
        END IF;

 

 

But the output msg is really ugly and maybe only readable to Oracle Dev guys or support guys. After going through the code in OE_ORDER_PVT etc, I noticed when there are some validation exceptions, it will use OE_MSG_PUB.add like following:

 

FND_MESSAGE.SET_NAME('ONT','OE_API_INV_PARENT_INDEX');
FND_MESSAGE.SET_TOKEN('ENTITY_NAME','Header_Adj_Attribs');
FND_MESSAGE.SET_TOKEN('ENTITY_INDEX',I);
FND_MESSAGE.SET_TOKEN('PARENT_INDEX',p_x_header_adj_att_tbl(I).adj_index);
OE_MSG_PUB.Add;

This set the message and tokens in message, then it will add the message to OE_MSG_PUB message stack. So I tried to use following in my code:

 

        IF x_msg_count > 0 THEN
          FOR i IN 1..x_msg_count LOOP  --here x_msg_count  is the x_msg_count  in process_order api
            l_err_msg := oe_msg_pub.get(p_msg_index => i, p_encoded => 'F');
            log(l_err_msg);
          END LOOP;
        END IF;

Well, in my log file , it display neatly the exception message I want , just similar to those displayed in "Order Import Child Req1 (Order Import)" child request spawned by "Order Import" program. And most importantly, it's readable and user friendly.

 

Later, I remember that I used this in processing constraint API, defaulting rule  and workflow program to add msg into OM message stack and it can display message in custom API even in front end UI.

 

So to be informational in OM, never forget to use OE_MSG_PUB.ADDOrder Import

逐行解析一下这些打印XOS#2025/05/28 16:44:15 informational: WMAC_AC: Dis-assocation frame received from station with MAC address 92:aa:0e:84:c5:22 and reason code 3 2025/05/28 16:44:15 informational: WMAC_AC: Sending DEL-STA to AP 1 by CAPWAP with station MAC address 92:aa:0e:84:c5:22 BSSID 6c:ef:c6:65:ab:d1 2025/05/28 16:44:15 notifications: WMAC_AC: [IPC] Sending DELETE-STA to AP by CAPWAP with station MAC 92:aa:0e:84:c5:22. asso seq [0x1000] 2025/05/28 16:44:15 errors : WMAC_AC: Failed to notify L2F to delete sta with MAC address 92:aa:0e:84:c5:22 | vlan 1 | dynamic vlan -1. 2025/05/28 16:44:15 informational: WMAC_AC: STA 92:aa:0e:84:c5:22 - event 2 notification 2025/05/28 16:44:15 informational: WMAC_AC: Unauthorizing port for station 92:aa:0e:84:c5:22. 2025/05/28 16:44:15 informational: WMAC_AC: STA 92:aa:0e:84:c5:22 - MLME-DISASSOCIATE.indication(92:aa:0e:84:c5:22, 3) 2025/05/28 16:44:15 informational: WMAC_AC: Receiving authention frame from station 92:07:d3:da:91:62. 2025/05/28 16:44:15 informational: WMAC_AC: Receiving authention frame from station 92:07:d3:da:91:62 in bssid 6c:ef:c6:65:ab:d7. auth_alg 0, auth_transaction 1 2025/05/28 16:44:15 informational: WMAC_AC: Authentication OK (Open-System) with bssid 6c:ef:c6:65:ab:d7 . 2025/05/28 16:44:15 informational: WMAC_AC: Receiving association request from sta 92:07:d3:da:91:62 in bssid 6c:ef:c6:65:ab:d7 2025/05/28 16:44:15 warnings : WMAC_AC: IEEE 802.11 element parse ignored unknown element (id=191 elen=12) 2025/05/28 16:44:15 informational: WMAC_AC: Station association succeed with AID: 1, SSID: a-wangjian-portal, BSSID: 6c:ef:c6:65:ab:d7. 2025/05/28 16:44:15 informational: WMAC_AC: Vlan 1 station increasing, count 3. 2025/05/28 16:44:15 notifications: WMAC_AC: [IPC] Sending ADD-STATION to AP by CAPWAP with station MAC 92:07:d3:da:91:62, AID 1 and APID 1 RID 2. assoseq [0x1000] 2025/05/28 16:44:15 informational: APM: APM_Cloud_Server_Sendto(line:3313):send sta online 2025/05/28 16:44:15 informational: APM: APM_Cloud_Server_Sendto(line:3319):sta mac:92:07:d3:da:91:62 2025/05/28 16:44:15 informational: APM: APM_Cloud_Server_Sendto(line:3324):AP mac:6c:ef:c6:65:ab:c0 2025/05/28 16:44:15 errors : APM: APM_WmacSocket_Recv_Msg(line:975):!!! RECV MSG WMAC_GET_TRAFFIC_LIMIT, StaMac[92:07:d3:da:91:62] 2025/05/28 16:44:15 errors : APM: APM_SendStaTraffic(line:794):APM_SendStaTraffic uplimit 0, downlimit 0 2025/05/28 16:44:15 debugging : APM: APM_WMAC_SendStaTrafficLimit(line:1059):APM_WMAC_SendStaTrafficLimit success 2025/05/28 16:44:15 informational: APM: APM_DecMsgHead(line:71):MessageType 8 MessageLen 50 2025/05/28 16:44:15 informational: APM: APM_Recv_Pkt_Handle(line:3467):Recv MsgType: STA_AUTH_SUCCESS 2025/05/28 16:44:15 informational: APM: APM_DecPkt_Data(line:2970):store id :1 2025/05/28 16:44:15 informational: APM: APM_DecPkt_Data(line:2829):Sta mac:92:07:d3:da:91:62 2025/05/28 16:44:15 informational: APM: APM_DecPkt_Data(line:2708):AP mac:6c:ef:c6:65:ab:c0 2025/05/28 16:44:15 informational: APM: APM_DecPkt_Data(line:3061):usProfileId 2 2025/05/28 16:44:15 informational: APM: APM_DecPkt_Data(line:2855):STA pass time:586 2025/05/28 16:44:15 informational: APM: APM_DecPkt_Data(line:3206):APM Portal username:admin 2025/05/28 16:44:15 informational: APM: APM_RecvPktProcess(line:2509):[EasyPortal] user $MAC:92:7:d3:da:91:62 auth success, pass time is 600 s 2025/05/28 16:44:15 informational: APM: APM_AddUserNode(line:836):APM_AddUserNode:: User Node is exist (mac = 9207.d3da.9162) 2025/05/28 16:44:15 informational: APM: APM_AddUserNode(line:851):Create user Node timer 2025/05/28 16:44:15 errors : APM: APM_SendStaTraffic(line:794):APM_SendStaTraffic uplimit 0, downlimit 0 2025/05/28 16:44:15 debugging : APM: APM_WMAC_SendStaTrafficLimit(line:1059):APM_WMAC_SendStaTrafficLimit success 2025/05/28 16:44:15 informational: APM: APM_DecMsgHead(line:71):MessageType 25 MessageLen 54 2025/05/28 16:44:15 informational: APM: APM_Recv_Pkt_Handle(line:3467):Recv MsgType: User trafic limit 2025/05/28 16:44:15 informational: APM: APM_DecPkt_Data(line:2970):store id :1 2025/05/28 16:44:15 informational: APM: APM_DecPkt_Data(line:2829):Sta mac:92:07:d3:da:91:62 2025/05/28 16:44:15 informational: APM: APM_DecPkt_Data(line:2732):AP input limit:0 2025/05/28 16:44:15 informational: APM: APM_DecPkt_Data(line:2738):AP output limit:0 2025/05/28 16:44:15 informational: APM: APM_DecPkt_Data(line:2708):AP mac:6c:ef:c6:65:ab:c0 2025/05/28 16:44:15 debugging : APM: APM_SetStaTraffic(line:2399):STA[92:07:d3:da:91:62] inputlimit 0 outlimit 0 2025/05/28 16:44:15 informational: APM: APM_DecMsgHead(line:71):MessageType 7 MessageLen 53 2025/05/28 16:44:15 informational: APM: APM_Recv_Pkt_Handle(line:3467):Recv MsgType: STA_ONLINE_RESP 2025/05/28 16:44:15 informational: APM: APM_DecPkt_Data(line:2970):store id :1 2025/05/28 16:44:15 informational: APM: APM_DecPkt_Data(line:2829):Sta mac:92:07:d3:da:91:62 2025/05/28 16:44:15 informational: APM: APM_DecPkt_Data(line:2708):AP mac:6c:ef:c6:65:ab:c0 2025/05/28 16:44:15 informational: APM: APM_DecPkt_Data(line:2843):STA Privilege:0 2025/05/28 16:44:15 informational: APM: APM_DecPkt_Data(line:3061):usProfileId 2 2025/05/28 16:44:15 informational: APM: APM_DecPkt_Data(line:2849):STA Auth Mode:1 2025/05/28 16:44:15 informational: APM: APM_DecPkt_Data(line:2855):STA pass time:600 2025/05/28 16:44:15 informational: APM: APM_RecvPktProcess(line:2500):sta online response 2025/05/28 16:44:15 informational: APM: APM_UpdateUserNode(line:702):APM_AddUserNode:: User Node is exist (mac = 9207.d3da.9162) 2025/05/28 16:44:15 informational: APM: APM_UpdateUserNode(line:752):APM_AddUserNode:: Create user Node timer 2025/05/28 16:44:16 informational: WMAC_AC: STA 92:aa:0e:84:c5:22 - deauthenticated due to inactivity 2025/05/28 16:44:16 informational: WMAC_AC: STA 92:aa:0e:84:c5:22 - MLME-DEAUTHENTICATE.indication(92:aa:0e:84:c5:22, 2) 2025/05/28 16:44:16 informational: WMAC_AC: Trying to free station with MAC address 92:aa:0e:84:c5:22 and BSSID 6c:ef:c6:65:ab:d1. 2025/05/28 16:44:16 informational: WMAC_AC: Vlan 1 station degression, count 2. 2025/05/28 16:44:16 informational: WMAC_AC: Sending DEL-STA to AP 1 by CAPWAP with station MAC address 92:aa:0e:84:c5:22 BSSID 6c:ef:c6:65:ab:d1 2025/05/28 16:44:16 notifications: WMAC_AC: [IPC] Sending DELETE-STA to AP by CAPWAP with station MAC 92:aa:0e:84:c5:22. asso seq [0x1000] 2025/05/28 16:44:16 errors : WMAC_AC: Failed to notify L2F to delete sta with MAC address 92:aa:0e:84:c5:22 | vlan 1 | dynamic vlan -1.
最新发布
05-29
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值