Michael_Coxson_5769

Limitation of AE scripting variable size

Discussion created by Michael_Coxson_5769 on Dec 28, 2016
Latest reply on Dec 29, 2016 by Michael_Coxson_5769
We were planning on creating a function that read Workflow tasks and presented a drop-down selection for what Task within the Workflow to act on as a part of a :READ statement, but it would appear that in larger Workflows this may not be possible due to a limitation of variable size of 1024 characters.

For instance, here is a snippet of the code to pull in Workflow Tasks:

SQL query:
select distinct OH_Name, JPP_OBJECT, JPP_LNR from OH, JPP, JPPA where oh_client=&$CLIENT# and oh_name='&WORKFLOW#' and oh_deleteflag=0 and OH_IDNR = JPP_OH_IDNR and JPP_OH_IDNR = JPPA_OH_IDNR and JPPA.JPPA_JPP_LNR = JPP.JPP_LNR and OH_IDNR > 100000 and JPP_OTYPE NOT in ('<FE>', '<END>', '<START>') order by JPP_LNR

AE Script:
!User input :beginread "To Inactivate a task inside a workflow, please provide the following:" :  READ &WORKFLOW#,,"WORKFLOW NAME","???.W??.?????",M :  READ &REQUESTID#,,"Request ID","",M :endread :SET &OBJECT_TYPE# = GET_OBJECT_TYPE("&WORKFLOW#") :IF &OBJECT_TYPE# <> "JOBP" :  STOP MSG, 50, "&WORKFLOW# NOT A WORKFLOW, EXITING" :ENDIF :SET &TASKS# = PREP_PROCESS_VAR(TOOLS.VSQLI.TASKS.IN.WORKFLOW) :PROCESS &TASKS# :  SET &TASKNAME# = GET_PROCESS_LINE(&TASKS#,3) :  SET &TASKNUMB# = GET_PROCESS_LINE(&TASKS#,4) :  SET &TASKLIST# = STR_CAT(&TASKLIST#, ",'&TASKNUMB# - &TASKNAME#'") :ENDPROCESS :CLOSE_PROCESS &TASKS# :BEGINREAD "SELECT TASK / TASKNUMBER PAIR TO SET INACTIVE" :  READ &OBJNAME#,"&TASKLIST#","SELECT TASK",,M :ENDREAD

For shorter Workflows, this functions properly:
i5rcj25uohsf.png

But for larger Workflows, the engine fails the execution prior to :READ due to the variable overflowing:
12/28/2016 2:42:01 PM -  U00020792 Runtime error in object 'TOOLS.JU.INACTIVATE.TASK.INSIDE.WORKFLOW.P3', line '00027': Value of paramter '2' too long. Allowed length is '1024'.

Is there any way to either modify the maximum variable value or perform this function in another way?  If we cannot dynamically pull lists of objects into a drop-down that will make maintenance and other functions a little more clunky and error-prone.

Minor point: There's a typo in the error message ("paramter" instead of "parameter")

Any help or suggestions would be appreciated.

Outcomes