package depart.dorsal.taches;

import static ca.ntro.app.tasks.backend.BackendTasks.*;

import ca.ntro.app.tasks.backend.BackendTasks;
import depart.commun.messages.MsgA;
import depart.commun.modeles.ModeleA;

public class TachesG {
	
	public static void creerTaches(BackendTasks tasks) {

		tasks.taskGroup("TachesG")

		     .waitsFor(model(ModeleA.class))
		
		     .contains(subTasks -> {
		    	  
		    	 tacheG1(subTasks);

		     });
	}

	private static void tacheG1(BackendTasks subTasks) {

		subTasks.task("tacheG1")

		     .waitsFor(model(ModeleA.class))

		     .waitsFor(message(MsgA.class))

		     .executes(inputs -> {

		    	 var objA = inputs.get(message(MsgA.class));
		    	 var objB = inputs.get(model(ModeleA.class));

		    	 objA.methodeA(objB);

		     });
	}

}
