public static DQPWorkContext buildWorkContext(TransformationMetadata metadata) {
return buildWorkContext(metadata, metadata.getVdbMetaData());
}
public static DQPWorkContext buildWorkContext(QueryMetadataInterface metadata, VDBMetaData vdb) {
DQPWorkContext workContext = new DQPWorkContext();
SessionMetadata session = new SessionMetadata();
workContext.setSession(session);
session.setVDBName(vdb.getName());
session.setVDBVersion(vdb.getVersion());
session.setSessionId(String.valueOf(1));
session.setUserName("foo"); //$NON-NLS-1$
session.setVdb(vdb);
workContext.getVDB().addAttchment(QueryMetadataInterface.class, metadata);
if (metadata instanceof TransformationMetadata) {
workContext.getVDB().addAttchment(TransformationMetadata.class, (TransformationMetadata)metadata);
}
DQPWorkContext.setWorkContext(workContext);
return workContext;
}