dadlllink_run

DLL Usage description

This library contains functionality for export done messages, batches and batch lines to import and import done messages. These functions can be employed once the exchange links have been set up. When running a regular export at the source site export done messages are sent. These information from those messages is stored at the target site as batches and batch lines to import. When the data has been imported at the target site the batches and batch lines to import are deleted and an import done message is sent to the source site.

Note on the function specifications: "iff" means "if and only if".

DLL Prototypes

function extern long lrun.batch.to.import.exists(
                domain daxch.link link,
                domain daxch.long srun,
                domain daxch.pint stry )
 pre   : true post  : true return: True iff the batch to import specified by the
parameters
        exists.
 function extern long lrun.create.and.send.export.done.message(
                domain daxch.link subs,
                domain daxch.envi tenv,
                domain daxch.comp tcom,
                domain daxch.long srun,
                domain daxch.pint stry )
 pre   : The subscription defined by subs, tenv and tcom exists.
        srun > 0, stry > 0.
        The export done message defined by subs, tenv, tcom, srun and
        stry does not yet exist. post  : The export done message, specified by
the parameters,
        has been stored.
        If return then the export done message has accepted = yes,
        otherwise it has accepted = no.
        After calling this function one or more times, function
        lrun.end.sending() must be called. state : Before calling this function
a retry point must be set;
        after calling this function a commit must be given;
        no commit is given in this function. return: True iff the export done
message has been sent successfully;
        false means: the target environment is not available or the
        exchange link does not exist or has status inactive (source &
        target). desc  : This function creates a new message, stores it, and
tries
        to send it.
 function extern long lrun.create.and.send.export.done.messages.for.
          batch(domain daxch.cxch sxch,
                domain daxch.cbat sbat,
                domain daxch.long srun,
                domain daxch.pint stry,
                domain daxch.comp startup.company )
 pre   : srun > 0 and stry > 0. post  : For all subscriptions containing the
batch (sxch, sbat), an
                export done message has been created.
                If return then all created export done messages have
                accepted = yes; otherwise one or more messages have
                accepted = no. state : Before calling this function a retry
point must be set;
                after calling this function a commit must be given;
                no commit is given in this function. return: OK iff for all
subscriptions containing the batch (if any)
                an export done message has been successfully.
 function extern long lrun.create.and.send.import.done.message(
                domain daxch.link link,
                domain daxch.long srun,
                domain daxch.pint stry,
                domain daxch.comp startup.company )
 pre   : link is an existing exchange link; srun > 0 , stry > 0. post  : If
return an import done message has been sent to the
                source site, otherwise a rejected import done message
                has been created. state : Before calling this function a retry
point must be set;
                after calling this function a commit must be given;
        no commit is given in this function. return: Return value of
lmess.send.import.done(), library
        dadlllink_mess. desc  : This function is used to send an import done
message for an
        active exchange link.
 function extern lrun.create.batch.line.to.import(
                domain daxch.link link,
                domain daxch.long srun,
                domain daxch.pint stry,
                domain daxch.batl batl,
                domain daxch.path sfil )
 pre   : The batch to import defined by link, srun and stry exists;
        usually the batch line to import defined by link, srun, stry,
        batl does not yet exist, but if it does this is not a problem;
        batl and sfil are filled. post  : The batch line to import, specified by
the parameters,
        has been created (duplicates are skipped). state : Before calling this
function a retry point must be set;
        after calling this function a commit must be given;
        no commit is given in this function.
 function extern long lrun.create.batch.to.import(
                domain daxch.link link,
                domain daxch.long srun,
                domain daxch.pint stry,
                domain daxch.yesno cmpr,
                domain daxch.yesno ctrl,
                domain daxch.sepa sepa,
                domain daxch.sepa ench,
                domain daxch.flag flags,
                domain daxch.yesno cmpl )
 pre   : srun > 0, stry > 0 , cmpr, ctrl and cmpl are filled. post  : If return
then the batch to import, specified by the
        parameters, has been created (duplicates are skipped). state : Before
calling this function a retry point must be set;
        after calling this function a commit must be given;
        no commit is given in this function. return: True iff the batch to
import created successfully;
        false means: the exchange link does not exist or has status
        inactive (source/target).
 function extern lrun.create.export.done.message(
                domain daxch.link subs,
                domain daxch.envi tenv,
                domain daxch.comp tcom,
                domain daxch.long srun,
                domain daxch.pint stry )
 pre   : The subscription defined by subs, tenv, tcom exists.
        srun > 0, stry > 0.
        The export done message defined by subs, tenv, tcom, srun and
        stry does not yet exist. post  : The export done message, specified by
