Search in sources :

Example 1 with MMigrationStep

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@";
}
Also used : POInfo(org.compiere.model.POInfo) MTable(org.compiere.model.MTable) MMigrationStep(org.compiere.model.MMigrationStep) MMigration(org.compiere.model.MMigration) PO(org.compiere.model.PO)

Aggregations

MMigration (org.compiere.model.MMigration)1 MMigrationStep (org.compiere.model.MMigrationStep)1 MTable (org.compiere.model.MTable)1 PO (org.compiere.model.PO)1 POInfo (org.compiere.model.POInfo)1