Start OWB workflow from APEX

Hi together,
My challenge is to start an OWB workflow from an apex procedure.
Procedure:
declare
numb number;
audit_id number;
begin
numb := rtruser_blueprint.exec_api.execute('LOC_A014_OWF_MGR', 'PROCESS', 'LOAD_CALM_DELIVERY', ',', 'DELIVERY_ID_IN=6', audit_id);
end;
My problem is the following error:
ORA-06565: cannot execute SET ROLE from within stored procedure
This error occures at the following row in the execute-Procedure in the package exec_api (standard owb execution package):
dbms_session.SET_ROLE('OWB_D_rtr10201_blueprint');
dbms_session.SET_ROLE('OWB_O_rtr10201_blueprint');
If I run this script directly with sqlplus, the procedure works fine. As a result of this, I assume, the problem has to do with the grants which the apex execution user (APEX_PUBLIC_USER) doesn't have in contrast to the blueprint user (which is schema owner)
More informations about the environment setup:
The apex workspace is bound to the database - user: BLUEPRINT.
BLUEPRINT has the grant to execute the procedure 'EXECUTE' in the package 'EXEC_API'. The 'EXEC_API' package belongs to the user 'RTRUSER_BLUEPRINT'.
My concrete question is: Which rights / grants does which user need to execute the procedure directly from APEX?
Thanks for your help!
Mirco

What account were you using when you ran the 'execute_api' procedure from SqlPlus ? Also, all SQL and PL/SQL from APEX is executed as the application's parsing schema id and not the schema used by APEX to connect to the database.

