You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
49 lines
2.0 KiB
Java
49 lines
2.0 KiB
Java
import com.dassault_systemes.enovia.enterprisechangemgt.common.ChangeAction;
|
|
import com.matrixone.apps.domain.util.ContextUtil;
|
|
import com.matrixone.apps.domain.util.MapList;
|
|
import com.matrixone.apps.domain.util.MqlUtil;
|
|
import matrix.db.Context;
|
|
|
|
import java.util.Map;
|
|
import java.util.logging.Logger;
|
|
|
|
public class AegCADemote_mxJPO {
|
|
|
|
private static final Logger LOGGER = Logger.getLogger(AegCADemote_mxJPO.class.getName());
|
|
|
|
public void setAffectItemState(Context context, String[] args) throws Exception {
|
|
String changeActionId = args[0];
|
|
LOGGER.info("CAId ==> " + changeActionId);
|
|
|
|
String getProjectType = "print bus " + changeActionId + " select type dump |";
|
|
String projectType = MqlUtil.mqlCommand(context, getProjectType);
|
|
|
|
if("Change Action".equals(projectType)){
|
|
ChangeAction changeAction = new ChangeAction(changeActionId);
|
|
MapList mapList = changeAction.getAffectedItems(context);
|
|
|
|
for (int i = 0; i < mapList.size(); i++) {
|
|
Map<String, String> map = (Map) mapList.get(i);
|
|
|
|
String affectItemId = (String) map.get("id");
|
|
String affectItemCurrent = (String) map.get("current");
|
|
LOGGER.info("affectItemId ==> " + affectItemId);
|
|
LOGGER.info("affectItemCurrent ==> " + affectItemCurrent);
|
|
|
|
// for (String key : map.keySet()){
|
|
// LOGGER.info("key : " + key + " , value : " + map.get(key));
|
|
// }
|
|
|
|
if(!"RELEASED".equals(affectItemCurrent)){
|
|
String updateAffectState = "modify bus " + affectItemId + " current IN_WORK";
|
|
LOGGER.info("updateAffectState ==> " + updateAffectState);
|
|
|
|
ContextUtil.pushContext(context);
|
|
MqlUtil.mqlCommand(context, updateAffectState);
|
|
ContextUtil.popContext(context);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|