Follow these steps:
Add IMPORTS views to this procedure step containing the golfer userid and the scoring record date and time. Name the views Import. When complete, copy them to the EXPORTS views naming the new export views Export. Your diagram will now look as follows:


Back in the EGOLFER_SCORE_CARD procedure step action diagram create a LOCALS view of Score Card Image and name the view Local. Your diagram will now look as follows:

Do the same for the import scoring record and click the Close button. In the Export View Matching dialog, you only need to match the export score_card from the server MAINTAIN SCORE CARD to the local score_card of the client EGOLFER SCORE CARD, then click the Close button. The Open event will now look as follows:
Note: Make sure the EXPORTS Entity View local score_card is matched from the Entity View export score_card as shown. If you need to adjust any of the view matching, double-click the view name that you want to change to bring up the view matching dialog again.

Select the USE statement to highlight the entire USE statement. Add an IF action statement checking the value of the EXIT STATE. The Open event will now look as follows:

Writing the BLOB data to a file requires the use of an External Action Block (EAB). An External Action Block is used to interface Gen generated code with developer handwritten code. An External Action Block is similar to every other action block in that it too can have import and export views, but the only action diagram statement allowed is EXTERNAL. The Gen application then “uses” the External Action Block like it would use any other action block, matching views to the External Action Blocks import and export views. The External Action Block is packaged and generated like other action blocks, but the only thing generated for it is a “stub” or “shell” of a program, containing definitions for the arguments used in the interface.
The developer would then add his own handwritten code to the stub, and then compile the code like he would any other handwritten code. If there were many EABs, the developer could decide to include them into a library. Finally, the location for the external action blocks would be added to a Build Tool profile so they could be located and linked into the Gen application as appropriate.
For writing our BLOB to a file, there are two pieces of information the EAB has to have, the BLOB data and the file information. So we are going to create an EAB that has two import views. There is probably information that should be returned to us as well, but for this example we will ignore that. So for this example our external action block will not have any export views.
For the two import views, the required BLOB data can be represented or defined by a view of the Score Card image. But we also need to pass file information, and we do not have anything defined in our model yet which represents file information. So we will create a new Work Set. A Work Set is similar to an entity type, in that it is a collection of “attributes”, but work sets do not appear in the data model, and subsequently do not get generated as data base tables. Essentially, Work Sets are lists of pre-defined arguments that are used in action diagrams to provide consistency in the parameter definitions.
To create a Work Set, from the Menu Bar click Tool, Analysis, Work Set List. A list of the current Work Sets in the model is displayed. Every model contains at least two work sets that are added automatically when you create the model. They are the ASYNC_REQUEST and IEF_SUPPLIED work sets. The IEF_SUPPLIED work set in particular is useful in that it contains definitions for many parameters commonly used in Gen applications, but there is nothing in it to represent our file information. So we will create a new work set.



Close the Work Set List and you will be returned to the EGOLFER_SCORE_CARD action diagram.



Note: It is important that the order of the Import views is exactly as shown below. That is because we have already written, compiled, and provided a library containing the external code and they need to match. If they are not, move them so that they are.


|
Copyright © 2013 CA.
All rights reserved.
|
|