TaskPerformers for specific entities

Posts   
 
    
gavins
User
Posts: 3
Joined: 27-Feb-2006
# Posted on: 21-Apr-2006 08:50:40   

We have written templates which generate files for all tables in the database. How do we write task performers that generate only for a demarcated subset of the tables? Ideally we'd to mark each entity for which the template should be generated with a custom property of some value.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39786
Joined: 17-Aug-2003
# Posted on: 21-Apr-2006 15:08:43   

Derive a class from the CodeEmitter class in the TaskPerformers project (code is in the SDK) . In there, override the perform method. Then in your override, grab this list: executingGenerator.Entities.

Filter that list on the entities you want to execute the template on. Keep the original contents of the list in an arraylist around. call the base class' Perform method. when you come back, restore the original contents of the executingGenerator.Entities collection.

In the generator config task definition, instead of specifying CodeEmitter as the class to execute, you specify your derived class. That's it.

Frans Bouma | Lead developer LLBLGen Pro