ViewProcessor or Model Specification

I was trying to add Barrier Options (Equity) via web interface, but realized that this option is not available. Figured out that I need to start from scratch to add these options — something similar to what is being done in VanillaFXOptionPortfolioGeneratorTool. I tried something similar in EquityEuropeanDigitalsPortfolioGenerator
final ExerciseType european = new EuropeanExerciseType();

ExternalId test1 = ExternalSchemes.syntheticSecurityId(“TestingOption1”);

final EquityBarrierOptionSecurity barrierOption1 = new EquityBarrierOptionSecurity(OptionType.CALL,100,Currency.USD,test1,european,new Expiry(DateUtils.getUTCDate(2013, 5, 11)),0,"",BarrierType.UP,BarrierDirection.KNOCK_OUT,MonitoringType.DISCRETE,SamplingFrequency.ONE_LOOK,103);

again repeat of similar lines for other options. I override also similar methods as was done in that class.
Also in I added the following code (which is called in doRun())
private void loadBarrierPortfolio()
final Log log = new Log(“Creating example Barrier portfolio”);
try {
portfolioGeneratorTool().run(getToolContext(), BARRIER_PORTFOLIO_NAME, “EquityEuropeanDigitals”, true, null);
} catch (final RuntimeException t) {;

I am not sure where to specify the model to be used in evaluating the fair value of this option. For example in ViewDefinition if i just add this portfolio and specify value requirement as FairValue den it throws error. THis seems logical as no model has been specified for doing the calculation for this barrier option.

Any simple explanation on how to associate a model or engine for a portfolio/position?