Skip to main content
Solved

Create records (custom LU) from XML File Reader


Forum|alt.badge.img+6

I am stumped.

 

Can someone help or point me where to figure out how I can drop a file into the file reader, read it in, and create a new record in a custom logic unit?

I know I could do this with existing LUs using BizAPI but the LU I’m using is custom and has no BizAPI for it.

Best answer by NSRJMITCHELL

I ended up creating a custom PL/SQL package function that accepts a clob and extracts the values using a cursor. I then iterate over the cursor and insert the values into the custom table. I call this custom function from a Routing Rule and Routing Address when the file is read in.

View original
Did this topic help you find an answer to your question?
This topic has been closed for replies.

5 replies

Forum|alt.badge.img+6
  • Author
  • Do Gooder (Customer)
  • 17 replies
  • Answer
  • May 18, 2021

I ended up creating a custom PL/SQL package function that accepts a clob and extracts the values using a cursor. I then iterate over the cursor and insert the values into the custom table. I call this custom function from a Routing Rule and Routing Address when the file is read in.


Forum|alt.badge.img+11
  • Hero (Customer)
  • 148 replies
  • May 18, 2021

@NSRJMITCHELL are you able to share screen images of your routing rule and routing address? i am interested in this side of IFS but have no experience, anything like this i find helpful and interesting.


Forum|alt.badge.img+6
  • Author
  • Do Gooder (Customer)
  • 17 replies
  • May 19, 2021

Sure! 

 

This is the function I wrote in PL/SQL and the Routing Rule, Routing Address, and Presentation Objects are all attached.

 

Hopefully that helps!

1FUNCTION Receive_EDI_Acknowledgements(doc_ IN CLOB) RETURN CLOB IS
2
3 PROCEDURE Core(doc_ IN CLOB) IS
4 CURSOR ACKS IS
5 SELECT EXTRACTVALUE(COLUMN_VALUE, '/DocumentAck/AckStatusNotes') as NOTES,
6 EXTRACTVALUE(COLUMN_VALUE, '/DocumentAck/AckStatus') as STATUS,
7 TO_DATE(EXTRACTVALUE(COLUMN_VALUE, '/DocumentAck/Date'),
8 'YYMMDDHH24:MI:SS') as REC_DATE,
9 EXTRACTVALUE(COLUMN_VALUE, '/DocumentAck/DocumentNumber') as DOCUMENT_NUMBER,
10 EXTRACTVALUE(COLUMN_VALUE, '/DocumentAck/DocumentType') as DOCUMENT_TYPE
11 FROM TABLE(XMLSEQUENCE(XMLTYPE(doc_).EXTRACT('/OUTPUT/*'))) t;
12 BEGIN
13 FOR ack_row IN ACKS LOOP
14 INSERT INTO EDI_ACKNOWLEDGEMENT_CLT
15 (CF$_ACK_NOTES,
16 CF$_ACK_STATUS,
17 CF$_DATE,
18 CF$_DOCUMENT_NUMBER,
19 CF$_DOCUMENT_TYPE,
20 ROWVERSION)
21 VALUES
22 (ack_row.NOTES,
23 ack_row.STATUS,
24 ack_row.REC_DATE,
25 ack_row.DOCUMENT_NUMBER,
26 ack_row.DOCUMENT_TYPE,
27 SYSDATE);
28 END LOOP;
29 COMMIT;
30 END Core;
31 BEGIN
32 Core(doc_);
33
34 RETURN NULL;
35 END Receive_EDI_Acknowledgements;

 


Forum|alt.badge.img+11
  • Hero (Customer)
  • 148 replies
  • May 28, 2021

@NSRJMITCHELL thank you so much for sharing! love the Black IFS… how’d you do that?


Forum|alt.badge.img+6
  • Author
  • Do Gooder (Customer)
  • 17 replies
  • June 23, 2021
david.harmer wrote:

@NSRJMITCHELL thank you so much for sharing! love the Black IFS… how’d you do that?

Using the “Graphite” theme that comes with IFS


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