本文整理匯總了Java中org.pentaho.di.trans.TransMeta.getAttribute方法的典型用法代碼示例。如果您正苦於以下問題:Java TransMeta.getAttribute方法的具體用法?Java TransMeta.getAttribute怎麽用?Java TransMeta.getAttribute使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.pentaho.di.trans.TransMeta
的用法示例。
在下文中一共展示了TransMeta.getAttribute方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: callExtensionPoint
import org.pentaho.di.trans.TransMeta; //導入方法依賴的package包/類
@Override
public void callExtensionPoint( LogChannelInterface log, Object object ) throws KettleException {
if ( !( object instanceof TransMeta ) ) {
return;
}
TransMeta transMeta = (TransMeta) object;
String unitTestName = transMeta.getAttribute( DataSetConst.ATTR_GROUP_DATASET, DataSetConst.ATTR_TRANS_SELECTED_UNIT_TEST_NAME );
if (!Const.isEmpty( unitTestName )) {
// We're running in Spoon and there's a unit test selected : test it
//
System.out.println( "==== Running unit test on this transformation ====" );
transMeta.setVariable( DataSetConst.VAR_RUN_UNIT_TEST, "Y" );
}
}
示例2: checkTestPresent
import org.pentaho.di.trans.TransMeta; //導入方法依賴的package包/類
private boolean checkTestPresent(Spoon spoon, TransMeta transMeta) {
spoon.getLog().logBasic("Check test present...");
String testName = transMeta.getAttribute( DataSetConst.ATTR_GROUP_DATASET, DataSetConst.ATTR_TRANS_SELECTED_UNIT_TEST_NAME );
if (!Const.isEmpty( testName )) {
return false;
}
// there is no test defined of selected in the transformation.
// Show a warning
//
MessageBox box = new MessageBox(spoon.getShell(), SWT.OK | SWT.ICON_INFORMATION );
box.setMessage("Please create a test-case first by left clicking on the test icon.");
box.setText("First create a test-case");
box.open();
return true;
}
示例3: getData
import org.pentaho.di.trans.TransMeta; //導入方法依賴的package包/類
@Override
public void getData( TransMeta transMeta ) throws KettleException {
try {
String serviceName = transMeta.getAttribute( StreamingConst.STREAMING_GROUP, StreamingConst.STREAMING_SERVICE_NAME );
if ( Const.isEmpty( serviceName ) ) {
return;
}
MetaStoreFactory<StreamingService> rtFactory = new MetaStoreFactory<StreamingService>( StreamingService.class, transMeta.getMetaStore(), PentahoDefaults.NAMESPACE );
StreamingService streamingService = rtFactory.loadElement( serviceName );
if ( streamingService == null ) {
return;
}
wServiceName.setText( Const.NVL( streamingService.getName(), "" ) );
wServiceStep.setText( Const.NVL( streamingService.getStepname(), "" ) );
wServiceCacheDuration.setText( Const.NVL( streamingService.getCacheDuration(), "" ) );
wServiceCacheSize.setText( Const.NVL( streamingService.getCacheSize(), "" ) );
wPreloadService.setSelection( streamingService.isPreloaded() );
wClearOnStart.setSelection( streamingService.isClearingOnStart() );
wReplaceAtTransEnd.setSelection(streamingService.isCacheFlipping());
LogLevel logLevel = streamingService.getLogLevel()==null ? LogLevel.BASIC : streamingService.getLogLevel();
wLogLevel.select( logLevel.getLevel() );
} catch ( Exception e ) {
throw new KettleException( "Unable to load streaming service", e );
}
}
示例4: callExtensionPoint
import org.pentaho.di.trans.TransMeta; //導入方法依賴的package包/類
@Override
public void callExtensionPoint( LogChannelInterface log, Object object ) throws KettleException {
if ( !( object instanceof TransPainter ) ) {
return;
}
TransPainter painter = (TransPainter) object;
TransMeta transMeta = painter.getTransMeta();
String testName = transMeta.getAttribute( DataSetConst.ATTR_GROUP_DATASET, DataSetConst.ATTR_TRANS_SELECTED_UNIT_TEST_NAME);
// System.out.println("Drawing unit test usage/editing : '"+testName+"'");
drawUnitTestName( painter, transMeta, testName );
}
示例5: getCurrentUnitTest
import org.pentaho.di.trans.TransMeta; //導入方法依賴的package包/類
public TransUnitTest getCurrentUnitTest(TransMeta transMeta) throws MetaStoreException, KettleException {
// What is the unit test we are using?
//
String testName = transMeta.getAttribute( DataSetConst.ATTR_GROUP_DATASET, DataSetConst.ATTR_TRANS_SELECTED_UNIT_TEST_NAME );
if (Const.isEmpty( testName )) {
return null;
}
Spoon spoon = Spoon.getInstance();
List<DatabaseMeta> databases = getAvailableDatabases( spoon.getRepository() );
FactoriesHierarchy hierarchy = new FactoriesHierarchy( spoon.getMetaStore(), databases );
TransUnitTest unitTest = hierarchy.getTestFactory().loadElement( testName );
return unitTest;
}