PERFORM local action - F32434

Idea created by DariusPanahy on Feb 19, 2016
    Under review
    Score25

    An idea raised by a couple of customers at the recent Edge conferences this week is to have a local PERFORM capability in an action block. The concept is that you can specify a named local block of code in the action diagram (much like an event handler in a p-step or a COBOL paragraph).

     

    You then have a method for calling it, for example PERFORM <LOCAL BLOCK>. No view matching will be needed since it will share views with the AB.

     

    This will allow common code to be invoked without needing to place it in a separate CAB and also means that the common code is private to the AB and not public.

     

    A very simple example is provided below. The concept of placing code in separate blocks also allows for simplification of the main action block's structure, making it easier to define, understand and maintain. It is a common technique used in most programming languages and the customers who raised the idea felt that it would be a very welcome addition to Gen.

     

    |  +- READ db customer

    |  +- WHEN successful

    |  |  +- UPDATE db customer

    |  |  +--

    |  |  PERFORM log_updates

    |  +- WHEN not found

    |  |  +- CREATE db customer

    |  |  +--

    |  |  PERFORM log_updates

    |  +--

    +--

    +- LOCAL ACTION log_updates

    |  NOTE some common logic here

    +--