Start a Flow (Workflow) by PLSQL OC Approval

Este forum é destinado a perguntas relacionadas a Oracle, mas que não se enquadram nos forums acima. Aqui serão tratadas também sobre outras tecnologias da oracle, como o Workflow, BPEL, Spatial, OCS, etc.
Post Reply
LordElfo
Rank: Analista Pleno
Rank: Analista Pleno
Posts: 111
Joined: Thu, 22 Feb 2007 2:34 pm
Location: DF
________________
http://lordelfo.blogspot.com
Thiago Façanha

Guys.
I am having difficulty starting the purchase order approval stream by PLSQL.
The command is able to start the flow but I can not end it.

When I click on "activity history" it shows the status "awaiting concurrent program".
I'vê ramed the concurrent "Background" anyway nothing.
If I send detail to the information below




When I will look at the details appears "PDF error of the SYSTEM COULD NOT GENERATE AND / Or Communicate at Least One of the Documents to the Supplier or The Approver. Please contact the System Administrator. "

Below is the procedure I am using .... I tried to call both the Core flow "POAPPRV" as the customized company.

Select all

 PROCEDURE start_approval_wf(p_document_id NUMBER /* 
                                                           ,p_document_type_code VARCHAR2 
                                                           ,p_document_subtype   VARCHAR2 
                                                           ,p_user_id            NUMBER 
                                                           ,p_resp_id            NUMBER 
                                                           ,p_resp_appl_id       NUMBER 
                                                           ,p_note               VARCHAR2*/) IS 
    --pragma autonomous_transaction; 
   
    l_vitemkey         VARCHAR2(100); 
    l_seq_for_item_key VARCHAR2(20); 
   
  BEGIN 
   
    fnd_client_info.set_org_context('108'); 
    fnd_global.apps_initialize(1126, 50326, 178); 
    --p_user_id, p_resp_id, p_resp_appl_id); 
   
    BEGIN 
      SELECT to_char(po_wf_itemkey_s.NEXTVAL) INTO l_seq_for_item_key FROM sys.dual; 
    EXCEPTION 
      WHEN OTHERS THEN 
        dbms_output.put_line('ERRO select to_char(PO_WF_ITEMKEY_S.NEXTVAL) ' || SQLERRM); 
    END; 
    l_vitemkey := to_char(p_document_id) || '-' || l_seq_for_item_key; 
   
    po_reqapproval_init1.start_wf_process(itemtype               => 'MQSAPO', -- POAPPRV 
                                          itemkey                => l_vitemkey, -- null 
                                          workflowprocess        => NULL, 
                                          actionoriginatedfrom   => NULL, 
                                          documentid             => p_document_id --p_document_id --v_doc_id 
                                         , 
                                          documentnumber         => NULL, 
                                          preparerid             => 1126, --fnd_global.employee_id, 
                                          documenttypecode       => 'RELEASE' --v_header_interface.document_type_code 
                                         , 
                                          documentsubtype        => 'BLANKET' --v_header_interface.document_subtype 
                                         , 
                                          submitteraction        => 'APPROVE', 
                                          forwardtoid            => NULL, 
                                          forwardfromid          => NULL, 
                                          defaultapprovalpathid  => NULL, 
                                          note                   => 'Teste de WF Acordo de compra. 01' || 
                                                                    p_document_id, 
                                          printflag              => 'N', 
                                          faxflag                => 'N', 
                                          faxnumber              => 'N', 
                                          emailflag              => 'N', 
                                          emailaddress           => NULL, 
                                          createsourcingrule     => 'N', 
                                          updatesourcingrule     => 'N', 
                                          releasegenmethod       => NULL, 
                                          massupdatereleases     => 'N', 
                                          retroactivepricechange => 'N', 
                                          orgassignchange        => NULL, 
                                          communicatepricechange => 'Y'); 
   
    --commit; 
  EXCEPTION 
    WHEN OTHERS THEN 
      raise_application_error(-20000, 'ERRO AO INICIAR WF DE APROVAÇÃO: ' || SQLERRM); 
  END;
LordElfo
Rank: Analista Pleno
Rank: Analista Pleno
Posts: 111
Joined: Thu, 22 Feb 2007 2:34 pm
Location: DF
________________
http://lordelfo.blogspot.com
Thiago Façanha

Hello people.
I got here.

A consultant here from the company was able to solve the problem.
At the time of using the user_id I was passing the employeeid

follows shape that solved ..

Select all

    fnd_global.apps_initialize(fnd_global.user_id, fnd_global.resp_id, fnd_global.resp_appl_id);
User avatar
Porva
Rank: DBA Sênior
Rank: DBA Sênior
Posts: 342
Joined: Mon, 29 Jan 2007 7:36 am
Location: São Paulo/SP
Rafael S. Nunes
São Paulo/SP

Lord, how are you?

Dude, can you help me?

We have the following problem: Approval notifications are sent to approval users, but for some reason the guy does not approve or does not see the e-mail, or forgets to approve, anyway. .

What I need to do is a routine that checks the notifications that have been sent to more than 1 day and have no return and reenvie [/ u] again for users (the idea It would be "schedular" this in a concurrent to run daily),

commented that WF Core itself should do this when it rolls timeout and such, however I have two problems:

1º - I do not have experience with WF to move directly on it
2º - The company requested preferably that I investigated a solution without having to move in WF

then I ask, it is possible to make a customization via pl / sql to meet this need, this your example would be a starting point or the solution itself?!?!?!?

Thanks
User avatar
Porva
Rank: DBA Sênior
Rank: DBA Sênior
Posts: 342
Joined: Mon, 29 Jan 2007 7:36 am
Location: São Paulo/SP
Rafael S. Nunes
São Paulo/SP

Application version:

Select all

Aplicativos Oracle: 11.5.10.2
vindalencio
Rank: Analista Sênior
Rank: Analista Sênior
Posts: 140
Joined: Thu, 16 Feb 2006 9:42 am
Location: Curitiba
Vanderlei Indalencio

Friend, can you help me ???
We are with problems in the email that is sent to the supplier ...
In the supplier's registration is an email ...
But the notification is going to another ...
know where the wf takes this ???
Post Reply
  • Information
  • Who is online

    Users browsing this forum: No registered users and 7 guests