SetSubWorkReturnData()

This code sample describes how to determine what type of information must be passed from a Sub-workflow back to the main workflow.

		Function Boolean SetSubWorkReturnData( \
			Object 		prgCtx, \
			WAPIWORK 	work, \
			Integer 	workID, \
			Integer 	returnWorkID, \
			Integer 	returnTaskID, \
			RecArray 	pkgs, \
			Dynamic 	data )
			
			Record 		r
			Boolean 	success = True

			//Locate the Table Values data type in the RecArray of data types
			//that have been added to the workflow. Then call the
			//UpdateSubWorkData() script which passes information from the
			//Sub-workflow back to the main workflow.

		for r in pkgs
			if ( ( r.TYPE == .fType ) && ( r.SUBTYPE == .fSubType ) )
				success = .UpdateSubWorkData( \
							prgCtx, \
							returnWorkID, \
							r.USERDATA, \
							data )
				break
			end
		end
	return( success )
end