PutSubMapData()
This code sample describes how to save the information that the creator of a workflow map specified when defining data type information for a Sub-workflow step (on the Sub-Map Step Definition page).
function Assoc PutSubMapData( \
Object prgCtx, \
Dynamic context, \
Dynamic data, \
Record r )
Assoc commentData
Assoc retVal
List valsToPass
Record pkgRec
Record rec
String name
//Locate the Table Values data type in the RecArray of data types
//associated with a workflow.
for rec in context.WorkPkgInfo
if ( ( rec.Type == .fType ) && ( rec.SubType == .fSubtype ) )
pkgRec = rec
break
end
end
//If information about the Table Values data type has not yet
//been passed to the Sub-workflow task, add a new Record to the
//RecArray. This Record contains the list of workflow attributes
//that should be passed from the main workflow to the sub-
//workflow.
if ( !IsDefined( pkgRec ) )
pkgRec = $LLIAPI.RecArrayPkg.NewRecord( context.WORKPKGINFO )
pkgRec.Type = .fType
pkgRec.SubType = .fSubType
end
//Save the list of workflow attributes that should be passed to
//the Sub-workflow. This is the same list of attributes that
//determines which workflow attributes should be passed from the
//Sub-workflow back to the main workflow.
for name in Assoc.Keys( data.Fields )
if ( IsFeature( r, name ) )
valsToPass = { @valsToPass, name }
end
end
pkgRec.USERDATA = valsToPass
retVal.OK = TRUE
return( retVal )
end