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.

343 lines
14 KiB
Plaintext

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>流程事件类</title>
<meta charset="UTF-8" />
<title>节点-事件</title>
<link href="../../Scripts/easyUI145/themes/default/easyui.css" rel="stylesheet" />
<script src="../../Scripts/easyUI/jquery-1.8.0.min.js" type="text/javascript"></script>
<script src="../../Scripts/easyUI/jquery.easyui.min.js" type="text/javascript"></script>
<script src="../../Scripts/QueryString.js" type="text/javascript"></script>
<script type="text/javascript" src="../../Scripts/bootstrap/js/jquery.min.js"></script>
<script src="../../Scripts/QueryString.js" type="text/javascript"></script>
<link href="../../../DataUser/Style/ccbpm.css" rel="stylesheet" type="text/css" />
<!-- 自己的系统风格统一. -->
<link href="../../Style/skin/adminfont/iconfont.css" rel="stylesheet" />
<link href="../../Style/skin/css/Default.css" rel="stylesheet" />
<link href="../../Scripts/bootstrap/css/bootstrap.min.css" rel="stylesheet" />
<!-- 自己的系统风格统一end -->
<!-- 引用通用的js文件. -->
<script type="text/javascript" src="../../Scripts/config.js"></script>
<script type="text/javascript" src="../../Comm/Gener.js"></script>
<!--SQL编辑器-->
<link href="../../Scripts/CodeMirror/lib/codemirror.css" rel="stylesheet" />
<link href="../../Scripts/CodeMirror/addon/hint/show-hint.css" rel="stylesheet" />
<script src="../../Scripts/CodeMirror/lib/codemirror.js"></script>
<script src="../../Scripts/CodeMirror/addon/edit/matchbrackets.js"></script>
<script src="../../Scripts/CodeMirror/mode/sql/sql.js"></script>
<script src="../../Scripts/CodeMirror/addon/hint/show-hint.js"></script>
<script src="../../Scripts/CodeMirror/addon/hint/sql-hint.js"></script>
<script src="../Admin.js"></script>
<script src="../../Scripts/easyUI/jquery-1.8.0.min.js" type="text/javascript"></script>
<script src="../../Scripts/easyUI/jquery.easyui.min.js" type="text/javascript"></script>
<script src="../../Scripts/EasyUIUtility.js" type="text/javascript"></script>
<script src="../../Scripts/LoadSql.js"></script>
<script type="text/javascript">
var mypk = GetQueryString("MyPK");
//页面启动函数.
$(function () {
$("#Msg").html("正在加载,请稍后......");
var en = null;
if (mypk != null && mypk != undefined && mypk != "") {
en = new Entity("BP.Sys.FrmEvent", mypk);
}
//初始化groupID.
var nodeID = GetQueryString("FK_Node");
//绑定事件类型.
GenerBindEnumKey("DDL_EventDoType", "EventDoType", "0");
$("#DDL_EventDoType").trigger("change");
var handler = new HttpHandler("BP.WF.HttpHandler.WF_Admin_AttrNode");
handler.AddUrlData();
var data = handler.DoMethodReturnString("ActionDtl_Init");
if (data.indexOf('err@') == 0) {
alert(data);
return;
}
// 业务单元
var BuessUnits = JSON.parse(data);
GenerBindDDL("DDL_Doc", BuessUnits, "No", "Name", "");
//绑定数据源类型. 在填充的时候,设置数据源.
var ens = new Entities("BP.Sys.SFDBSrcs");
ens.RetrieveAll();
GenerBindDDL("DDL_FK_DBSrc", ens, "No", "Name", "");
if (en != null) {
GenerFullAllCtrlsVal(en);
if (en.EventDoType == 1 || en.EventDoType == 2 || en.EventDoType == 3
|| en.EventDoType == 8) {
en.DoDoc = en.DoDoc.replace(/~/g, "'");
$("#TB_Doc").val(en.DoDoc);
}
if (en.EventDoType == 7) {
$("#DDL_Doc").show();
$("#TB_Doc").hide();
$("#DDL_Doc").val(en.DoDoc);
}
if (en.EventDoType == 2) {
$("#DBSrc").show();
}
else
$("#DBSrc").hide();
}
});
function GetDoType(doType) {
var cfg = "@0=禁用@1=执行存储过程@2=执行SQL语句@3=执行URL@4=WebServices(未完成)@5=执行ddl文件的类与方法@6=EventBase类@7=业务单元";
var cfgs = cfg.split('@');
for (var i = 0; i < cfgs.length; i++) {
var vss = cfgs[i];
if (vss.indexOf('=') == -1)
continue;
var vals = vss.split('=');
if (vals[0] == doType)
return vals[1];
}
return doType + 'ss';
}
function Save() {
var en = new Entity("BP.Sys.FrmEvent", "0");
en.CopyForm();
en.FK_Node = GetQueryString("FK_Node");
en.EventSource = 2;//节点事件
//如果是业务单元.
if (en.EventDoType == 7) {
en.DoDoc = $("#DDL_Doc").val();
} else {
en.DoDoc = $("#TB_Doc").val();
}
if (en.DoDoc == "") {
alert('设置执行内容.');
return;
}
if (en.EventDoType == 2)
en.FK_DBSrc = $("#DDL_FK_DBSrc").val();
else
en.FK_DBSrc = "";
if (mypk != null && mypk != undefined && mypk != "") {
en.SetPKVal(mypk);
en.update();
} else {
en.SetPKVal(en.FK_Event + "_" + Math.random());
en.EventID = en.FK_Event;
en.Insert();
}
Back();
//Reload();
return;
}
function doChangeContent(o) {
if ($(o).val() == "7") {
$("#TB_Doc").hide();
$("#DDL_Doc").show();
} else {
$("#TB_Doc").show();
$("#DDL_Doc").hide();
}
if ($(o).val() == "2") {
$("#DBSrc").show();
} else {
$("#DBSrc").hide();
}
if ($(o).val() == "8")
$("#sp_webapi").show();
else
$("#sp_webapi").hide();
}
function Back() {
var url = "Action.htm?FK_Node=" + GetQueryString("FK_Node");
SetHref(url);
}
function Help() {
WinOpen('ActionHelp.htm');
}
function CRUDSFDBSrcs() {
var url = "../../Comm/Search.htm?EnsName=BP.Sys.SFDBSrcs";
OpenEasyUiDialog(url, null, "维护数据源", 1100, 600, "icon - library", false, null, null, null, dlgClosedFunc);
}
function dlgClosedFunc() {
window.location.reload();
}
</script>
</head>
<body>
<div class="container-full">
<div class="attrnode-bar-header">
<span class="pull-right">
<button id="Btn_Save" name="Btn_Save" value="保存" onclick="Save();">保存</button>
<button id="Btn_Back" name="Button1" value="返回" onclick="Back();">返回</button>
<button id="Btn_Help" name="Button1" value="帮助" onclick="Help();">帮助</button>
</span>
<strong>新增事件</strong>
</div>
<form id="cc">
<div style="position:relative;">
<table style="width: 100%;" id="Table2" class="table">
<tr>
<td>
事件类型
</td>
<td>
<select id="DDL_FK_Event" name="DDL_FK_Event">
<option value="WorkArrive">工作到达</option>
<option value="SendWhen" selected="selected">当节点发送前</option>
<option value="SendSuccess">节点发送成功时</option>
<option value="SendError">节点发送失败时</option>
<option value="ReturnBefore">当节点退回前</option>
<option value="ReturnAfter">当节点退回后</option>
<option value="UndoneBefore">当节点撤销发送前</option>
<option value="UndoneAfter">当节点撤销发送后</option>
<option value="WhenReadWork">工作打开后</option>
</select>
</td>
</tr>
<tr>
<td>
执行内容类型
</td>
<td>
<select id="DDL_EventDoType" name="DDL_EventDoType" onchange="doChangeContent(this)">
</select>
</td>
</tr>
<tr id="DBSrc">
<td>
数据源
</td>
<td>
<select id="DDL_FK_DBSrc" name="DDL_FK_DBSrc"></select>
<a href="#" onclick="CRUDSFDBSrcs()">维护数据源</a>
</td>
</tr>
<tr>
<td>
执行内容<br />
支持ccbpm表达式
</td>
<td>
<textarea id="TB_Doc" name="TB_Doc" style="display: none; width: 98%;"></textarea>
<!-- 其它事件 -->
<select id="DDL_Doc" name="DDL_Doc" style="display: none;">
</select>
<!-- 业务单元 -->
<span id="sp_webapi" style="color:blue">调用事件时,无论成功与否,都不会影响流程正常运行,如果需要阻断流程执行,请自定义方法,比如抛出异常</span>
</td>
</tr>
<tr>
<td colspan="1">
执行成功信息提示(可为空)
</td>
<td colspan="1">
<input type="text" id="TB_MsgOK" name="TB_MsgOK" />
</td>
</tr>
<tr>
<td colspan="1">
执行失败时提示(可为空)
</td>
<td>
<input type="text" id="TB_MsgError" name="TB_MsgError" />
</td>
</tr>
</table>
<br />
<fieldset>
<legend id="help"></legend>
<ul>
<li>执行的结果如果不符合预想结果可以直接throw出异常我们调用的时候会抛出异常终止程序继续运行.</li>
<li>返回其他的信息的时候系统就会提示出来.</li>
<li>执行的内容,支持ccbpm的表达式.比如: UPDATE XXX SET xxxx=@MyFiledName </li>
</ul>
<legend>关于url</legend>
<ul>
<li>请正确的配置一个url地址 </li>
<li>如果该url地址在本机上您需要配置绝对路径就好,比如: /DataUser/xxx.jsp </li>
<li>如果是另外的服务器,请使用绝对的路径,比如 : http://192.168.1.111/xxx.jsp </li>
<li> 系统会在您的url上面增加WorkID, UserNo, SID 等参数. </li>
<li> 比如1您配置的是 /DataUser/xxx.jsp 系统解析执行的时候会是 /DataUser/xxx.jsp?WorkID=1101&UserNo=zhangsan&Token=xxxxxxxx </li>
<li> 比如:您配置的是 /DataUser/xxx.jsp?DoType=xxx 系统解析执行的时候会是 /DataUser/xxx.jsp?DoType=xxx&WorkID=1101&UserNo=zhangsan&Token=xxxxxxxx </li>
<li>根据WorkID您可以获取您所需要的其他参数。 </li>
</ul>
<legend>关于EventBase类</legend>
<ul>
<li>它是一个子类按照要求从基类上集成下来并且写入到与bp的包名或者命名空间里如下图</li>
<li>java 与.net 一样语法与基类名称:</li>
<li><img src="ActionDtl.png" id="HelpImg" class="HelpImg" /></li>
</ul>
<legend>SQL表达式</legend>
<ul>
<li>1. 支持ccbpm表达式,什么是bpm表达式,请参考. </li>
<li>2. 支持 @PTable 表达式, 比如: UPDATE @PTable SET MyFile1='@WebUser.No' WHERE OID=@WorkID </li>
</ul>
<legend>存储过程</legend>
<ul>
<li>1. 支持 @WebUser.No 表达式, 比如: EXECUTE P_ChangeUserDeptName @_userNo='@WebUser.No',@_orgNo='@WebUser.OrgNo'; </li>
</ul>
<legend>关于WebAPI</legend>
<ul>
<li>1. WebAPI的输入格式@WebApiHost/DataUser/FrmEvent?id=51184 </li>
<li>2. 接口地址支持固定参数或者ccbpm内置参数或者流程表单参数比如:http://demo.ccflow.org/DataUser/FrmEvent?id=@FK_Node </li>
<li>3. 调用事件时,无论成功与否,都不会影响流程正常运行,如果需要阻断流程执行,请自定义方法,比如抛出异常。</li>
<li><img src="WebAPI.png" id="HelpImg" class="HelpImg" /></li>
</ul>
</fieldset>
</div>
</form>
</div>
</form>
</body>
</html>