use of org.compiere.model.X_AD_ReplicationTable in project adempiere by adempiere.
the class ExportModelValidator method loadReplicationStrategy.
public void loadReplicationStrategy(Properties ctx) {
MClient m_client = MClient.get(Env.getCtx(), clientId);
/*replicationStrategyId = MRole.get(m_client.getCtx(), roleId).get_ValueAsInt("AD_ReplicationStrategy_ID");
if(replicationStrategyId <= 0)
{
replicationStrategyId = MOrg.get(m_client.getCtx(), orgId).getAD_ReplicationStrategy_ID();
}
if(replicationStrategyId <= 0)
{
replicationStrategyId = m_client.getAD_ReplicationStrategy_ID();
log.info("client.getAD_ReplicationStrategy_ID() = " + replicationStrategyId);
}
if (replicationStrategyId > 0) {
replicationStrategy = new MReplicationStrategy(m_client.getCtx(), replicationStrategyId, null);
if(!replicationStrategy.isActive())
{
return;
}
exportHelper = new ExportHelper(m_client, replicationStrategy);
}*/
// Add Tables
// We want to be informed when records in Replication tables are created/updated/deleted!
//engine.addModelChange(MBPartner.Table_Name, this);
//engine.addModelChange(MOrder.Table_Name, this);
//engine.addModelChange(MOrderLine.Table_Name, this);
MReplicationStrategy.getByOrgAndRole(ctx, orgId, roleId, null).stream().filter(replicationStrategy -> replicationStrategy != null).forEach(replicationStrategy -> {
for (X_AD_ReplicationTable rplTable : replicationStrategy.getReplicationTables()) {
if (X_AD_ReplicationTable.REPLICATIONTYPE_Merge.equals(rplTable.getReplicationType()) || X_AD_ReplicationTable.REPLICATIONTYPE_Broadcast.equals(rplTable.getReplicationType()) || X_AD_ReplicationTable.REPLICATIONTYPE_Reference.equals(rplTable.getReplicationType())) {
String tableName = MTable.getTableName(replicationStrategy.getCtx(), rplTable.getAD_Table_ID());
modelValidationEngine.addModelChange(tableName, this);
}
}
for (X_AD_ReplicationDocument rplDocument : replicationStrategy.getReplicationDocuments()) {
if (X_AD_ReplicationDocument.REPLICATIONTYPE_Merge.equals(rplDocument.getReplicationType()) || X_AD_ReplicationDocument.REPLICATIONTYPE_Reference.equals(rplDocument.getReplicationType())) {
String tableName = MTable.getTableName(replicationStrategy.getCtx(), rplDocument.getAD_Table_ID());
modelValidationEngine.addDocValidate(tableName, this);
}
}
});
}
Aggregations