RestActions.min.js 7.1 KB

1
  1. MWF.xApplication.process=MWF.xApplication.process||{};MWF.xApplication.process.Work=MWF.xApplication.process.Work||{};MWF.xApplication.process.Work.Actions=MWF.xApplication.process.Work.Actions||{};MWF.require("MWF.xDesktop.Actions.RestActions",null,false);MWF.xApplication.process.Work.Actions.RestActions=new Class({initialize:function(){this.actionPath="/x_component_process_Work/Actions/action.json";this.actionWork=new MWF.xDesktop.Actions.RestActions("","x_processplatform_assemble_surface","x_component_process_Work");this.actionWork.getActions=function(t){this.getActionActions(this.actionWork,t)}.bind(this);this.actionProcess=new MWF.xDesktop.Actions.RestActions("","x_processplatform_assemble_surface","x_component_process_Work");this.actionProcess.getActions=function(t){this.getActionActions(this.actionProcess,t)}.bind(this);this.actionWorkCompleted=new MWF.xDesktop.Actions.RestActions("","x_processplatform_assemble_surface","x_component_process_Work");this.actionWorkCompleted.getActions=function(t){this.getActionActions(this.actionWorkCompleted,t)}.bind(this);this.actionData=new MWF.xDesktop.Actions.RestActions("","x_processplatform_assemble_surface","x_component_process_Work");this.actionData.getActions=function(t){this.getActionActions(this.actionData,t)}.bind(this);this.actionTask=new MWF.xDesktop.Actions.RestActions("","x_processplatform_assemble_surface","x_component_process_Work");this.actionTask.getActions=function(t){this.getActionActions(this.actionTask,t)}.bind(this);this.actionAttachment=new MWF.xDesktop.Actions.RestActions("","x_processplatform_assemble_surface","x_component_process_Work");this.actionAttachment.getActions=function(t){this.getActionActions(this.actionAttachment,t)}.bind(this);this.actionDesigner=new MWF.xDesktop.Actions.RestActions("","x_processplatform_assemble_designer","x_component_process_Work");this.actionDesigner.getActions=function(t){this.getActionActions(this.actionDesigner,t)}.bind(this);this.actionView=new MWF.xDesktop.Actions.RestActions("","x_processplatform_assemble_surface_lookup","x_component_process_Work");this.actionView.getActions=function(t){this.getActionActions(this.actionView,t)}.bind(this)},getActionActions:function(t,e){if(!t.actions){this.getActions(function(o){t.actions=this.actions;if(e)e()}.bind(this))}else{if(e)e()}},getActions:function(t){if(!this.actions){MWF.getJSON(this.actionPath,function(e){this.actions=e;if(t)t()}.bind(this))}else{if(t)t()}},getJobByTask:function(t,e,o,n){this.actionWork.invoke({name:"getJobByTask",async:n,parameter:{id:o},success:t,failure:e})},getJobByWork:function(t,e,o,n){this.actionWork.invoke({name:"getJobByWork",async:n,parameter:{id:o},success:t,failure:e})},getJobByWorkAssignForm:function(t,e,o,n,i,c){this.actionWork.invoke({name:"getJobByWorkAssignForm",async:c,parameter:{id:o,applicationTag:n,formTag:i},success:t,failure:e})},getJobByWorkMobile:function(t,e,o,n){this.actionWork.invoke({name:"getJobByWorkMobile",async:n,parameter:{id:o},success:t,failure:e})},getJobByWorkAssignFormMobile:function(t,e,o,n,i,c){this.actionWork.invoke({name:"getJobByWorkAssignFormMobile",async:c,parameter:{id:o,applicationTag:n,formTag:i},success:t,failure:e})},rerouteWork:function(t,e,o,n,i,c){this.actionWork.invoke({name:"rerouteWork",async:c,data:null,parameter:{id:o,activityId:n,type:i},success:t,failure:e})},retractWork:function(t,e,o,n){this.actionWork.invoke({name:"retractWork",async:n,data:null,parameter:{id:o},success:t,failure:e})},deleteWork:function(t,e,o,n){this.actionWork.invoke({name:"deleteWork",async:n,data:null,parameter:{id:o},success:t,failure:e})},getJobByWorkCompleted:function(t,e,o,n){this.actionWorkCompleted.invoke({name:"getJobByWorkCompleted",async:n,parameter:{id:o},success:t,failure:e})},getJobByWorkCompletedMobile:function(t,e,o,n){this.actionWorkCompleted.invoke({name:"getJobByWorkCompletedMobile",async:n,parameter:{id:o},success:t,failure:e})},saveData:function(t,e,o,n,i){this.actionData.invoke({name:"saveData",async:i,data:n,parameter:{id:o},success:t,failure:e})},processTask:function(t,e,o,n,i){this.actionTask.invoke({name:"processTask",async:i,data:n,parameter:{id:o},success:t,failure:e})},resetWork:function(t,e,o,n,i){this.actionTask.invoke({name:"resetWork",async:i,data:n,parameter:{id:o},success:t,failure:e})},uploadAttachment:function(t,e,o,n,i){this.actionAttachment.invoke({name:"uploadAttachment",parameter:{id:t},data:n,file:i,success:e,failure:o})},replaceAttachment:function(t,e,o,n,i,c){this.actionAttachment.invoke({name:"replaceAttachment",parameter:{workid:e,id:t},data:i,file:c,success:o,failure:n})},getAttachment:function(t,e,o,n,i){this.actionAttachment.invoke({name:"getAttachment",async:i,parameter:{id:t,workid:e},success:o,failure:n})},getAttachmentWorkcompleted:function(t,e,o,n,i){this.actionAttachment.invoke({name:"getAttachmentWorkcompleted",async:i,parameter:{id:t,workCompletedId:e},success:o,failure:n})},deleteAttachment:function(t,e,o,n,i){this.actionAttachment.invoke({name:"deleteAttachment",async:i,parameter:{id:t,workid:e},success:o,failure:n})},getView:function(t,e,o,n,i){this.actionDesigner.invoke({name:"getView",async:i,parameter:{id:t},success:o,failure:n})},lookupView:function(t,e,o,n,i){this.actionView.invoke({name:"lookupView",async:i,parameter:{id:t},success:o,failure:n})},getRerouteTo:function(t,e,o,n){this.actionProcess.invoke({name:"getRerouteTo",async:n,parameter:{flag:t},success:e,failure:o})},getAttachmentData:function(t,e){this.actionAttachment.getActions(function(){var o=this.actionAttachment.actions.getAttachmentData.uri;o=o.replace("{id}",encodeURIComponent(t));o=o.replace("{workid}",encodeURIComponent(e));window.open(this.actionAttachment.address+o)}.bind(this))},getWorkcompletedAttachmentData:function(t,e){this.actionAttachment.getActions(function(){var o=this.actionAttachment.actions.getWorkcompletedAttachmentData.uri;o=o.replace("{id}",encodeURIComponent(t));o=o.replace("{workCompletedId}",encodeURIComponent(e));window.open(this.actionAttachment.address+o)}.bind(this))},getAttachmentStream:function(t,e){this.actionAttachment.getActions(function(){var o=this.actionAttachment.actions.getAttachmentStream.uri;o=o.replace("{id}",encodeURIComponent(t));o=o.replace("{workid}",encodeURIComponent(e));window.open(this.actionAttachment.address+o)}.bind(this))},getWorkcompletedAttachmentStream:function(t,e){this.actionAttachment.getActions(function(){var o=this.actionAttachment.actions.getWorkcompletedAttachmentStream.uri;o=o.replace("{id}",encodeURIComponent(t));o=o.replace("{workCompletedId}",encodeURIComponent(e));window.open(this.actionAttachment.address+o)}.bind(this))},getAttachmentUrl:function(t,e,o){this.actionAttachment.getActions(function(){var n=this.actionAttachment.actions.getAttachmentData.uri;n=n.replace("{id}",encodeURIComponent(t));n=n.replace("{workid}",encodeURIComponent(e));if(o)o(this.actionAttachment.address+n)}.bind(this))},getAttachmentWorkcompletedUrl:function(t,e,o){this.actionAttachment.getActions(function(){var n=this.actionAttachment.actions.getWorkcompletedAttachmentData.uri;n=n.replace("{id}",encodeURIComponent(t));n=n.replace("{workCompletedId}",encodeURIComponent(e));if(o)o(this.actionAttachment.address+n)}.bind(this))}});