Ruskin
7th April 2005, 07:13
We are having a bit of fun, trying to use AFS to create a patch file. The manual process, is;
a) We have all software components attached to a customisation project part.
b) We create a patch (session ttiex4500m000/ttiex4100m000)
c) We copy the software components to the patch components (ttiex1176m000/ttiex4210m000)
d) We export the patch (ttiex4500m000/ttiex4110m000/ttiex1280s000)

This works perfectly. But when we try to do this through AFS, the export part does not work. We can do steps a, b and c, but not step d. We can activate ttiex4500m000, find the correct patch, select it and activate ttiex4110m000. But then, when we try to use the export from ttiex4110m000. Nothing happens. The function we are calling, is 'exec.cont.process' (as shown in the ttadv316 table). There is no question to answer (in the case of the patch file already existing, question ttiex41101 is shown, but this is only shown if ttiex400.crea is set to YES, which in our case, will always be NO). Thus, the only issue, could be the report. We can not set the device for the report, as the session is not open yet (the report is attached to ttiex1280s000). We can not open the session then set the report, as the process fires straight away, when the session is open.

To work around this, we have created a library that simply 'zooms.to' ttiex1280s000. However, this session now returns an error of 'Order line not found'. In order to activate ttiex1280s000, we must first create a component list. Which we can do, by calling the function 'create.deliver.file' and passing the patch code. This function then returns the file name created (it is located in the ttdlldeliver tools object). So we have our file list with the components of the patch, and the filename. As per the bic_info6.2, this file is now correctly formatted for session ttiex1280.

How do we call ttiex1280s000. I have set some values, that it appears to need (ie: from.iexpatch, iexpatch, sess.from.file and session). The ttiex410 and ttiex400 tables are current in memory (although, this is irrelevant, as the file now holds the list of all the components to be delivered). Why is the 'Order line not found' error being displayed and what other variables need to be passed to ttiex1280s000?

Ruskin
12th April 2005, 23:39
Just to advise, this has been answered in the tools development section. I posted this in AFS, but realised that it's a tools issue (not an AFS issue), so also posted in tools development.

It was how we were calling ttiex1280s000, that was the issue. This works fine;

extern domain ttaad.path path
extern domain ttaad.path path.components

#pragma used dll "ottdlldeliver"
#pragma used dll "ottdllfilehand"

path = "/patches"
path.components = creat.tmp.file$(bse.tmp.dir$())

|* From ttdlldeliver
create.deliver.file(ttiex400.paco, path.components)
zoom.to$("ttiex1280s000", Z.SESSION, "iexpatch", "", 0)


NOTE: this has created DD files, so you need to use the pack.patch function, in ttdllfilehand, to pack the DD directory structure into a single patch file.

Hitesh Shah
14th April 2005, 07:49
In the past i had made limited trials on this without success. This is very useful.

Can u elaborate on this with an example .


NOTE: this has created DD files, so you need to use the pack.patch function, in ttdllfilehand, to pack the DD directory structure into a single patch file.

Ruskin
15th April 2005, 00:29
When the data dictionary is exported from ttiex1280s000, they are in a directory structure of;
ppvvvv_rr_cccc
Where p is package, v is version, r is release and c is customer. Thus, it is possible to call ttiex1280s000 with a dump file that contains multiple packages (but only a single vrc if coming from a patch, as the patch header table ttiex400 specifiies the vrc of the components attached to the patch in the patch line table ttiex410).
So for example, if you have two components in ttiex410, such as; script tfacr2420 and script tdsls4101, then two directories are created in the path specified by the external variable 'path'. It is important to note, that ttiex1280s000 needs two external variables;
path - This is the path of where to create the data dictionary files
path.components - This is the full path and filename of the component list file, which contains the components to be dumped. If you look at my previous script, you will see how to build this file

If your the 'path' variable is set to patches/tmp, then when you export this patch, you will get two directories;
../patches/tmp/tfVVVV_rr_cccc
../patches/tmp/tdVVVV_rr_cccc
In these directories, will exist the data dictionary (DD) dump files, generally;
components
dump.l
dump.e
dumpf01.Z
dumpd01.Z
..etc..
You can pack these directories into a single patch file, by specifying the path to the dd directory structure. In this case, it is the path to the patches/tmp directory. NOTE: you must use the full path (not a relative path). If we continue my script from my previous post, after you have called ttiex1280s000, you pack the patch by;

long x
|* This is in ottdllfilehand
x = pack.patch("/home/patches/tmp", "/home/patches", "my_patch")
if x < 0 then
message(sprintf$("Error %d creating patch file", x))
return
endif

The function expects the first directory, to be the root directory of where the DD directory structure is. In this case, the patches/tmp directory (it will then pack all the sub directories into a single file). The second argument, is where to put the patch file. In this case, the patch file will go into the patches directory. The third argument is the patch filename (should be the same as ttiex400). So you are left with;
/home/patches/my_patch
Which is a patch file that contains two data dictionary dumps and there directory structure (one for tf and one for ti, both in the same patch file).

NOTE: when the pack.patch function runs, it deletes the binary (.Z) files, but does not delete the ascii files (components, dump.l or dump.e). You will need to clean these up manually. What we do, is concatenate the dump.l files from all of the ppVVVV_rr_cccc directories into a single dump list, so we can see what all the patches contain, before we delete them. Thus, we know exactly what is stored in each patch, for importing. Before we purge all the sub directories under ../patches/tmp.

Here is some useful code, for cleaning up the ascii files in the DD directory, after you have dumped the patch. NOTE: in this instance, do NOT put the patch file into ../patches/tmp, as this function will remove the tmp directory and all it's contents. Use this function call at your own peril (in other words, don't put your root directory into this function);

|* This is in ottdllfilehand
rm.dir.and.subdirs("/home/patches/tmp")
mkdir("/home/patches/tmp")

Amit_Jain
24th December 2013, 12:22
Hi Ruskin

I have been working on writing AFS for session "ttiex1280m000" without success. I would be greatful if you can share the code.