0 Replies Latest reply: Jul 8, 2013 5:02 PM by 761975 RSS

    multiple blob attachments pdf for workflow

    761975

      Hi,

       

      Can anyone help to get this multiple blob attachments for workflow??

      I try to use this attach procedure:

       

      PROCEDURE xx_notif_attach_procedure
        (
          document_id   IN VARCHAR2
         ,display_type  IN VARCHAR2
         ,document      IN OUT BLOB
         ,document_type IN OUT VARCHAR2
        ) IS
       
          lob_id       NUMBER;
          bdoc         BLOB;
          content_type VARCHAR2(100);
          filename     VARCHAR2(300);
          l_temp_blob           BLOB;

        BEGIN
         -- set_debug_context('xx_notif_attach_procedure');
          lob_id := to_number(document_id);   
         
       
          -- Obtain the BLOB version of the document  
           dbms_lob.CreateTemporary(bdoc, FALSE, DBMS_LOB.Session);

         BEGIN
          select
                 c.file_name
                ,c.file_content_type
                ,c.file_data         
           INTO  filename
                ,content_type
                ,bdoc    
           from  fnd_lobs c
           where 1=1
                --and a.creation_date > sysdate -2
                and c.file_id = lob_id;
         EXCEPTION
           WHEN OTHERS THEN
           NULL;
         END;      
         
          document_type := content_type || ';name=' || filename;
         
         
          dbms_output.put_line(document_type);
          DBMS_LOB.createtemporary (document, CACHE => FALSE);
          dbms_lob.copy(document, bdoc, dbms_lob.getlength(bdoc));
         
        EXCEPTION
          WHEN OTHERS THEN
           -- debug('ERROR ^^^^0018 ' || SQLERRM);
            wf_core.CONTEXT('xxxx_po_wf_training_pkg'
                           ,'xx_notif_attach_procedure'
                           ,document_id
                           ,display_type);
        RAISE;

      END;

       

       

      And in the initiating workflow package I'm setting attributes:

       

      xxxx_po_wf_training_pkg.check_attachments(p_contract_id => l_po_id,

                                                      p_attach1 => l_attach1,

                                                      p_attach2 => l_attach2,

                                                      p_attach3 => l_attach3,

                                                      p_attach4 => l_attach4,

                                                      p_attach5 => l_attach5,

                                                      p_attach6 => l_attach6);

                                                     

                                                

           

            IF l_attach1 IS NOT NULL THEN     

                                        

            wf_engine.setitemattrdocument (itemtype  => l_itemtype,

                                           itemkey   => l_itemkey,

                                           aname     => 'ATTACHMENTS1',

                                           documentid =>'PLSQLBLOB:xxxx_po_wf_training_pkg.xx_notif_attach_procedure/'||to_char(l_attach1));

            END IF;     

           

                                                         

           

            IF l_attach2 IS NOT NULL THEN          

           

           

            wf_engine.setitemattrdocument (itemtype  => l_itemtype,

                                           itemkey   => l_itemkey,

                                           aname     => 'ATTACHMENTS2',

                                           documentid =>'PLSQLBLOB:xxxx_po_wf_training_pkg.xx_notif_attach_procedure/'||to_char(l_attach2));

            END IF;

       

      These attributes dragged to message with document type and full windows (contents checked).

      I'm unable to get multiple attachments by this method..instead receiving error.

      Please advise.

      thanks