上传文件至 'CA的状态从审批中退到工作中'

main
libowen 9 months ago
parent 2ed5752003
commit a3ee879ba2

@ -0,0 +1,48 @@
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);
}
}
}
}
}

@ -0,0 +1,16 @@
add bus "eService Trigger Program Parameters" "AEGCADemoteStatusModify" "AEGCADemoteStatusModify"
policy "Business Rule"
vault "eService Administration"
"eService Program Argument 1" "${OBJECTID}"
"eService Program Name" "AegCADemote"
"eService Sequence Number" 1
"eService Method Name" "setAffectItemState"
current Active;
modify policy 'Change Action' state 'In Approval' add Trigger Demote Action emxTriggerManager input
'PolicyChangeActionStateInApprovalDemoteAction PolicyChangeActionPromoteDemoteAction AEGCADemoteStatusModify';
modify policy 'Change Action' state 'In Approval' add Trigger Demote Action emxTriggerManager input
'PolicyChangeActionStateInApprovalDemoteAction PolicyChangeActionPromoteDemoteAction';
Loading…
Cancel
Save