当前位置: 首页>>代码示例>>Java>>正文


Java TransGraph.getCurrentStep方法代码示例

本文整理汇总了Java中org.pentaho.di.ui.spoon.trans.TransGraph.getCurrentStep方法的典型用法代码示例。如果您正苦于以下问题:Java TransGraph.getCurrentStep方法的具体用法?Java TransGraph.getCurrentStep怎么用?Java TransGraph.getCurrentStep使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.pentaho.di.ui.spoon.trans.TransGraph的用法示例。


在下文中一共展示了TransGraph.getCurrentStep方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: clearInputDataSet

import org.pentaho.di.ui.spoon.trans.TransGraph; //导入方法依赖的package包/类
public void clearInputDataSet() {
  Spoon spoon = ( (Spoon) SpoonFactory.getInstance() );
  TransGraph transGraph = spoon.getActiveTransGraph();
  TransMeta transMeta = spoon.getActiveTransformation();
  StepMeta stepMeta = transGraph.getCurrentStep();
  if ( transGraph == null || transMeta == null || stepMeta == null ) {
    return;
  }

  stepMeta.setAttribute( DataSetConst.ATTR_GROUP_DATASET, DataSetConst.ATTR_STEP_DATASET_INPUT, null );
  transGraph.redraw();
}
 
开发者ID:mattcasters,项目名称:pentaho-pdi-dataset,代码行数:13,代码来源:DataSetHelper.java

示例2: clearGoldenDataSet

import org.pentaho.di.ui.spoon.trans.TransGraph; //导入方法依赖的package包/类
public void clearGoldenDataSet() {
  Spoon spoon = ( (Spoon) SpoonFactory.getInstance() );
  TransGraph transGraph = spoon.getActiveTransGraph();
  TransMeta transMeta = spoon.getActiveTransformation();
  StepMeta stepMeta = transGraph.getCurrentStep();
  if ( transGraph == null || transMeta == null || stepMeta == null ) {
    return;
  }

  stepMeta.setAttribute( DataSetConst.ATTR_GROUP_DATASET, DataSetConst.ATTR_STEP_DATASET_GOLDEN, null );
  transGraph.redraw();
}
 
开发者ID:mattcasters,项目名称:pentaho-pdi-dataset,代码行数:13,代码来源:DataSetHelper.java

示例3: createDataSetFromStep

import org.pentaho.di.ui.spoon.trans.TransGraph; //导入方法依赖的package包/类
/**
 * Create a new data set with the output from 
 */
public void createDataSetFromStep() {
  Spoon spoon = ( (Spoon) SpoonFactory.getInstance() );
  TransGraph transGraph = spoon.getActiveTransGraph();
  IMetaStore metaStore = spoon.getMetaStore();
  if ( transGraph == null ) {
    return;
  }
  StepMeta stepMeta = transGraph.getCurrentStep();
  TransMeta transMeta = spoon.getActiveTransformation();
  if ( stepMeta == null || transMeta == null ) {
    return;
  }

  try {
    MetaStoreFactory<DataSetGroup> groupFactory = new MetaStoreFactory<DataSetGroup>( DataSetGroup.class, metaStore, PentahoDefaults.NAMESPACE );
    List<DatabaseMeta> databases = getAvailableDatabases( spoon.getRepository() );
    groupFactory.addNameList( DataSetConst.DATABASE_LIST_KEY, databases );
    List<DataSetGroup> groups = groupFactory.getElements();

    MetaStoreFactory<DataSet> setFactory = new MetaStoreFactory<DataSet>( DataSet.class, metaStore, PentahoDefaults.NAMESPACE );
    setFactory.addNameList( DataSetConst.GROUP_LIST_KEY, groups );

    DataSet dataSet = new DataSet();
    RowMetaInterface rowMeta = transMeta.getStepFields( stepMeta );
    for ( int i = 0; i < rowMeta.size(); i++ ) {
      ValueMetaInterface valueMeta = rowMeta.getValueMeta( i );
      DataSetField field = new DataSetField( valueMeta.getName(), "field" + i, valueMeta.getType(), valueMeta.getLength(), valueMeta.getPrecision(), valueMeta.getComments() );
      dataSet.getFields().add( field );
    }

    editDataSet( spoon, dataSet, groups, setFactory, null );

  } catch ( Exception e ) {
    new ErrorDialog( spoon.getShell(), "Error", "Error creating a new data set", e );
  }
}
 
开发者ID:mattcasters,项目名称:pentaho-pdi-dataset,代码行数:40,代码来源:DataSetHelper.java

示例4: tweakUnitTestStep

import org.pentaho.di.ui.spoon.trans.TransGraph; //导入方法依赖的package包/类
private void tweakUnitTestStep(TransTweak stepTweak, boolean enable) {
  Spoon spoon = ( (Spoon) SpoonFactory.getInstance() );
  TransGraph transGraph = spoon.getActiveTransGraph();
  IMetaStore metaStore = spoon.getMetaStore();
  if ( transGraph == null ) {
    return;
  }
  StepMeta stepMeta = transGraph.getCurrentStep();
  TransMeta transMeta = spoon.getActiveTransformation();
  if ( stepMeta == null || transMeta == null ) {
    return;
  }

  try {
    TransUnitTest unitTest = getCurrentUnitTest(transMeta);
    if (unitTest==null) {
      return;
    }
    TransUnitTestTweak unitTestTweak = unitTest.findTweak(stepMeta.getName());
    if (unitTestTweak!=null) {
      unitTest.getTweaks().remove(unitTestTweak);
      stepMeta.setAttribute(DataSetConst.ATTR_GROUP_DATASET, DataSetConst.ATTR_STEP_TWEAK, null);
    }
    if (enable) {
      unitTest.getTweaks().add(new TransUnitTestTweak(stepTweak, stepMeta.getName()));
      stepMeta.setAttribute(DataSetConst.ATTR_GROUP_DATASET, DataSetConst.ATTR_STEP_TWEAK, stepTweak.name());
    }
    
    new MetaStoreFactory<TransUnitTest>(TransUnitTest.class, metaStore, PentahoDefaults.NAMESPACE)
      .saveElement(unitTest);
    
    spoon.refreshGraph();
    
  } catch(Exception exception) {
    new ErrorDialog( spoon.getShell(), "Error", "Error tweaking transformation unit test on step '"+stepMeta.getName()+"' with operation "+stepTweak.name(), exception );
  }
}
 
开发者ID:mattcasters,项目名称:pentaho-pdi-dataset,代码行数:38,代码来源:DataSetHelper.java


注:本文中的org.pentaho.di.ui.spoon.trans.TransGraph.getCurrentStep方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。