Focal Point
[CASE OPENED][SOLVED]EX procedure on Deferred Mode

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/1387070686

April 06, 2017, 06:55 PM
Anatess
[CASE OPENED][SOLVED]EX procedure on Deferred Mode
Hi All-

This doesn't submit the procedure as a deferred report:

EX procedure.fex PARM1='parm1', PARM2='parm2', IBIMR_defer='Defer'

The report that has the EX is launched from the Repository. The procedure that is exec'd is also in the Repository.

What am I doing wrong?

We're on WF8.1.5.

Thanks,
Anatess

This message has been edited. Last edited by: Anatess,


WF 8.1.05 Windows
April 06, 2017, 11:46 PM
Francis Mariani
I'm pretty sure that the fex running the EX command must be the one that is executed in deferred mode.


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
April 07, 2017, 07:46 AM
BabakNYC
Do you get an error? What happens when you run this EX procedure?

I've seen IBIWF_defer=defer in some URL but I can't remember where and doesn't show up in the doc when I search for it.

This message has been edited. Last edited by: BabakNYC,


WebFOCUS 8206, Unix, Windows
April 07, 2017, 09:33 AM
Anatess
quote:
Originally posted by Francis Mariani:
I'm pretty sure that the fex running the EX command must be the one that is executed in deferred mode.


Well, that would suck because the main fex makes the decision whether to run the report deferred or not. So, it can't run already deferred!


WF 8.1.05 Windows
April 07, 2017, 09:34 AM
Anatess
quote:
Originally posted by BabakNYC:
Do you get an error? What happens when you run this EX procedure?

I've seen IBIWF_defer=defer in some URL but I can't remember where and doesn't show up in the doc when I search for it.


No error. The fex just runs on standard mode and not deferred mode.


WF 8.1.05 Windows
April 07, 2017, 12:37 PM
Francis Mariani
As far as I know, there are three four ways to run a fex in deferred mode:

1) From the Resource Tree, right-click a fex, then select Run Deferred
2) In a report drilldown link, include the &IBIMR_defer parameter, with value "Defer"
3) From an HTML form, include the &IBIMR_defer parameter, with value "Defer"
4) Via a URL that includes the &IBIMR_defer parameter, with value "Defer"

From this knowledge, I came up with this demo fex, which includes an HTML form. On Mondays, Wednesdays and Fridays, the second fex runs in deferred mode. On other days, it runs immediately.

Change the days in the IF statement to see it behave in both ways - immediate and deferred

-SET &ECHO=ALL;

-SET &DOW = DOWK(&YYMD, 'DW');

-SET &DEFER_IND = IF &DOW IN ('MON', 'WED', 'FRI') THEN 'Defer' ELSE '';

-HTMLFORM BEGIN
<html>
    <body onload="document.forms[0].submit();">

        <form action="run.bip" method="post">
            <input type="hidden" name="BIP_REQUEST_TYPE" value="BIP_RUN"/>
            <input type="hidden" name="BIP_folder" value="IBFS:/WFC/Repository/FocalPoint"/>
            <input type="hidden" name="BIP_item" value="/fp_anatess2.fex"/>
            <input type='hidden' name='IBIMR_defer' value="!IBI.AMP.DEFER_IND;" />
        </form>

    </body>
</html>
-HTMLFORM END

This message has been edited. Last edited by: Francis Mariani,


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
April 12, 2017, 11:16 AM
Francis Mariani
Thread bump.
April 14, 2017, 10:04 AM
Anatess
Hi Francis,
Thank you for your response. Yes, I use several of those methods already.

But here is my dilemma:

I want to use EX IBIMR_defer=Defer to execute a procedure on deferred mode.

Using FOCEXEC=(IBIMR_defer=Defer) in the stylesheet works just fine when the user clicks on the link on the Report record. But the way I want the fex to work, I want it so that if there is only 1 record returned in the report, it won't bother displaying the records for the user to select which one they want to run deferred, rather it would just run the fex deferred automatically.

So I want to do this simple thing:

TABLE FILE...
ON TABLE HOLD
END

IF &LINES=1 goto :EXME;

TABLE FILE ...
...
...
ON TABLE PCHOLD FORMAT HTML
TYPE=DATA, FOCEXEC=runme.fex(IBIMR_defer=Defer) $
END
-EXIT

-:EXME
EX runme.fex IBIMR_defer=Defer


Very simple. But the EX doesn't work. By the way, &IBIMR_user parameter also doesn't get passed when using EX.

By the way, both calling program and called program are in Content. Dunno if that matters. I haven't tried running this under EDASERVE.

Regards,
Anatess

This one is on WF8.1


WF 8.1.05 Windows
April 14, 2017, 10:41 AM
Francis Mariani
Well, my example code shows you how to achieve what you want to do.


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
April 14, 2017, 11:05 AM
Anatess
quote:
Originally posted by Francis Mariani:
Well, my example code shows you how to achieve what you want to do.


Thank you for that code, Francis. I went ahead and recoded my stuff to use HTMLFORM instead of the simpler EX function.

I also went ahead and opened a case on the EX to see if IBI can provide a solution to EX.


WF 8.1.05 Windows
April 14, 2017, 11:32 AM
Francis Mariani
Please let us know if they suggest an alternative.


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server