RoddyJ_9230

PUBLISH an array to WORKFLOW availability to other jobs

Discussion created by RoddyJ_9230 on May 11, 2017
Latest reply on May 14, 2017 by Wolfgang_Brueckler_1288
I'm trying to PUBLISH an array defined and populated in the first job within a Workflow so that the array will be available to a CALL object within the same Workflow.  The array is being created correctly in the first job as I can unload and PRINT it after creation.  But when I PUBLISH the array it does not seem to be available for CALL object.   If I do not DEFINE the array in the CALL object I get the error message "line '00005'. 'U01001340 The array 'RPT_ARRAY#' has not yet been defined.'.".  If I do DEFINE the array in the CALL object it's essentially empty when I try to attach the contents to the notification tab of the Call object.

Code on the Post Process tab of the 1st job object:
:DEFINE &ARRAY#, string, 32 :PRINT "JOB RUNID:  &JOBRUNID#" :SET &IDX# = 1 :SET &IDX# = FORMAT(&IDX#) :SET &LEN# = LENGTH(&ARRAY#[]) :SET &HND# = PREP_PROCESS_REPORT(,,,"*INFO*") :PROCESS &HND# :   SET &ARRAY#[&IDX#] = GET_PROCESS_LINE(&HND#) :   SET &IDX# = ADD(&IDX#,1) :   SET &IDX# = FORMAT(&IDX#) :   PRINT "IDX Currently at:  &IDX#" :ENDPROCESS :CLOSE_PROCESS &HND# :PUBLISH &ARRAY#[], RPT_ARRAY#, "WORKFLOW" :SET &IDX# = 1 :SET &IDX# = FORMAT(&IDX#) :SET &LEN# = LENGTH(&ARRAY#[]) :PRINT "Unloading the ARRAY object" :WHILE &IDX# LE &LEN# :   P "Line &IDX#: &ARRAY#[&IDX#]" :   SET &IDX# = ADD(&IDX#,1) :   SET &IDX# = FORMAT(&IDX#) :ENDWHILE
Code on the 2nd (CALL) object Process tab:
:SET &IDX# = 1 :SET &IDX# = FORMAT(&IDX#) :SET &LEN# = LENGTH(&RPT_ARRAY#[]) :PRINT "RPT_LENGTH: &LEN#" :PRINT "Unloading the RPT_ARRAY object" :WHILE &IDX# LE &LEN# :   PRINT "Current Array Entry:  &RPT_ARRAY#[&IDX#]" :   PUT_ATT_APPEND CALL_TEXT = &RPT_ARRAY#[&IDX#] :   SET &IDX# = ADD(&IDX#,1) :   SET &IDX# = FORMAT(&IDX#) :ENDWHILE
  
Thanks for any assistance you can provide.

Outcomes