the parameters,
        has been created; this message has accepted = no. state : Before calling
this function a retry point must be set;
        after calling this function a commit must be given;
        no commit is given in this function.
 function extern long lrun.delete.batch.to.import(
                domain daxch.link link,
                domain daxch.long srun,
                domain daxch.pint stry,
                domain daxch.comp startup.company )
 pre   : true post  : If return then the batch to import, specified by
        link, srun and stry has been deleted, and
        the batch lines to import also have been deleted. state : Before calling
this function a retry point must be set;
        after calling this function a commit must be given;
        no commit is given in this function. return: True iff a batch to import
has been deleted.
 function extern lrun.delete.batches.to.import.of.link(
                domain daxch.link link )
 pre   : true post  : The batches to import of the exchange link (if any)
        have been deleted, and the batch lines to import of the link
        have also been deleted. state : Before calling this function a retry
point must be set;
        after calling this function a commit must be given;
        no commit is given in this function.
 function extern long lrun.delete.export.done.message(
                domain daxch.link subs,
                domain daxch.long srun,
                domain daxch.pint stry,
                domain daxch.envi tenv,
                domain daxch.comp tcom )
 pre   : true post  : If return then the export done message specified by
        the function parameter has been deleted. state : Before calling this
function a retry point must be set;
        after calling this function a commit must be given;
        no commit is given in this function. return: True iff the export done
message could be deleted.
        (False means: export done message did not exist.)
 function extern lrun.delete.export.done.messages.of.subscription(
                domain daxch.link subs )
 pre   : true post  : The export done messages of the subscription (if any)
        have been deleted. state : Before calling this function a retry point
must be set;
        after calling this function a commit must be given;
        no commit is given in this function.
 function extern lrun.delete.rejected.import.done.messages.of.link(
                domain daxch.link link )
 pre   : true post..: The rejected import done messages of the exchange link
        (if any) have been deleted. state : Before calling this function a retry
point must be set;
        after calling this function a commit must be given;
        no commit is given in this function.
 function extern lrun.end.sending( )
 pre   : true post  : The messaging channel (required for sending messages from
        source environment to target environment or the other way
        around) has been closed. desc  : After calling this function it is still
possible to send
        new messages, but after doing so this function must be called
        once again.
 function extern long lrun.export.done.message.exists(
                domain daxch.link subs,
                domain daxch.envi tenv,
                domain daxch.comp tcom,
                domain daxch.long srun,
                domain daxch.pint stry,
                ref domain daxch.yesno accepted )
 pre   : true post  : If return then accepted shows whether the export done
message
        has been accepted by the target site,
        otherwise accepted is empty. return: True iff the export done message
defined by subs, tenv, tcom,
        srun and stry exists.
 function extern long lrun.export.done.message.exists.for.export.run(
                domain daxch.cxch sxch,
                domain daxch.cbat sbat,
                domain daxch.long srun,
                domain daxch.pint stry )
 pre   : true post  : true return: True iff an export done message exists for
the regular
        export run specified by the parameters. desc  : This function is used to
check whether an entry in the
        log table can be deleted.
        This should not be done when there is a rejected export done
        message, because this export done message will need the
        information from the log table when it is resent.
        This should also not be done when there is an accepted export
        done message, because otherwise duplicates may occur when
        running the export again.
 function extern long lrun.get.next.batch.to.import.from.active.link(
                domain daxch.cxch txch,
                domain daxch.cbat tbat,
                ref domain daxch.link link,
                ref domain daxch.long srun,
                ref domain daxch.pint stry,
                ref domain daxch.yesno cmpr,
                ref string sepa(),
                ref domain daxch.sepa ench,
                ref domain daxch.flag flags,
                domain daxch.comp startup.company )
 pre   : true post  : If return then
        - link, srun and stry identify an existing batch to import
          of an active exchange link having the specified target
          exchange scheme and batch, and having completed = yes;
          if there are multiple batches to import for the exchange
          link, the values of srun and stry returned will always
          be the lowest run/try existing for that exchange link;
        - cmpr, sepa and ench will contain the settings for the
          ascii files of the batch to import;
        - flags will contain the special flags (if any).
        If not return then the ref parameters are not filled. return: True iff
