use of org.compiere.model.MMigrationStep in project adempiere by adempiere.
the class MigrationCreate method doIt.
/**
*
* Process to create migration from selected records
*
* @author Paul Bowden, Adaxa Pty Ltd
*
*/
@Override
protected String doIt() throws Exception {
MMigration migration = new MMigration(getCtx(), 0, get_TrxName());
MTable table = MTable.get(getCtx(), tableId);
String whereClause;
List<PO> pos;
if (recordId > 0) {
pos = new ArrayList<PO>(1);
pos.add(table.getPO(recordId, get_TrxName()));
} else {
String where = "EntityType = ?";
pos = table.createQuery(where, get_TrxName()).list();
}
for (PO po : pos) {
POInfo info = POInfo.getPOInfo(getCtx(), tableId, get_TrxName());
MMigrationStep step = new MMigrationStep(migration, po, info, MMigrationStep.ACTION_Insert);
}
return "@OK@";
}
Aggregations