3 jun 2008

Integration Broker (Parte 8) Version Tools hasta 8.46

People code de Publicación de MESSAGES

Local Message &MSG;

&MSG = CreateMessage(Message.SCHOOL_SYNC);

If &MSG.IsActive Then
&MSG.CopyRowsetDelta(GetRowset());
&MSG.Publish();
End-if;


Peoplecode de Suscripción de MESSAGES
(Este código esta en el Mensaje y se ejecuta cuando llega Mensaje.)

Local Message &Message;
Local Rowset &Rowset;
Local Record &rSCHOOL, &Record;
&Message = GetMessage();
&rSCHOOL = CreateRecord(Record.PSU_SCHOOL_TBL);
&Rowset = &Message.GetRowset();
/* Multiple level 0 rows may exist in AE batch programs,
but not with online panel processing... */
&Record = &Rowset(1).PSU_SCHOOL_TBL;
&Action = &Message.GetRowset()(1).PSCAMA.AUDIT_ACTN.Value;
Evaluate &Action
When = "A"
/* School was added in the publication database, so add it in this database. */

/* New high order key inserted in publishing node */
&Record.CopyFieldsTo(&rSCHOOL);
&rSCHOOL.Insert();
When = "C"
/* School was changed in the publication database, so update it in this database. */

&Record.CopyFieldsTo(&rSCHOOL);
&Update = &rSCHOOL.Update();
/* School does not exist in this database, so add it instead */
If &Update = False Then
&rSCHOOL.Insert();
End-If;


Propiedades de Peoplecode de Suscripción:



No hay comentarios: