Application Function Server

download Application Function Server

of 24

Transcript of Application Function Server

  • 7/23/2019 Application Function Server

    1/24

    BAAN IV

    Application Function Server (DRAFT)

    Developer Guide

  • 7/23/2019 Application Function Server

    2/24

    Template

    2

  • 7/23/2019 Application Function Server

    3/24

    Edition Control Chart

    Edition

    Date Status Changes Aectedpages

    0.1 1999/03/18

    0.2 2000/01/21

    NOTE added forhandsubprog

    11

    Docu!ent Authori"ation

    #repared Chec$ed Approved

    Na!e%Signature

    es!er "a#obs

    Date $ar#h 18% 1999

    Na!e%Signature

    Date

    Na!e%Signature

    Date

    Na!e%Signature

    Date

    Na!e%Signature

    Date

    Template

    3

  • 7/23/2019 Application Function Server

    4/24

    Docu!ent in&or!ation

    Docu!ent

    Do#u&en! #ode 'Do#u&en! group ' Develop&en! Do#u&en!sDo#u&en! !i!le '(ppli#a!ion )un#!ion *erver + ,ser GuideEdi!ion '0.1$on!h &odi-ed ' 99/03

    Chec$ the BaanDoc data'ase to see i& this docu!ent is still avalid edition

    Template

    4

  • 7/23/2019 Application Function Server

    5/24

    Ta'le o& contents

    Introduction 1.1 urpose 11.2 *#ope 11.3 De-ni!ions% a#ron&s and abbrevia!ions 11. eferen#es 1

    1. Overvie 11.4 evision infor&a!ion 1

    * Application Function Server *2.1 5n!rodu#!ion 22.2 (r#hi!e#!ure 22.3 *!ru#!ure of !he ()* 3

    + ,-. Engine #ri!itives ,3.1 5n!rodu#!ion 3.2 Ge! )ield 6alue fro& *ession 3.3 *e! )ield 6alue in *ession 3. 5nser! e#ord in *ession 3. ,pda!e e#ord in *ession 3.4 Dele!e e#ord fro& *ession 3.7 o&&i! *ession ,pda!es !o Da!abase 43.8 (bor! *ession ,pda!es 43.9 *e! urren! e#ord for *ession 73.10 rose *ession e#ords 73.11 *e! urren! 6ie for *ession 73.12 rose *ession 6ies 83.13 *end :*!ar! pro#essing; o&&and !o *ession 83.1 *e! *ession epor! ara&e!ers 93.1 *end :rin!; o&&and !o *ession 93.14 End *ession 9

    3.17 E

  • 7/23/2019 Application Function Server

    6/24

    Appendix A AFS Example

    #urpose

    This do#u&en! is designed !o serve as a referen#e guide for !heaan (ppli#a!ion )un#!ion *erver @()*A. 5! #overs bo!h ar#hi!e#!ureof and progra&&ing i!h !he ()*. ,pon #o&ple!ion of !hisdo#u&en! !he reader ill have !he ne#essar Bnoledge !o &odife

  • 7/23/2019 Application Function Server

    7/24

    Appendix A AFS Example

    : Introduction

    The preferred &e!hod of in!egra!ion be!een aan @version # or

    grea!erA and !hird par! produ#!s is b &eans of usiness Ob?e#!

    5n!erfa#es or O5s. O5s provide an (ppli#a!ion rogra& 5n!erfa#e@(5A for !he aan business logi#. The high level in!erfa#es providedb !he O5s #anno! be used dire#!l agains! !he aan business logi#due !o !he aan ar#hi!e#!ure. The business logi# is i&ple&en!ed b&eans of sessions hi#h are pri&aril user in!erfa#e based.rogra&&a!i# a##ess !o sessions is provided b &eans of a lo level&essage pro!o#ol. This &essage pro!o#ol is en#apsula!ed in!o a se!of fun#!ion pri&i!ives #alled !he (ppli#a!ion )un#!ion *erver @()*A.

    The O5 #ode a##esses !he session business logi# b &eans of !he()*. The publi#% high level in!erfa#es eThe O5 progra&&ing #ons!ru#!s are e

  • 7/23/2019 Application Function Server

    8/24

    Appendix A AFS Example

    ; Architecture

    The folloing diagra& shos !he role of !he ()* in !he O5

    ar#hi!e#!ure. The diagra& #learl illus!ra!es !ha! !he O5 :!alBs; !o

    !he underling aan session b &eans of !he ()*.

    3 Structure o& the AFS

    The s!ru#!ure of !he ()* #an bes! be des#ribed b looBing a! ane

  • 7/23/2019 Application Function Server

    9/24

    Appendix A AFS Example

    < Introduction

    5n all ()* fun#!ions here a session is &en!ioned as a para&e!er%

    !he session ill be au!o&a!i#all s!ar!ed if i! is no! alread running.

    -et Field Value &ro! Session

    S=NTA>

    void s!papi.ge!.-eld@s!ring session% s!ring -eld% ref s!ring value% longele&en!A

    AR-?@ENTS

    session Na&e of !he session !his #o&&and is eelement (rra ele&en! hose value is !o be re!urned in !he#ase of arras or repea!ing -elds.

    DESCRI#TI7N

    This re!urns !he #urren! value of a par!i#ular -eld fro& a spe#i-edrunning aan session.

    RET?RN VA.?ESNone

    * Set Field Value in Session

    S=NTA>

    void s!papi.pu!.-eld@s!ring session% s!ring -eld% s!ring value% longele&en!A

    AR-?@ENTS

    Template

    4

    +,-. Engine #ri!itives

    +

  • 7/23/2019 Application Function Server

    10/24

    Appendix A AFS Example

    session Na&e of !he session !his #o&&and is e

    void s!papi.inser!@s!ring session% long do.upda!e% ref s!ring err.&esgA

    AR-?@ENTS

    session Na&e of !he session !his #o&&and is eThis inser!s !he #urren! re#ord of !he spe#i-ed session in!o !heda!abase. The values of !he -elds in !he session &us! be se! prior !o

    #alling !his fun#!ion. 5f err.mesgis -lled !hen s!papi.re#over@A &us!be #alled before an o!her s!papi.J #o&&ands are issued !o !hissession.

    RET?RN VA.?ES

    None

    , ?pdate Record in Session

    S=NTA>

    void s!papi.upda!e@s!ring session% long do.upda!e% ref s!ringerr.&esgA

    Template

    5

  • 7/23/2019 Application Function Server

    11/24

    Appendix A AFS Example

    AR-?@ENTS

    session Na&e of !he session !his #o&&and is eThis upda!es !he #urren! re#ord of !he spe#i-ed session in !heda!abase. The values of !he -elds in !he session &us! be se! prior !o#alling !his fun#!ion. 5f err.mesgis -lled !hen s!papi.re#over@A &us!be #alled before an o!her s!papi.J #o&&ands are issued !o !hissession.

    RET?RN VA.?ES

    None

    6 Delete Record &ro! Session

    S=NTA>

    void s!papi.dele!e@s!ring session% long do.upda!e% ref s!ring err.&esgA

    AR-?@ENTS

    session Na&e of !he session !his #o&&and is eThis dele!es !he #urren! re#ord of !he spe#i-ed session in !heda!abase. The values of !he -elds in !he session &us! be se! prior !o#alling !his fun#!ion. 5f err.mesgis -lled !hen s!papi.re#over@A &us!be #alled before an o!her s!papi.J #o&&ands are issued !o !hissession.

    RET?RN VA.?ES

    Template

    6

  • 7/23/2019 Application Function Server

    12/24

    Appendix A AFS Example

    None

    9 Co!!it Session ?pdates to Data'aseS=NTA>

    void s!papi.save@s!ring session% ref s!ring err.&esgA

    AR-?@ENTS

    session Na&e of !he session !his #o&&and is eDESCRI#TI7N

    This e

  • 7/23/2019 Application Function Server

    13/24

    Appendix A AFS Example

    AR-?@ENTS

    session Na&e of !he session !his #o&&and is e

    long s!papi.brose.se!@s!ring session% s!ring op!ionA

    AR-?@ENTS

    session Na&e of !he session !his #o&&and is eDESCRI#TI7N

    This e

    long s!papi.#hange.vie@s!ring sessionA

    AR-?@ENTS

    session Na&e of !he session !his #o&&and is e

  • 7/23/2019 Application Function Server

    14/24

    Appendix A AFS Example

    This se!s !he #urren! vie for sessions using for&s of !pe 3@&ul!iple o##urren#e plus vieA. The -eld values of !he vie -elds

    &us! be se! prior !o #alling !his fun#!ion.RET?RN VA.?ES

    0 No vie found

    1 6ie found

    2 (no!her vie found

    * Bro8se Session Vie8s

    S=NTA>

    long s!papi.brose.vie@s!ring session% s!ring op!ionA

    AR-?@ENTSsession Na&e of !he session !his #o&&and is eDESCRI#TI7N

    This e

    void s!papi.#on!inue.pro#ess@s!ring session% ref s!ring err.&esgA

    AR-?@ENTS

    session Na&e of !he session !his #o&&and is eDESCRI#TI7N

    This #auses !he #hoi#e op!ion :#on!.pro#ess; !o be e

  • 7/23/2019 Application Function Server

    15/24

    Appendix A AFS Example

    None

    *+ Set Session Report #ara!etersS=NTA>

    void s!papi.se!.repor!@s!ring session% s!ring repor!na&e% s!ringdevi#e% s!ring err.&esgA

    AR-?@ENTS

    session Na&e of !he session !his #o&&and is eDESCRI#TI7N

    This sele#!s !he repor! !o be prin!ed and !he devi#e !o be prin!ed !ohen !he s!papi.prin!.repor!@A is #alled.

    RET?RN VA.?ES

    None

    *, Send #rint Co!!and to Session

    S=NTA>

    void s!papi.prin!.repor!@s!ring session% ref s!ring err.&esgA

    AR-?@ENTS

    session Na&e of !he session !his #o&&and is eDESCRI#TI7N

    This #auses !he #hoi#e op!ion :prin!.da!a; !o be e

    void s!papi.end.session@s!ring sessionA

    Template

    10

  • 7/23/2019 Application Function Server

    16/24

    Appendix A AFS Example

    AR-?@ENTS

    session Na&e of !he session !his #o&&and is e

    void s!papi.appli#a!ion.op!ion@s!ring session% long for&% long op!ion%

    ref s!ring err.&esgAAR-?@ENTS

    session Na&e of !he session !his #o&&and is eThis e

    void s!papi.oo&.op!ion@s!ring session% long for&% s!ring oo&.prog%ref s!ring err.&esgA

    AR-?@ENTS

    session Na&e of !he session !his #o&&and is e

  • 7/23/2019 Application Function Server

    17/24

    Appendix A AFS Example

    depend on a par!i#ular for& being a#!ive hen !heoo& is eDESCRI#TI7N

    This e

    This se! !he a#!ion !ha! is !aBen hen !he spe#i-ed subsession isinvoBed fro& !he spe#i-ed session.

    Template

    12

  • 7/23/2019 Application Function Server

    18/24

    Appendix A AFS Example

    RET?RN VA.?ES

    None

    C7@@ENTLhen !he sub pro#esses is a du&& session i!hou! for& !hen i! isno! possible !o #o&&uni#a!e i!h !he session via !he fun#!ionserver. 5n su#h #ases i! is also no! possible !o de-ne !he a#!ion for!he sub sessions of !his du&& pro#ess.

    )or !his si!ua!ion ou #an de-ne !he a#!ion for !he sub pro#esses of!he du&& session in !he group session @session here !he pid is!he sa&e as !he gid of !his subsession in !he pro#esslis!A. (nd !hedu&& session should be de-ned i!h a#!ion ignore.

    *3 -et .ast Error @essage &ro! Session

    S=NTA>

    s!ring s!papi.ge!.&ess.#ode@s!ring sessionA

    AR-?@ENTS

    session Na&e of !he session !his #o&&and is e+< Set Ans8ers to uestions in Session

    S=NTA>

    void s!papi.enu&.anser@s!ring session% s!ring Cues!ion% bse!anserA

    AR-?@ENTS

    session Na&e of !he session !his #o&&and is e

  • 7/23/2019 Application Function Server

    19/24

    Appendix A AFS Example

    This se!s !he ansers !o Cues!ions !ha! o##ur hile !he session ise

    D,*(GE

    )un#!ion !o se! (rea @ !#s0.#reg A in session !#s01&000

    arg' H value !o pu! in (rea

    ENDD,*(GE

    s!papi.pu!.-eld@ P!#s01&000P% P!#s0.#regP% value A

    Q

    fun#!ion e

    D,*(GE

    Template

    14

    ,Appendi/ A 0 AFS E/a!ple

  • 7/23/2019 Application Function Server

    20/24

    Appendix A AFS Example

    )un#!ion !o ge! (rea @ !#s0.#reg A fro& session!#s01&000

    re!urn' H value of (rea

    ENDD,*(GE

    s!ring value@3A

    s!papi.ge!.-eld@ P!#s01&000P% P!#s0.#regP% value A

    re!urn@ value A

    Q

    fun#!ion e

    !#ds#a value A

    D,*(GE

    )un#!ion !o se! !#s0.ds#a @ !#s0.ds#a A in session!#s01&000

    arg' H value !o pu! in !#s0.ds#a

    ENDD,*(GE

    s!papi.pu!.-eld@ P!#s01&000P% P!#s0.ds#aP% value A

    Q

    fun#!ion e

    D,*(GE

    )un#!ion !o ge! !#s0.ds#a @ !#s0.ds#a A fro& session!#s01&000

    re!urn' H value of !#s0.ds#a

    ENDD,*(GE

    s!ring value@30A &b

    s!papi.ge!.-eld@ P!#s01&000P% P!#s0.ds#aP% value A

    re!urn@ value A

    Q

    fun#!ion e

    Template

    15

  • 7/23/2019 Application Function Server

    21/24

    Appendix A AFS Example

    D,*(GE

    )un#!ion !o end #onne#!ion !o session !#s01&000

    ENDD,*(GE

    s!papi.end.session@ P!#s01&000P A

    Q

    fun#!ion e

    D,*(GE

    )un#!ion !o inser! a re#ord in session !#s01&000

    )ields &us! be pu! before #alling !his fun#!ion

    ENDD,*(GE

    s!papi.inser!@ P!#s01&000P% do.upda!e% error A

    Q

    fun#!ion e

    D,*(GE

    )un#!ion !o upda!e a re#ord in session !#s01&000

    e#ord &us! be &ade #urren! and -elds !o be #hanged before#alling

    !his fun#!ion

    ENDD,*(GE

    s!papi.upda!e@ P!#s01&000P% do.upda!e% error A

    Q

    fun#!ion e

    D,*(GE

    )un#!ion !o dele!e a re#ord in session !#s01&000

    e#ord &us! be &ade #urren! before #alling !his fun#!ion

    Template

    16

  • 7/23/2019 Application Function Server

    22/24

    Appendix A AFS Example

    ENDD,*(GE

    s!papi.dele!e@ P!#s01&000P% do.upda!e% error A

    Q

    fun#!ion e

    D,*(GE

    )un#!ion !o save an upda!e/inser!/dele!e in session!#s01&000

    ENDD,*(GE

    s!papi.save@ P!#s01&000P% error A

    Q

    fun#!ion e

    D,*(GE

    )un#!ion !o -nd a re#ord in session !#s01&000

    *ear#h -elds &us! be pu! before #alling !his fun#!ion

    ENDD,*(GE

    re!urn@ s!papi.-nd@ P!#s01&000P A A

    Q

    fun#!ion e

    D,*(GE

    )un#!ion !o -nd !he -rs! re#ord in session !#s01&000

    ENDD,*(GE

    re!urn@ s!papi.brose.se!@ P!#s01&000P% P-rs!.se!P A A

    Q

    fun#!ion e

    D,*(GE

    Template

    17

  • 7/23/2019 Application Function Server

    23/24

    Appendix A AFS Example

    )un#!ion !o -nd !he ne

    ENDD,*(GE

    re!urn@ s!papi.brose.se!@ P!#s01&000P% Pne

    Q

    fun#!ion e

    D,*(GE

    )un#!ion !o -nd !he previous re#ord in session !#s01&000

    ENDD,*(GE

    re!urn@ s!papi.brose.se!@ P!#s01&000P% Pprev.se!P A A

    Q

    fun#!ion e

    D,*(GE

    )un#!ion !o -nd !he las! re#ord in session !#s01&000

    ENDD,*(GEre!urn@ s!papi.brose.se!@ P!#s01&000P% Plas!.se!P A A

    Q

    fun#!ion e

    D,*(GE

    )un#!ion !o undo an upda!e/inser!/dele!e in session!#s01&000

    ENDD,*(GE

    s!papi.re#over@ P!#s01&000P% error A

    Q

    fun#!ion e

    D,*(GE

    Template

    18

  • 7/23/2019 Application Function Server

    24/24

    Appendix A AFS Example

    )un#!ion !o ge! !he #ode of !he &essage hi#h o##urred on

    !he las! inser!/upda!e/dele!e/save/re#over a#!ion in session

    !#s01&000

    ENDD,*(GE

    re!urn@ s!papi.ge!.&ess.#ode@ P!#s01&000P A A

    Q

    fun#!ion e

    D,*(GE)un#!ion !o de-ne an a#!ion hen a sub pro#ess is s!ar!ed.

    ossible a#!ions are' add/send/ignore/Bill

    add H add #hild session !o in!ernal s!ru#!ure%

    session dll of #hild #an be used

    send H send all api #alls !o #hild ins!ead of paren!

    ignore H #hild pro#ess is ignored% paren! ill ai!

    un!il #hild e

    D,*(GE)un#!ion !o de-ne an anser on a Cues!ion% hen !he defaul!

    anser should no! be !aBen.

    ENDD,*(GE

    s!papi.enu&.anser@ P!#s01&000P% Cues!ion% anser A

    Q

    Template

    19