GetSubMapData()

This code sample describes how to specify the name and location of the HTML file that is displayed to the creator of a workflow map when they define the Sub-workflow task that contains the Table Values data type in a workflow that also contains the Table Values data type.

		function Assoc GetSubmapData( \
			Object 		prgCtx, \
			Dynamic 	context, \
			Dynamic 	data, \
			Boolean 	loadData = True )
			
			DAPINODE 	node
			Dynamic 	retVal
			Record 		mapRec
			Record 		r
			String 		mapName
			Boolean 	found = False
			List 		passedValues = Undefined
			
			//Load the workflow map that will be used for the Sub-workflow
			//task.

		if ( IsDefined( data ) )
		if ( loadData )
		if ( IsDefined( context.SUBMAPID ) )
			node = DAPI.GetNodeByID( prgCtx.DapiSess(), \
					DAPI.BY_DATAID, context.SUBMAPID, True )
					
		if ( !IsError( node ) )
			mapName = node.pName
			mapRec = $WFMain.WFMapPkg.LoadMap( prgCtx, { \
					node, Undefined } )
		
			//Determine whether the Table Values data type is included in the
			//work package of the Sub-workflow task.

		if ( IsDefined( mapRec ) )
			for r in mapRec.WORK_PACKAGES
		if ( ( r.Type == .fType ) && \
			( r.SubType == .fSubType ) )
		found = True
		break
		end
		end
		end
	end
end

			//If the Table Values data type is included in the work package
			//of the Sub-workflow task, retrieve the data that must be passed
			//from the main workflow to the Sub-workflow.

		if ( found )
			for r in context.WORKPKGINFO
		if ( ( r.Type == .fType ) && \
			( r.SUBTYPE == .fSubType ) )
		if ( IsDefined( r.USERDATA ) )
			passedValues = r.USERDATA
		end
		break
		end
		end
	end
end

		retVal = Assoc.CreateAssoc()
		retVal.Data = Assoc.CreateAssoc()
		retVal.Data.taskInfo = context
		retVal.Data.Data = data
		retVal.Data.Found = found
		retVal.Data.Title = mapName
		retVal.Data.PassedValues = passedValues
		retVal.HTMLFile = 'submap_tablevalues.html'
		retVal.ModuleName = 'custmod'
	end
	return( retVal )
end