Cancel
Showing results for 
Search instead for 
Did you mean: 

Worker Returns to Same Station

Valued Contributor
Valued Contributor

Hi,

 

Steffen provides a great example how to do this in the Broker Importer Control here, but it requires Workplaces. I need help accomplishing this without using workplaces.

 

The Broker Importer Control uses the PreviousLocation attribute of the worker, but it's left void when workplaces aren't used, so I manually record the previous location in the Station Importer Control into a user-defined variable of the worker. However, accessing the exporters table of the Stations from the Importer Receive Control to get the worker object isn't working. I get an error that the table does not exist when it clearly does because I can open it from the Station dialog.

 

param type : integer, -- Importer type (0=failure, 1=setup, 2=processing, 3=transport)
tbl  : table   -- Exporters

switch type
case 0 
	?.failImp.startProcessing
case 1 
	?.setupImp.startSetup
case 2
	worker := ?.exporters["Processing Exporter", i]
	worker.PreviousStation := ?
	?.imp.startProcessing
end

Thanks!