an active link exists with one or more batches to
        import messages for the specified target exchange scheme
        and batch.
 function extern long lrun.read.source.file.names(
                domain daxch.link link,
                domain daxch.long srun,
                domain daxch.pint stry,
                long no.batch.lines,
                const domain daxch.batl batch.line(),
                ref domain daxch.path file.name() fixed,
                domain daxch.comp startup.company )
 pre   : no.batch.lines >= 0. post  : For all n <= no.batch.lines:
        file.name(n) contains the name of the source file (including
        directory, but without the system name) for the batch line
        specified by link, source run, source try and batch.line(n);
        file.name(n) contains an empty string if this batch line to
        import could not be found. return: true
 function extern long lrun.resend.export.done.messages(
                domain daxch.link subs.f,
                domain daxch.link subs.t,
                domain daxch.envi tenv.f,
                domain daxch.envi tenv.t,
                domain daxch.comp tcom.f,
                domain daxch.comp tcom.t )
 pre   : true post  : If return then all export done messages (if any) of
        subscriptions in the specified range have accepted = yes;
        otherwise one or more export done messages have accepted = no state : A
retry point is set and a commit is given. return: Whether all export done
messages (if any) have been sent
        successfully. desc  : The function tries to resend all export done
messages
        of subscriptions in the specified range having accepted = no.
 function extern long lrun.resend.export.done.messages.detailed(
                domain daxch.cxch sxch.f,
                domain daxch.cxch sxch.t,
                domain daxch.cbat sbat.f,
                domain daxch.cbat sbat.t,
                domain daxch.envi tenv.f,
                domain daxch.envi tenv.t,
                domain daxch.comp tcom.f,
                domain daxch.comp tcom.t,
                domain daxch.cxch txch.f,
                domain daxch.cxch txch.t,
                domain daxch.cbat tbat.f,
                domain daxch.cbat tbat.t )
 pre   : true post  : If return then all export done messages (if any) of
        subscriptions in the specified range have accepted = yes;
        otherwise one or more export done messages have accepted = no. state : A
retry point is set and a commit is given. return: Whether all export done
messages (if any) have been sent
        successfully. desc  : The function tries to resend all export done
messages
        of subscriptions in the specified range having accepted = no.
 function extern long lrun.resend.import.done.messages(
                domain daxch.link link.f,
                domain daxch.link link.t )
 pre   : true post  : If return then all rejected import done messages in the
        specified range (if any) have been sent successfully;
        otherwise one or more messages could not be delivered.
        All rejected import done messages sent successfully are deleted state :
A retry point is set and a commit is given. return: True iff all rejected import
done messages in the specified
        range (if any) have been sent successfully.
 function extern long lrun.resend.import.done.messages.detailed(
                domain daxch.envi senv.f,
                domain daxch.envi senv.t,
                domain daxch.comp scom.f,
                domain daxch.comp scom.t,
                domain daxch.cxch sxch.f,
                domain daxch.cxch sxch.t,
                domain daxch.cbat sbat.f,
                domain daxch.cbat sbat.t,
                domain daxch.cxch txch.f,
                domain daxch.cxch txch.t,
                domain daxch.cbat tbat.f,
                domain daxch.cbat tbat.t )
 pre   : true post  : If return then all rejected import done messages in the
        specified range (if any) have been sent successfully;
        otherwise one or more messages could not be delivered.
        All rejected import done messages sent successfully are deleted state :
A retry point is set and a commit is given. return: True iff all rejected import
done messages in the specified
        range (if any) have been sent successfully.
 function extern long lrun.send.current.import.done.message.and.commit()
 pre   : Record of daxch406 is filled with an existing rejected import
        done message. post  : If return = OK then the import done message has
been sent
        successfully and has been deleted. state : A retry point is set and a
commit is given (if return = OK). return: Return value of
lmess.send.import.done() in dadlllink_mess.
 function extern long lrun.send.export.done.messages.of.subscription(
                domain daxch.link subs,
                domain daxch.envi tenv,
                domain daxch.comp tcom )
 pre   : true post  : If return = OK then the message and all preceding messages
        have been sent successfully, else one or more of the messages
        for the exchange link could not be sent successfully.
        (Note: a message for run/try n will only be sent if all
        messages of the same subscription having run/try < n have
        been sent successfully.)
        After calling this function one or more times, function
        lrun.end.sending() must be called. state : Before calling this function
a retry point must be set;
        after calling this function a commit must be given;
        no commit is given in this function. return: Possible return values are
the same as return values for
        function lmess.send.export.done.message() in library
        dadlllink_mess. risk  : If the system goes down during this process, an
inconsistency
        between source and target system may exist (because a two
        phase commit is not available for multi-site).
 function extern long lrun.set.batch.to.import.to.completed(
                domain daxch.link link,
                domain daxch.long srun,
                domain daxch.pint stry )
 pre   : true post  : If return then the batch to import, specified by link,
srun
        and stry has been updated: 'Completed' has been set to yes. state :
Before calling this function a retry point must be set;
        after calling this function a commit must be given;
        no commit is given in this function. return: True iff the batch to
import exists and has been updated.