Example function to run a Processing Sequence

LANSA Composer

Example function to run a Processing Sequence

This example function runs the supplied TUT_01_P1 processing sequence.  It demonstrates all the key aspects of running a Processing Sequence from a LANSA application by calling function DXP1FN1:, including:

Exchange the Processing Sequence identifier

Populate and pass the Parameters working list

Receive the result of the Processing Sequence run

 

 

* --------------------------------------------------------

* This function runs the supplied TUT_01_P1 processing

* sequence, supplying parameter values as required

* --------------------------------------------------------

 

function options(*direct)

 

* --------------------------------------------------------

* working list for processing sequence parameters

* --------------------------------------------------------

def_list name(#dxparms) fields(#dxapnm #dxpvsq #dxpvvl) type(*working) entrys(100)

 

* --------------------------------------------------------

* set and exchange the processing sequence identifier

* (uses the internal identifier as shown on the Audit tab)

* --------------------------------------------------------

 

#dxp1ii := '2D123D3124F84042AFB1E931838DA90E'

exchange fields(#dxp1ii)

 

* --------------------------------------------------------

* provide named parameter values for the run

* --------------------------------------------------------

#dxpvsq := 1

 

#dxapnm := 'YOURINITIALS'

#dxpvvl := 'LA'

add_entry to_list(#dxparms)

 

#dxapnm := 'YOURMESSAGE'

#dxpvvl := 'This run was initiated by my LANSA application'

add_entry to_list(#dxparms)

 

#dxapnm := 'YOURNAME'

#dxpvvl := 'LANSA Application'

add_entry to_list(#dxparms)

 

* --------------------------------------------------------

* run the processing sequence

* --------------------------------------------------------

 

call process(*direct) function(DXP1FN1) pass_lst(#dxparms)

 

* --------------------------------------------------------

* test the result

* --------------------------------------------------------

 

if (#dxexrc = 'OK')

 

message msgtxt('Processing sequence run was successful')

 

else

 

message msgtxt('Processing sequence run ended abnormally')

 

endif

 

* --------------------------------------------------------

* that's all folks!

* --------------------------------------------------------

 

return