Similar Messages

  • ** Start a workflow from BPM

    How do we start a workflow from BPM ? (For example, to send messages to that workfolw and receive messages like these purposes)
    Kind Regards,
    Jeg P.

    hi jeg.
    here some blogs and pdfs about BPM to understand how to use it
    /people/shabarish.vijayakumar/blog/2005/08/03/xpath-to-show-the-path-multiple-receivers
    http://help.sap.com/saphelp_nw04/helpdata/en/3c/831620a4f1044dba38b370f77835cc/content.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/62/dcef46dae42142911c8f14ca7a7c39/content.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/de/766840bf0cbf49e10000000a1550b0/content.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/cb/15163ff8519a06e10000000a114084/content.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/08/16163ff8519a06e10000000a114084/content.htm
    Many other examples can be found under the following link at help.sap.com
    http://help.sap.com/saphelp_nw04/helpdata/en/14/80243b4a66ae0ce10000000a11402f/frameset.htm
    And some weblogs
    https://weblogs.sdn.sap.com/pub/wlg/1403 [original link is broken] [original link is broken] [original link is broken]
    /people/siva.maranani/blog/2005/05/22/schedule-your-bpm *****
    /people/krishna.moorthyp/blog/2005/06/09/walkthrough-with-bpm
    /people/michal.krawczyk2/blog/2005/06/11/xi-how-to-retrieve-messageid-from-a-bpm
    /people/arpit.seth/blog/2005/06/27/rfc-scenario-using-bpm--starter-kit
    /people/sravya.talanki2/blog/2005/08/24/do-you-like-to-understand-147correlation148-in-xi
    /people/michal.krawczyk2/blog/2005/09/04/xi-do-you-realy-enjoy-clicking-and-waiting-while-tracing-bpm-steps *****
    Hope helps
    Rodrigo

  • Starting a workflow from an XML file

    Does anyone know if there is anyway to have a workflow poll a folder for the existence of an XML file and start a workflow with it? When looking in the documentation, there is a mention of a scheduler. I need to integrate with a fairly old system that can only read and write text files. Any help is appreciated.
    Dave

    Hi Dave
    This is actually quite easy to achieve. We use this design pattern regularly, and it works very nicely.
    Here are the steps:
    * Download and deploy the DocumentImport, FolderWatch and FileCopyMove QPACs from http://www.avoka.com/avoka/qpac_library.shtml
    * Create a workflow that is your "Watcher" process.
    Step 1 in this will use the FolderWatch to wait for a file in the designated folder, capturing its name when it appears.
    Step 2: use the FileCopyMove to move the found file to a "Processed" directory. (Click the current-date checkbox to include the current date as a sub-folder - very handy.) Moving the file ensures that it won't be reprocessed on the next iteration.
    Step 3: Use the Chain QPAC (or our ChainPlus) to start the real process, passing the name of the newly moved file as a parameter. Then, have this Workflow loop back to step 1.
    If you make this workflow asynchronous, then it will even survive server restarts, so no need to restart it each time. The Watcher workflow will create one "real" workflow for each file that arrives in the watched folder.
    * Create the real workflow. It should have one "in" variable that is the name of the file. Step1: Use the DocumentImport QPAC to import the file into a process variable. You mention XML, so import into an XML variable. If the file is a properties file, then we also do have a properties file import QPAC. You're done, you can do the real workflow now.
    If you have any problems with this, please let us know.
    Regards,
    Howard
    PS You should periodically stop and restart the watcher process. The reason for this is that you will get a LOT of entries in the audit trail for this process instance in adminui, and stopping and restarting keeps this to manageable numbers.

  • Start a Workflow from an incoming Internet message

    Hi All,
    I have a requirement , where I need to trigger a Workflow from incoming outlook email.The email will also have a PDF    attachment of Invoice which should get archived and other details should help to trigger the workflow.
    I checked in Inbound Distribution(SO28), but not sure how I could configure the same.
    Or Is there any other possibility that I could look for?
    Kindly give you inputs.
    Regards,
    Bhargavi Vaidya

    Hi,
    Kindly please check the transaction SO50.
    Also check the follwoing link, this might be helpful.
    /people/thomas.jung3/blog/2004/09/09/receiving-e-mail-and-processing-it-with-abap--version-610-and-higher
    Thanks andregards,
    SNJY

  • Starting existing workflow from web dynpro application (ABAP)

    Hi experts,
        I am working on web dynpro application from which when I click on a button an existing workflow should trigger. This will be used in portal replacing existing iview with jsp. I did lot of reading on SDN maybe too much that I am confused how to get started. Here is what I have currently.
    We have an existing workflow that sends an approval email to manager when ever some unit information changes. In current functionality, workflow is triggered by event which is linked to workflow in transaction "swetypv". We defined scenario in "qisrscenario" that contains all elements to populate workflow container. The methods to get data into workflow container, send email etc are all written in business object methods. We have a class that implements standard SAP BADI "IF_EX_QISR1"(IF_EX_QISR1~SCENARIO_PROCESS_USER_COMMAND method) that probably has all logic. In current functionality when the workflow gets created it sends notification number back to portal jsp page that triggered the workflow on button click. Users look at notification number in iqs23 for workflow log, PCR form data etc. and I need that functionality too. Now I am confused where I should start so that I can use ew web dynpro applciation instead of jsp iview but want all the functionality that we currently have. How can I start workflow and get notification number back to web dynpro so that I can display that to user? The approving manager goes to UWL to approve, reject the workitem and workflow then finishes.
    Any help will be greatly appreciated.
    Thanks.
    Mithun

    Hi.,
    Using FM  SAP_WAPI_CREATE_EVENT  You can Achieve this., try the below piece of code.,
    DATA: OBJECT_TYPE  TYPE  SWR_STRUCT-OBJECT_TYP VALUE 'ZBUS333',   " Enter Your Business Object here
    OBJECT_KEY  TYPE  SWR_STRUCT-OBJECT_KEY,
    EVENT TYPE  SWR_STRUCT-EVENT VALUE 'FIRE'.     " Enter Your Event here
       DATA: lt_cont TYPE STANDARD TABLE OF swr_cont,
             ls_cont TYPE swr_cont.
           ls_cont-element = 'NAME'.       " To Pass Values to business Object you append to container
           ls_cont-value   = lv_name.
           APPEND ls_cont to lt_cont.
           ls_cont-element = 'ID'.
           ls_cont-value   = lv_id.
           APPEND ls_cont to lt_cont.
          CALL FUNCTION 'SAP_WAPI_CREATE_EVENT'
            EXPORTING
              OBJECT_TYPE             = OBJECT_TYPE
              OBJECT_KEY              = OBJECT_KEY
              EVENT                        = EVENT
             COMMIT_WORK             = 'X'
             EVENT_LANGUAGE          = SY-LANGU
             LANGUAGE                = SY-LANGU
             USER                    = SY-UNAME
    *         IFS_XML_CONTAINER       =
    *       IMPORTING
    *         RETURN_CODE             =
    *         EVENT_ID                =
           TABLES
             INPUT_CONTAINER         = lt_cont
    *         MESSAGE_LINES           =
    *         MESSAGE_STRUCT          =
    hope this helps u.,
    Thanks & Regards,
    Kiran

  • Starting a workflow from the ribbon

    Hi
    I'm running SharePoint 2013 with Workflow Manager 1.0.
    I have a SharePoint Desginer Workflow which start from the following
    URL:
    ~site/wfsvc/06f8de2413bc41fe869414fc061435f9/WFInitForm.aspx?List={ListId}&ID={SelectedItemId}&TemplateID="
    + workflowTemplateId +
    "&WF4=1&Source={Source}'
    I've included the above in my Custom Action Definition (created programmatically in c# code).
    I can however not figure out where to get my workflowtemplateId from. I found some articles about how to do this in 2010 workflows but none about workflow manager 1.0 workflows.
    Just in case it helps. I'm creating the workflow subscription as follows:
    var clientContext = new ClientContext(web.Url);
    var workflowServiceManager = new WorkflowServicesManager(clientContext, clientContext.Web);
    var workflowDeploymentService = workflowServiceManager.GetWorkflowDeploymentService();
    var workflowSubscriptionService = workflowServiceManager.GetWorkflowSubscriptionService(); 
    var unpublishedWorkflowDefinitions = workflowDeploymentService.EnumerateDefinitions(false);
    clientContext.Load(unpublishedWorkflowDefinitions);
    clientContext.ExecuteQuery();
    foreach (var unpublishedWorkflowDefinition in unpublishedWorkflowDefinitions)
         if (unpublishedWorkflowDefinition.DisplayName == workflowName)
                                        // Re-Publish the Definition
                                        workflowDeploymentService.RefreshLoad();
                                        clientContext.ExecuteQuery();
                                        workflowDeploymentService.SaveDefinition(unpublishedWorkflowDefinition);
                                        clientContext.ExecuteQuery();
                                        workflowDeploymentService.PublishDefinition(unpublishedWorkflowDefinition.Id);
                                        clientContext.ExecuteQuery();
                                        // Create new subscription
                                        WorkflowSubscription newSubscription = new
    WorkflowSubscription(clientContext)
                                            DefinitionId = unpublishedWorkflowDefinition.Id,
                                            Enabled = true,
                                            Name = associationName
    I expected templateId to be something like the newSubscription.DefinitionId but that doesn't give me the right Guid.

    var workflowSubscriptions = workflowSubscriptionService.EnumerateSubscriptions();
    clientContext.Load(workflowSubscriptions);
    clientContext.ExecuteQuery();
    foreach(var workflowSubscription inworkflowSubscriptions)
    // workflowSubscription.ID now contains the ID that we need.
    Full details can be found on my blog: http://wp.me/p1fg2Y-8F

  • Starting a workflow from form manager

    Hi,
    I am trying to kick off a workflow by submitting a form present in the form manager repository. In my workflow, I am unable to set a workflow variable with any of my form fields data. The XPath Exression does not seem to work for me.
    However, when I submit the same form from outside the form manager and try to fetch a form field data (using the same XPath Expression) I am able to fetch.
    What may be the reason for this? Any help would be much appreciated. I can send you my form and the workflow file if required.
    Thanks and regards,
    Shivajiv.

    Thanks for your help Jennifer. I got this sorted out. When a workflow is triggered from FM the xpath expression is a bit different -
    It is like this - /process_data/[MyForm Variable Name]/form-data/data/xdp/datasets/data/fields/[my subform name]/NumericField1
    instead of - /process_data/[MyForm Variable Name]/form-data/data/xdp/datasets/data/form1/[my subform name]/NumericField1 i.e. if there is no schema bound to the form that defines the structure of the data top level form node will be renamed to "fields"
    Thanks and regards,
    Shivajiv.

  • Starting Windows program from APEX

    Is it possible to start a Windows program lets say from a button in an Oracle Application. If so any suggests would be great

    This didn't quite work. I put the following into the Page section: HTML Header
    <SCRIPT Language="JScript">
    function runcmd() {
    File="C:\Program Files\FMS\Sentinel Visualizer 4.0\SentinelVisualizer.exe";
    WSH=new ActiveXObject("WScript.Shell");
    WSH.run(File);
    </SCRIPT>
    I am not sure that it is suppose to go in this section. I have put other scripts in this section and it worked ok.
    The following I put into a region a HTML type and entered the following
    <! A href="#" onClick="runcmd(); return false;">Run wordpad.exe<!/A>
    Once again I am not sure this is the right spot either. All I get when I click on the link is an error on the page. Can you be specific as to where each part of the script goes in order to get this to work. I have tried severla spots with the a href (Source, footers but to no avail)

  • Error while starting workflow from warning msg or error msg?

    Hello experts,
    I m tryin to start and workflow from error msg of ME21...whn we juss click enter without entering any value, it gives error as -" enter Purch org  ". whose msg class - ME and msg num - 083.
    thn from t-code SWUY,i creating and linked workflow for the msg.
    Now while testing,when m goin to t-code ME21, and goin to the long text of tht error msg.....the button to start workflow is not getttin enabled. tht is still disable.
    PLease tell r thr any other back ground settings to be done for this.
    Regards
    Nitin

    Hi,
    Your workflow landed up in Error and you want to Restart it right.
    Go to SWPR and check that workflow is there.
    If found, select it and Restart it.
    Regards,
    Surjith

  • Starting workflow from messages

    Hi,
    I am trying out the possibility of starting workflows when a message is raised (Error/Warning). Once i create the message to workflow linkage i am able to start the workflow from the message long text.
    In this scenario is there a way to start the workflow automatically whenever that particular error message occurs?
    For example consider transaction PA30. Now if i try to enter a character value in place of personnel number i get an error message "Enter a Numeric Value". Now once i link the workflow to the message i am able to start the workflow manually. But can this be done automatically on the occurence of this message?
    Thanks,
    Prasath N

    Hi Karun,
    Thanks for your response. I have done this already and it is workfing fine when i start the workflow manually. I would like to know if there is an option to start the workflow <b>automatically (without pressing the workflow button)</b> when the message is raised.
    Thanks,
    Prasath N

  • Start PO workflow after approved from first level

    Hi Guys,
    I have i typical requirement i my knowledge its not possible.
    What exactly has happened is that after upgrade BUS2012 event linkage was not active and there where no workflow got triggered for PO approval
    But the line manager have gone and approved the POu2019s from ME29N now for the next level they are asking to send the workflow as we have activated the linkage.
    Any idea how can we start the workflow from that point again.
    Atul

    Hi Atul,
    In production how many workflow's are there like this?
    Its small amount of workflow's then you can again manually trigger the workflow using SWUE[You should pass the object key as purchase order number] and Complete the first level of workflow.
    So it will be go for Second level of Approval.
    If you have large amount of workflows that are already Triggered in production, then you have to discuss with your client about the issue.
    Thanks,
    Viji.

  • Workflow from F-28 on save

    How can I start a workflow from transaction F-28 after save? I have checked change documents, and don't find anything. I have run the event trace and nothing there either. Lastly I can't find any obvious user-exits.
    Am I missing something, or is there another way to do this?

    U need to go to SPRO-> Financial accounting-> Global setting -> BTE
    Then enviorment -> Info system.
    u would need to locate a BTE at that point and then register the copy the BTE into ur own FM - u need to copy the interface of the BTE.
    The u need to come back on the BTE screen and register the BTE in settings P/S function modules.. now depending on partner or customer add it.
    put a break point in ur Fm and save document u should it should stop there
    I think SAMPLE_INTERFACE_00002218 should be the one u need.
    Hope this helps..

  • InfoPath 2013 start a workflow

    In a new InfoPath 2013 form that uses a custom list, I would like to add a custom button and/or something to click on for the user to eventually 'start a workflow when item changes'.
    Right now since I am in the early phase of the process, and it would be fine to 'start the process manually' also. Basically I would like directions on what a user can click to they could start the workflow.
    I found the following link and it shows how to start a workflow from the documents library:
    https://www.youtube.com/watch?v=afttEV61kQI
    I would like to know how to have this same process occur from an InfoPath 2013 form where the user clicks my 'button/item' and does not click on the 'auto generated' save button.

    assuming that the workflow should not necessarily start ANY time ANY file changes (which is a default option, and requires no custom dev effort)... what I've seen a few times, is for the form to include a checkbox ("start workflow")... the workflow
    starts, and checks for the condition... and stops if the checkbox is not checked.
    Scott Brickey
    MCTS, MCPD, MCITP
    www.sbrickey.com
    Strategic Data Systems - for all your SharePoint needs

  • Starting Workflow from Generic Object Services

    Hi All.
    We are on ECC6. In transaction MM02 when I excute 'Start Workflow' from Generic Object Services, no workflows are found. Can anyone help me with the following issues;
    1. What is the underlying object in transaction MM02 (I believe it is BUS1001006)
    2. How can i ensure that the proper workflows in this transcation are started through some  
        customisation, enhencement or user-exit.
    Regards.

    I think you have to maintain the Workflow Template as General Task and then only it will appear in the GOS.
    Thanks
    Arghadip

  • Starting workflow from where ?

    hi,
    is it possible to start a workflow 'behind' a transaction code ?
    i want to have a menu-entry in user-menu in ERP where the user can click on
    a self-written workflow. but how can i give them the possibility to enter this workflow ?
    reg, Martin

    REPORT  YGERTEST_START_WF.
    data: gw_task type SWW_TASK,
          gw_wf_id type SWW_WIID,
          gw_wi_id type SWW_WIID,
          gw_return_code type sysubrc,
          gw_status type SWR_WISTAT,
          gt_message_lines type STANDARD TABLE OF SWR_MESSAG,
          gw_message_line type SWR_MESSAG.
    start-of-selection.
      CALL FUNCTION 'SAP_WAPI_START_WORKFLOW'
        EXPORTING
          task                      = 'WS94400047'
    *     LANGUAGE                  = SY-LANGU
    *     DO_COMMIT                 = 'X'
    *     USER                      = SY-UNAME
    *     START_ASYNCHRONOUS        = ' '
    *     DESIRED_START_DATE        =
    *     DESIRED_START_TIME        =
    *     DESIRED_START_ZONLO       = SY-ZONLO
    *     IFS_XML_CONTAINER         =
        IMPORTING
          RETURN_CODE               = gw_return_code
          WORKITEM_ID               = gw_wf_id
          NEW_STATUS                = gw_status
        TABLES
    *     INPUT_CONTAINER           =
          MESSAGE_LINES             = gt_message_lines
    *     MESSAGE_STRUCT            =
    *     AGENTS                    =
    write: / 'Return code from start: ', gw_return_code,
           / 'WF ID: ', gw_wf_id.
    loop at gt_message_lines into gw_message_line.
      write: / gw_message_line.
    endloop.
    write: / 'New status: ', gw_status.
    select max( wi_id )
           into gw_wi_id
           from swwwihead
          where top_wi_id eq gw_wf_id.
    CALL FUNCTION 'SAP_WAPI_EXECUTE_WORKITEM'
      EXPORTING
        workitem_id          = gw_wi_id
    *   LANGUAGE             = SY-LANGU
      IMPORTING
        NEW_STATUS           = gw_status
        RETURN_CODE          = gw_return_code
      TABLES
        MESSAGE_LINES        = gt_message_lines
    *   MESSAGE_STRUCT       =
    write: / 'Return code from execute: ', gw_return_code,
           / 'WI ID: ', gw_wi_id.
    loop at gt_message_lines into gw_message_line.
      write: / gw_message_line.
    endloop.
    write: / 'New status: ', gw_status.
    Works like a charm. You could enhance the selection on SWWWIHEAD with the type of task you expect and even wait for it to exist if it's not the first step in the workflow.
    Good luck,
    Gert.

Maybe you are looking for

  • Problem  with Inbound Abap Proxy

    Hi Experts, I have an Inbound ABAP proxy scenario that insert data into a ztable. The whole process from XI to R/3 works fine, except it does not update my ztable. The only time the ztable gets updated is when i debug it. I used this report "SPRX_TES

  • I can't  compile a servlet

    Can I complie a servlet with javac? Im a new user, when i try to compile a servlet from javac myservlet.java The compiler send several errors, it doesn't recognise the class of servlets. My Enviroments' vars are: PATH = C:\JDK1.4\BIN CLASSPATH = .;C:

  • Photoshop scripts within Actions

    Ok so I am currently trying to run a photoshop script within an action specifically Image processor. I can include the script by importing menu item although evyerthing i run the action i have to set up the script aka choose folder locations etc. My

  • Help with a forumula, please

    First, some background. I have a couple of Numbers documents that I use to record the daily weather. The first is a very large document containing sheets for each of several years. Each sheet has one large table with the daily info & a couple of smal

  • CGContextGetCTM: invalid context 0x0 errors on OSX

    It would appear that the latest version of Java (as supplied by Apple Update) and/or the latest version of OSX do not get along as well as they should. If you search for one of the error messages below you will see a lot of people are getting these e