Using a function within a process flow...

Hi,
I'm trying to figure out a way of using a function (or something else) to return a status before attempting to run a mapping. I'd like to have a table with all my mappings, start date, end date, status, etc.
1. SELECT status FROM table, if the mapping has already been executed do nothing, else execute the mapping, etc.
Is there a way to accomplish that in OWB flow ?
Thank you.
Gaétan

Hi,
We had a similiar set up in my previous role where we have a Process flow for each mapping. Under that processflow, before attempting to run the mapping we called function to check whether that particular mapping has been run successfully for that date. The function would take "PF Name" as an input and returns the status as 1 (return success - the mapping was not run, so has to be run today)
2 (return warning - the mapping is already run no need to run this time)
3 ( any fatal errors).
The function code is as below - _______________________________________________________
CREATE OR REPLACE FUNCTION "PUB_CHECK_RUN_STATUS"("IN_ETL_PROCESS_FLOW_NAME" IN VARCHAR2) RETURN NUMBER IS
--initialize variables here
lv_Current_Load_Id NUMBER;
lv_Last_Load_Id NUMBER;
BEGIN
     <<Check_PF_Status>>                    -- This block is Standard for all Loads Jobs
     BEGIN
          SELECT LOAD_ID
          INTO lv_Current_Load_Id
          FROM LOAD_ADMIN.LATEST_LOAD;
          SELECT LAST_COMPLETE_LOAD_ID
          INTO lv_Last_Load_Id
          FROM LOAD_ADMIN.ETL_PROCESS_FLOW
          WHERE ETL_PROCESS_FLOW_NAME = in_ETL_Process_Flow_Name;
          IF Lv_Last_Load_Id = lv_Current_Load_Id
          THEN
               -- This Process Flow has already been completed during this Load, so do not re-run
               RETURN 2;          -- Returns a Warning Status
          ELSE
               -- This Process Flow has not completed during this load, so need to run this now
               RETURN 1;          -- Returns a Success Status
          END IF;
     END Check_PF_Status;
EXCEPTION
WHEN OTHERS THEN
RETURN 3;     -- Returns an Error Status
RETURN NULL;
END;
In the above code
LATEST_LOAD is a view which always returns one row with current load information (like load _id, start time etc)
ETL_PROCESS_FLOW is a table containing one row for each process flow with information like (execution status, load_id when it was execute )
You can modify to suit your requirements.
HTH,
Mahesh

