本文整理匯總了Java中org.pentaho.di.trans.TransMeta.nrTransHops方法的典型用法代碼示例。如果您正苦於以下問題:Java TransMeta.nrTransHops方法的具體用法?Java TransMeta.nrTransHops怎麽用?Java TransMeta.nrTransHops使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.pentaho.di.trans.TransMeta
的用法示例。
在下文中一共展示了TransMeta.nrTransHops方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: repairTransHop
import org.pentaho.di.trans.TransMeta; //導入方法依賴的package包/類
/**
* 修複轉換連接線 <br/>
* @author jingma
* @param tm 轉換元數據
*/
public static void repairTransHop(TransMeta tm) {
for(int i=0;i<tm.nrTransHops();i++){
TransHopMeta hop = tm.getTransHop(i);
hop.setFromStep(tm.findStep(hop.getFromStep().getName()));
hop.setToStep(tm.findStep(hop.getToStep().getName()));
}
}
示例2: createGraph
import org.pentaho.di.trans.TransMeta; //導入方法依賴的package包/類
public static Graph createGraph( EngineMetaInterface meta ) {
if ( meta == null ) {
return null;
}
Graph g = new TinkerGraph();
if ( meta instanceof TransMeta ) {
TransMeta transMeta = (TransMeta) meta;
// Add nodes
List<StepMeta> steps = transMeta.getSteps();
if ( steps != null ) {
for ( StepMeta step : steps ) {
Vertex v = g.addVertex( step.getName() );
v.setProperty( PROPERTY_NAME, step.getName() );
v.setProperty( PROPERTY_PLUGINID, step.getStepID() );
Point location = step.getLocation();
v.setProperty( PROPERTY_X, location.x );
v.setProperty( PROPERTY_Y, location.y );
v.setProperty( PROPERTY_REF, step );
}
}
int numHops = transMeta.nrTransHops();
for ( int i = 0; i < numHops; i++ ) {
TransHopMeta hop = transMeta.getTransHop( i );
StepMeta fromStep = hop.getFromStep();
StepMeta toStep = hop.getToStep();
Vertex fromV = g.getVertex( fromStep.getName() );
Vertex toV = g.getVertex( toStep.getName() );
g.addEdge( null, fromV, toV, EDGE_HOPSTO );
}
}
return g;
}