}
public ScopeDAO createScope(ScopeDAO parentScope, String name, int scopeModelId) {
entering("ProcessInstanceDaoImpl.createScope");
HScope scope = new HScope();
scope.setParentScope(parentScope != null
? (HScope)((ScopeDaoImpl)parentScope).getHibernateObj()
: null);
scope.setName(name);
scope.setScopeModelId(scopeModelId);
scope.setState(ScopeStateEnum.NEW.toString());
scope.setInstance(_instance);
scope.setCreated(new Date());
// _instance.addScope(scope);
getSession().save(scope);
return new ScopeDaoImpl(_sm, scope);
}