### Definição de tipos
type request_file;
type environment_layers;
type occurrences_file;
type serialized_model;
type projected_map;

type modeling_results {
	serialized_model model;
	projected_map map;
}

### Mapeando variáveis ao fs
request_file requests[] <ext;exec="species_mapper.sh",o=@filename(occurrences)>;
environment_layers env_layers[] <filesys_mapper;location="workshop/Brasil_ASC/", suffix=".asc">;
occurrences_file occurrences <single_file_mapper;file="teste.txt">;
modeling_results results[] <ext;exec="modeling_results_mapper.sh",o=@filename(occurrences)>;

### Definição das apps
app (request_file out[]) generate_requests(occurrences_file i) {
	generate_requests @filename(i);
}

app (modeling_results out) do_modeling(request_file r, environment_layers e[], occurrences_file o) {
	om_console @filename(r);
}

### Início do script
requests = generate_requests(occurrences);

foreach request,index in requests {
  results[index] = do_modeling(request, env_layers, occurrences);
}

### Definição de tipos
type request_file;
type environment_layers;
type occurrences_file;
type serialized_model;
type projected_map;

type modeling_results {
	serialized_model model;
	projected_map map;
}

### Mapeando variáveis ao fs
request_file requests[] <ext;exec="species_mapper.sh",o=@filename(occurrences)>;
environment_layers env_layers[] <filesys_mapper;location="workshop/Brasil_ASC/", suffix=".asc">;
occurrences_file occurrences <single_file_mapper;file="./teste.txt">;
modeling_results results[] <ext;exec="modeling_results_mapper.sh",o=@filename(occurrences)>;

### Definição das apps
app (request_file out[]) generate_requests(occurrences_file i) {
	generate_requests @filename(i);
}

app (modeling_results out) do_modeling(request_file r, environment_layers e[]) {
	om_console @filename(r);
}

### Início do script
requests = generate_requests(occurrences);

foreach request,index in requests {
  results[index] = do_modeling(request, env_layers);
	trace(requests[index]);
}

--- 
+++ 
@@ -13,7 +13,7 @@
 ### Mapeando variáveis ao fs
 request_file requests[] <ext;exec="species_mapper.sh",o=@filename(occurrences)>;
 environment_layers env_layers[] <filesys_mapper;location="workshop/Brasil_ASC/", suffix=".asc">;
-occurrences_file occurrences <single_file_mapper;file="./teste.txt">;
+occurrences_file occurrences <single_file_mapper;file="teste.txt">;
 modeling_results results[] <ext;exec="modeling_results_mapper.sh",o=@filename(occurrences)>;
 
 ### Definição das apps
@@ -21,7 +21,7 @@
 	generate_requests @filename(i);
 }
 
-app (modeling_results out) do_modeling(request_file r, environment_layers e[]) {
+app (modeling_results out) do_modeling(request_file r, environment_layers e[], occurrences_file o) {
 	om_console @filename(r);
 }
 
@@ -29,6 +29,5 @@
 requests = generate_requests(occurrences);
 
 foreach request,index in requests {
-  results[index] = do_modeling(request, env_layers);
-	trace(requests[index]);
+  results[index] = do_modeling(request, env_layers, occurrences);
 }
Change the do_modeling app to receive a occurrences file
