package depart.frontal.taches;


import depart.commun.modeles.ModeleA;
import depart.frontal.vues.VueA;

import static ca.ntro.app.tasks.frontend.FrontendTasks.*;

import ca.ntro.app.tasks.frontend.FrontendTasks;


public class TachesD {
	
	public static void creerTaches(FrontendTasks tasks) {

		tasks.taskGroup("TachesD")
		
		     .waitsFor("tacheC1")

		     .contains(subTasks -> {
		    	 
		    	 tache1(subTasks);

		     });
	}

	private static void tache1(FrontendTasks tasks) {
		
		tasks.task("tacheD1")
		
			 .waitsFor(modified(ModeleA.class))
			 
			 .waitsFor(created(VueA.class))

		     .executes(inputs -> {
		    	 
		    	 var objA = inputs.get(created(VueA.class));
		    	 var objB = inputs.get(modified(ModeleA.class));
		    	 
		    	 objB.currentValue().methodeC(objA);

		     });
	}

}