Просмотр исходного кода

Merge branch 'feature/process_service_activity' into 'develop'

Merge of feature/process_service_activity to develop 流程管理增加“服务”活动

See merge request o2oa/o2oa!212
胡起 5 лет назад
Родитель
Сommit
a5be17e6a2

+ 5 - 5
o2web/source/x_component_process_ProcessDesigner/$Main/gadget.json

@@ -59,11 +59,11 @@
     "text": "服务调用",
     "className": "Invoke"
   },
-//  "service": {
-//    "icon": "service24.png",
-//    "text": "服务",
-//    "className": "Service"
-//  },
+  "service": {
+    "icon": "service24.png",
+    "text": "服务",
+    "className": "Service"
+  },
 //  "message": {
 //    "icon": "message24.png",
 //    "text": "消息",

+ 17 - 17
o2web/source/x_component_process_ProcessDesigner/$Process/activity.json

@@ -564,23 +564,23 @@
 
     "type": "agent"
   },
-//  "service": {
-//    "name":"服务",
-//    "alias":"",
-//    "description":"",
-//    "position":"",
-//    "decisionIdList":[],
-//    "id":"",
-//    "version":1,
-//    "createTime":"",
-//    "type": "service",
-//
-//    "beforeArriveScript": "",
-//    "afterArriveScript": "",
-//    "beforeExecuteScript": "",
-//    "afterExecuteScript": "",
-//    "afterInquireScript": ""
-//  },
+  "service": {
+    "name":"服务",
+    "alias":"",
+    "description":"",
+    "position":"",
+    "decisionIdList":[],
+    "id":"",
+    "version":1,
+    "createTime":"",
+    "type": "service",
+
+    "beforeArriveScript": "",
+    "afterArriveScript": "",
+    "beforeExecuteScript": "",
+    "afterExecuteScript": "",
+    "afterInquireScript": ""
+  },
 //  "message": {
 //    "name":"消息",
 //    "alias":"",

+ 7 - 0
o2web/source/x_component_process_ProcessDesigner/$Process/service.html

@@ -42,6 +42,13 @@
             </tr>
         </table>
     </div>
+
+    <div title="响应" class="MWFTab">
+        <div style="background-color: #f1f1f1; height: 20px; padding: 5px; line-height: 20px"><b>服务响应脚本</b></div>
+        <div class="MWFScript" name="script"></div>
+        <div class="MWFScriptText" name="scriptText"></div><hr/>
+        <div style="line-height: 24px; padding: 2px 5px;">通过 this.request.getBody() 获取请求数据<br/>返回 true,驱动流程继续流转<br/>返回 false,表示不符合流转条件,等待下一次调用</div>
+    </div>
     <div title="事件" class="MWFTab">
         <div onclick="var node = this.getNext(); if (node.getStyle('display')=='none'){node.setStyle('display', 'block');}else{node.setStyle('display', 'none');}" style="cursor: pointer; line-height: 28px; height: 30px; font-weight: bold; background-color: #EEEEEE;">
             <div style="height: 30px; width: 30px; float: left; background: url(/x_component_process_ProcessDesigner/$Process/event.png) no-repeat center center;"></div>

+ 4 - 4
o2web/source/x_component_process_ProcessManager/ScriptExplorer.js

@@ -3,10 +3,10 @@ MWF.xApplication.process.ProcessManager.ScriptExplorer = new Class({
 	Extends: MWF.xApplication.process.ProcessManager.DictionaryExplorer,
 	Implements: [Options, Events],
     options: {
-        "create": MWF.APPPM.LP.dictionary.create,
-        "search": MWF.APPPM.LP.dictionary.search,
-        "searchText": MWF.APPPM.LP.dictionary.searchText,
-        "noElement": MWF.APPPM.LP.dictionary.noDictionaryNoticeText
+        "create": MWF.APPPM.LP.script.create,
+        "search": MWF.APPPM.LP.script.search,
+        "searchText": MWF.APPPM.LP.script.searchText,
+        "noElement": MWF.APPPM.LP.script.noScriptNoticeText
     },
 
     keyCopy: function(e){

+ 9 - 0
o2web/source/x_desktop/js/initialScriptText.js

@@ -903,3 +903,12 @@ bind.expire = {
         try{expire.setDate(date);}catch(e){}
     }
 };
+bind.request = {
+    "getBody": function(){
+        try{
+            return JSON.parse(serviceValue);
+        }catch(e){
+            return null
+        }
+    }
+}