Similar Messages

  • Function in a Process Flow

    Hi all,
    I have a function which returns a value either 1 or 0. I want to get the output of the function and check if the function returns 1 then the process flow should be successful else it should error out.
    I have created a simple process flow, which has start, function, success and error. From the function to success transtion i have given an complex condition where value =1 and the other transtion should be kept empty. But it didnt work.
    Any ideas how exactly we can use a function in a process flow.
    Thanks in advance

    There is another way of achiving it....
    Go to process flow -> Configure and click on the function operator.
    Under Execution Settings, select the option Use Return as Status
    This setting governs the behavior for activities that return NUMBER in their output. These activities include the FTP, User Defined, and Transform activities. When you select Use Return as Status, the Process Flow Editor assigns the outgoing transition conditions based on the following numerical return values for the activity:
    1 = Success Transition
    2 = Warning Transition
    3 = Error Transition
    You might have your function return 1 for success and 3 for error and the transition would take them as status code.
    Thanks,
    Suchit

  • Using cmd within the process flow. possible?

    I am trying to combine all the flat files in a directory in my process flow by executing
    cmd> C:\folder *.log copy new.log
    is this possible within the owb?

    I would like to ask another question..
    The external table isnt dynamically connected to the flat file defined, so does it mean that I would have to re-deploy it again, everytime the content of the flat-file get updated?
    if so, is there a way for me to deploy the external table within the process flow?

  • Using .sql files in OWB Process flow

    Hi,
    Is it possible to use the .sql files in Process flow and schedule them?
    If so,can you please let me know the procedure.
    Thanks for your help and hoping to hear from you soon.
    Thanks
    Vinay

    Process flow is not a scheduler, to schedule, you will have to run the process flow from a scheduler system, such as the one in Oracle Enterprise manager.
    You can run an sql file from a batch file (or a shell file, if you are on unix), and then call the batch file from an external activity in the process flow.
    Regards:
    Igor

  • Function to call Process-flows/mapping from SQL

    Hi All,
    Can any one of you send me the function to call process-flows/mappings (eg: I have 10 mapping/Process-flows). It is an urgent requirement pending in my final testing.
    Plz help me in this regard.
    Regards

    Hi
    All information that you need, you can find in $ORACLE_HOME/owb/rtp/sql/. BAsically all executions in owb is called through wb_rt_api_exec package.
    for example:
    declare
         variable exec_return_code number;
         procesflow varchar2(255);
    plsqlname varchar2(255);
    begin
    -- Initialize Return Code
    exec_return_code := owbrt_sys.wb_rt_api_exec.RESULT_FAILURE;
    -- Run Task
    procesflow:='WF_X1';
    plsqlname:='MP_X1'
    exec_return_code := owbrt_sys.wb_rt_api_exec.run_task('OWF_LCTN','PROCESS',procesflow, ' ' );
    if exec_return_code = 1 then
    exec_return_code := owbrt_sys.wb_rt_api_exec.run_task('STAGE_LCTN','PLSQL',plsqlname, ' ' );
    end if;
    end;
    Regards

  • Using Saxon Functions Within XSLT

    Hi,
    Please let me know how to use saxon functions within XSLT.
    E.g.: If I want to implement saxon:base64Binary-to-string() function in XSLT in "xsl:value-of" function, then what will be the format for implementation.
    I have selected the Processor as Saxon 8.9.0.3 (the one available) and using xmlns:saxon="http://saxon.sf.net/" in the xsl:stylesheet tag.
    I am using Stylus Studio 2007 XML Enterprise Suite for XSLT.
    Thanks,
    Abhishek.

    Hi,
    Yes I intended to use the XLST mapping within PI...but now will have to change the plan...is there any other way to do it?....is this the problem with the SP?.....anybody who can put more light on this topic.....
    Thanks,
    Abhishek.

  • Problems using user defined activitys in Process Flows

    Hi everybody,
    i have problems using an user defined activity in my owb process flow.
    I did the following according to https://blogs.oracle.com/warehousebuilder/entry/how_to_use_user_defined_activity_in_owb_process_flow.
    1. create a script in /tmp called test.sh
    2. chmod +x on the script so it can be executed
    3. Changed the Runtime.properties file under ORACLE_HOME/owb/bin/admin
    property.RuntimePlatform.0.NativeExecution.FTP.security_constraint = NATIVE_JAVA
    property.RuntimePlatform.0.NativeExecution.Shell.security_constraint = NATIVE_JAVA
    property.RuntimePlatform.0.NativeExecution.SQLPlus.security_constraint = NATIVE_JAVA
    property.RuntimePlatform.0.NativeExecution.OMBPlus.security_constraint = NATIVE_JAVA
    4. Creating an Process Flow with just the user defined activity
    5. Deploying the Process flow was successfull
    But everytime i execute the pf i get the following error in my Job Details.
    TEST_PF:USER_DEFINED                                        
    Parameters                                                  
    Log file is available. Click Information button to view.                                             
    It says Log file is available. But i can't find this file. Also i don't know what the problem is.
    Can anybody help me out of this?
    Thanks a lot

    Hi,
    solved the problem by myself.
    I had problems with my script. So i insert set -x into the script an executed the pf again. Know i can see whats happening in a log. You can find this log in the job detail window by pressing the blue ! Button when the whole PF (the first entry) is marked.
    Greetings

  • Limitations in using a function within a select statement

    I have a function which retrieves various data elements from the
    database and formats it accordingly. The data (varchar2)
    returned could be in excess of 2,000 characters length.
    I need to use the returned data as part of a view. I am able to
    use the function in a "select" statement, but when I use it with
    returned data in excess of 2,000 chars, I get the following
    error:
    ORA-06502: PL/SQL: numeric or value error
    This error is occurring whenever the returned data is in excess
    of 2,000 characters.
    Is there an alternative method to what I am proposing, I have
    tried alternative data types but if I am able to use it in a
    "select" statement, I get the above error when the returned
    length exceeds 2,000 chars.
    Thanks
    Peter

    are u using oracle 7. varchar2 limit in 8 is 4000.

  • Using exportAsXFDF function within a PDF

    I have created a fillable form with two buttons, a load and save.
    Both work fine in professional X, but when I enable the PDF via professional and then try to save data via reader X the functionality does not work.
    I have implemented the save as a javascript action on the button, trying both this.exportAsXFDF(); and this.exportAsXFDF(true, false, null);
    Both these work in professional X but not in the reader.
    Do I need another product to enable this feature within the PDF?
    Are there any alternative method of exporting the data from the fillable PDF?
    Am I doing something wrong?

    For this method to work in Reader you need to apply a special right to the
    file using a product called LiveCycle Extensions Server.

  • DBMS_XMLQuery behavior when using stored function within cursor select

    Consider the following SQL Statement
    select t1.id
    , t1.name
    , cursor ( select t2.id
    from tab t2
    where t2.t1_id
    = t1.id
    and validate(t2.xyz,:bd1)
    = 1
    from tab t1
    where t1.id = :bd2
    DBMS_XMLQuery is used to create a context and to bind the appropriate values. In this case 'validate' is a stored function. I get the following error message upon execution:
    ORA-29532: Java call terminated by uncaught Java exception:
    java.sql.SQLException: Missing IN or OUT parameter at index:: 1
    Issuing a similar statement in SQL*Plus works fine. I was wondering whether this is a known issue when using a stored function in the cursor select statement in the context of DBMS_XMLQuery or whether I'm doing something wrong.

    Hi Jan,
    This problem has been identified and fixed. The fix should be available in the next release. Thank you for bringing this up to our attention.
    visar

  • Concatanate new line using concat function in BPEL process

    Hi,
    Anyone please tell me how can i concatenate new line at the end of a string in concat function?

    If using xsl you can use this one:
    <xsl:value-of select='concat("First Name :: ",/ns1:ProcessRequest/ns1:firstName)'/>
    <xsl:text> &hashxD; &hashxA;</xsl:text>
    <xsl:value-of select='concat("Last Name :: ",/ns1:ProcessRequest/ns1:lastName)'/>
    give # in place of hash

  • BPC 7.5 NW Business Process Flow reopen function

    Hi,
    i have e question concerning the reopen function whithin business process flows.
    I set up a business process flow with several steps and use the match step region function. The users are able to go through the bpf steps just for one plant and they don't have to wait for the users of other plants. In most steps we implement a reopen function for the case that users want do add or correct something. I expect,  when I reopen one previous step, this step just reopen for one plant, but the reopen function opens the previous step for all plants.
    Are there any posibilities to use this reopen function just for one plant and not for all? Is  this perhaps a customizing issue?
    Thanks in advance
    Christian

    Hello Christian,
    This guide may help you on finding a way to perform that:
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/00971e51-27eb-2c10-479d-d1a0fa8f2cc0?quicklink=index&overridelayout=true
    Best regards,
    Vin

  • Process flow stuck while execution - Fork being used

    Hi,
    We are using fork feature in the process flow. Three mappings are being forked; if all the 3 are successfully completed, then the 'END_SUCCESS' needs to be reached. This is done by routing the success transition from 3 mappings to the 'AND' process and then from 'AND' to 'END_SUCCESS'. If any one of the mapping fails, the 'END_FAILURE' needs to be reached. This is done by routing the success transition from 3 mappings to the 'OR' process and then from 'OR' to 'END_FAILURE'.
    When this process flow is executed, 2 mappings are successfully completed; the third one is completed with errors. While viewing from workflow monitor, the success routes are clearly shown but the failure route is not shown. In the runtime audit browser, the mapping details are correctly shown (2 mappings with success and the third one with failure). The process flow is shown having a status of 'BUSY'. The process flow keeps on waiting and does not get completed/aborted automatically.
    Is there something which I have missed in the process flow?
    Thanks in advance,

    Reposting as there was a mistake in my previous posting:
    Hi,
    We are using fork feature in the process flow. Three mappings are being forked; if all the 3 are successfully completed, then the 'END_SUCCESS' needs to be reached. This is done by routing the success transition from 3 mappings to the 'AND' process and then from 'AND' to 'END_SUCCESS'. If any one of the mapping fails, the 'END_FAILURE' needs to be reached. This is done by routing the failure transition from 3 mappings to the 'OR' process and then from 'OR' to 'END_FAILURE'.
    When this process flow is executed, 2 mappings are successfully completed; the third one is completed with errors. While viewing from workflow monitor, the success routes are clearly shown but the failure route is not shown. In the runtime audit browser, the mapping details are correctly shown (2 mappings with success and the third one with failure). The process flow is shown having a status of 'BUSY'. The process flow keeps on waiting and does not get completed/aborted automatically.
    Is there something which I have missed in the process flow?
    Thanks in advance,

  • How to use OMBPLUS activity inside process flow

    Hi, I’m using OWB 11.2.0.3.
    In a process flow, I need to use an OMBPLUS activity. When I run the process flow, it runs successfully and says: “Log file is available. Click Information button to view.” 
    -Where is the log file, OWB is talking about?
    -Is there any sample of using OMBPLUS activity inside a process flow?
    THANKS, au revoir!

    Thanks, Dallan
    Articles on "Oracle Warehouse Builder (OWB) Weblog" really help me.
    So, I understand that I can't resume process flow in Control Center - only in Repository Browser. :)
    IMHO, this is something puzzled and missmatch with official Users Guide

  • How to setup PCG Flow Rule Process flow with Business Event subscription

    Hi,
    How to setup PCG Flow Rule Process flow with Business Event subscription type?
    When should Business Events be used?
    The latest user guide does not provide ay information on this functionality of Flow rules.
    Thanks

    You should find it's usage noted in the new PCG user guide on page 3-26 under the heading "Configuring Workflow/Event Rules". This way you can have a Flow Rule call a business event component or a workflow. This would be kicked off within a process flow as one of the steps.
    I hope that helps.

Maybe you are looking for

  • IPhone 3G Email and Calendar times off by one hour (slow one hour)

    My times which I send/receive emails or put appointments on the calendar are 1 hour slow as compared to my computers. I have Mobile Me and Mobile Me (on the computer) and my Outlook emails and calendars match and my current time is correct on all. On

  • T20 connection

    Hi, Does anybody know which is the best quality external speaker connection to use from a tv. Is it 3.5 mm headphone socket, or RCA phono connection. Thanks.

  • I must be blind or stupid

    I just cannot find the place to click to quote a message if I'm responding. Help, please?

  • Weblogic 10 and JSF1.2

    Hi, I found few threads in the forum on jsf with weblgoic 10 but they didn't solve my problem. I am deploying a web application which uses jsf1.2_01 (due to certain limitations with our environment , i have to use only this version) on weblogic 10 se

  • How do i forward a text that has a sound attachment?

    when i recieve a text that has sound , picture and message , my 4s wont let me forward, save to ringtones, or email myself the sound portion. it also separates each one individually even though it was sent as one text . i dont understand why and i've