<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<activity id="__KaaimUfCJ0vwANVmsCt">
  <name>保存</name>
  <parentId>__qAJaShOz6PBKVmnxv86</parentId>
  <type>13</type>
  <onActionForm></onActionForm>
  <onActionView></onActionView>
  <onActionFlow></onActionFlow>
  <onActionPrint></onActionPrint>
  <colorType>default</colorType>
  <beforeActionScript><![CDATA[//在表单控件值脚本中获取当前文档对象
(function(){
var examRuleName = getItemValueAsString("examRuleName");
var examType = getItemValueAsString("examType");
var examOnlineType = getItemValueAsString("examOnlineType");	
var noOpsPutType = getItemValueAsString("noOpsPutType");
var overtimeSeconds = getItemValueAsInt("overtimeSeconds");
var cutScreenPutType = getItemValueAsString("cutScreenPutType");
var cutScreenCount = getItemValueAsInt("cutScreenCount");
var cutScreenSeconds = getItemValueAsInt("cutScreenSeconds");
var answerPercent = getItemValueAsInt("answerPercent");

if(examRuleName==null || examRuleName.trim().length()<=0) {
    return "培训名称必须填写！";
}
if(examType==null || examType.trim().length()<=0) {
    return "培训分类必须填写！";
}

if(examOnlineType == '1'){
  if(noOpsPutType == "1" && overtimeSeconds == 0){
  	return "无操作超时秒数必须填写！";
  }
  if(cutScreenPutType == "1" && (cutScreenCount == 0 || cutScreenSeconds == 0)){
  	return "切屏校验信息必须填写！";
  }
  if(answerPercent == 0){
  	return "最少答题设置必须填写！";
  }
  if(answerPercent > 100){
  	return "最少答题百分比不得超过100%！";
  }
}



})()]]></beforeActionScript>
  <afterActionScript><![CDATA[]]></afterActionScript>
  <retractBeforeActionScript><![CDATA[]]></retractBeforeActionScript>
  <retractAfterActionScript><![CDATA[]]></retractAfterActionScript>
  <hiddenScript><![CDATA[]]></hiddenScript>
  <readonlyScript><![CDATA[]]></readonlyScript>
  <startFlowScript><![CDATA[							]]></startFlowScript>
  <editMode>0</editMode>
  <flowShowType>表单中显示流程操作</flowShowType>
  <fileNameScript><![CDATA[]]></fileNameScript>
  <orderno>1</orderno>
  <stateToShow></stateToShow>
  <parentView></parentView>
  <parentForm>__qAJaShOz6PBKVmnxv86</parentForm>
  <impmappingconfigid>__7tkXQ8UWGSqrTJkHtCB</impmappingconfigid>
  <jumpType>0</jumpType>
  <expSub>false</expSub>
  <icon></icon>
  <disableFlowNode>true</disableFlowNode>
  <changeFlowOperator>true</changeFlowOperator>
  <changeFlowCc>true</changeFlowCc>
  <multiLanguageLabel></multiLanguageLabel>
  <dispatcherMode>0</dispatcherMode>
  <dispatcherUrl><![CDATA[]]></dispatcherUrl>
  <dispatcherParams><![CDATA[]]></dispatcherParams>
  <jumpMode>0</jumpMode>
  <jumpActOpenType>0</jumpActOpenType>
  <withOld>false</withOld>
  <actionType>1</actionType>
  <actionDispatcherUrlScript><![CDATA[]]></actionDispatcherUrlScript>
  <actionSelection>0</actionSelection>
  <relatedFormId>选择</relatedFormId>
  <actionScript><![CDATA[#include "getDsName"
(function(){
var examRuleName = getItemValueAsString("examRuleName");
var examType = getItemValueAsString("examType");
var examOnlineType = getItemValueAsString("examOnlineType");	
var scanSignInType = getItemValueAsString("scanSignInType");
var faceVerificationType = getItemValueAsString("faceVerificationType");
var noOpsPutType = getItemValueAsString("noOpsPutType");
var overtimeSeconds = getItemValueAsInt("overtimeSeconds");
var cutScreenPutType = getItemValueAsString("cutScreenPutType");
var cutScreenCount = getItemValueAsInt("cutScreenCount");
var cutScreenSeconds = getItemValueAsInt("cutScreenSeconds");
var answerPercent = getItemValueAsInt("answerPercent");
var examOfflineType = getItemValueAsString("examOfflineType");

var userName= getWebUser().getName(); 
var dsName = getDsName();

try {
  var process = getDocumentProcess();            
  var formProcess = getFormProcess();            
  var examRuleInfo = formProcess.doView("__LVBw8O9T8DYlplaKIaG");            
  var examRuleInfoDoc = process.doNew(examRuleInfo,getWebUser(),createParamsTable());            
  examRuleInfoDoc.addStringItem("EXAMRULENAME",examRuleName);            
  examRuleInfoDoc.addStringItem("EXAMTYPE",examType);           
  examRuleInfoDoc.addStringItem("CREATEDUSER",userName);
  var examRuleId = examRuleInfoDoc.getId();
  
  var examConditionInfo = formProcess.doView("__naZ8pgQVnVQzdwPRrOV");            
  var examConditionInfoDoc = process.doNew(examConditionInfo,getWebUser(),createParamsTable());            
  examConditionInfoDoc.addStringItem("EXAMRULEID",examRuleId);
  examConditionInfoDoc.addStringItem("examOnlineType",examOnlineType);
  examConditionInfoDoc.addStringItem("scanSignInType",scanSignInType);
  examConditionInfoDoc.addStringItem("faceVerificationType",faceVerificationType);
  examConditionInfoDoc.addStringItem("noOpsPutType",noOpsPutType);
  examConditionInfoDoc.addIntItem("overtimeSeconds",overtimeSeconds);
  examConditionInfoDoc.addStringItem("cutScreenPutType",cutScreenPutType);
  examConditionInfoDoc.addIntItem("cutScreenCount",cutScreenCount);
  examConditionInfoDoc.addIntItem("cutScreenSeconds",cutScreenSeconds);
  examConditionInfoDoc.addIntItem("answerPercent",answerPercent);
  examConditionInfoDoc.addStringItem("examOfflineType",examOfflineType);
  
  var ruleObjectInfo = formProcess.doView("__YnNdVeJNx5aI7TOvQBR");            
  var ruleObjectInfoDoc = process.doNew(ruleObjectInfo,getWebUser(),createParamsTable());            
  ruleObjectInfoDoc.addStringItem("RULEID",examRuleId);
  ruleObjectInfoDoc.addStringItem("RULETYPE","2");
  
  beginTransaction(dsName);  
  process.doCreate(examRuleInfoDoc); 
  process.doCreate(examConditionInfoDoc); 
  process.doCreate(ruleObjectInfoDoc);
  commitTransaction(dsName);                       
} catch(e) {
  println("异常信息==>" + e);
  rollbackTransaction(dsName);     
  return createAlert("保存失败，请稍后重试！");    
}  
})()]]></actionScript>
  <workFlowType>0</workFlowType>
  <contextMenu>true</contextMenu>
  <showInToolbar>true</showInToolbar>
  <transpond>选择</transpond>
  <targetList>ism1EiHqAkpLpSd2Zr7|</targetList>
  <label><![CDATA[]]></label>
</activity>