1 EC9 Workflow Engine Form API
1 Description
All interfaces are encapsulated in a global object window.WfForm
Some interfaces have scope of use, minimum KB version and whether the mobile / PC end is unique. General purpose without special indication
Form field related operations, do not recommend the use of jQuery, prohibit native JS direct operation DOM structure
We recommend to use ECOA 9.0 API interface, unified operation and maintenance by the product R&D team, at the same time, only API could complete compatible mobile terminals
2 Mobile compatible
WfForm object interface, compatible with new mobile EM7
Since the API interface has been unified on the PC side and the mobile side, in order to reduce the development workload and later maintenance costs;
Therefore EM7 the form no longer introduces workflow_base table custompage4emoble columns as custom pages in mobile terminals, and directly introduces custompage columns (consistent with PC templates) as custom pages
Front end (JS method) distinguishing terminal:
WfForm.isMobile() could be used to check whether is mobile
Backend requests (custom pages, etc.) detemien terminals:
3 Front-end Development
Mode 1: code blocks in each layout template, individually configured on display/print/mobile templates for individual nodes
Mode 2: workflow_base table custompage, for all nodes in the current workflow, display and print and mobile Note that the process may have values if associated with budgets, attendance, vehicles, etc.
Mode 3: Workflow management->Application settings->Process Form User-defined Page for all non-template scenarios (PC and movement). Note that this page is global custompage, avoid writing global functions such as ready、checkCustomize, and define only some function bodies
Special note: For Mode 2, Mode 3, prohibits use init_wev8.js.;
When the configuration does not take effect, please write the code block / custompage only alert confirmation method to check whether it takes effect, and then debug the cause of the error step by step.
4 PC way to open the form
New request: System will be automatically retrieve the active workflow version base on the workflow id
View request: User must have this request view permission, the primary and secondary account acccount must be in link. The parameter is request ID
5 Open form link on mobile device
Mobile form link
First method (recommended): Call the package method If the module is packaged with mobile framework, it can be called directly When it's a self-developed interface, you need to call /spa/coms/openLink.js Minimum support system version: KB900190601 openLink.openWorkflow (url, callbackFun, returnUrl)
url
String
Links to open forms
callbackFun
Function
EM client only, callback function when returned
returnUrl
String
EM client, return/submit to specified link
Second Method: EM client only, open the form and control the return/submission event callback Use of EM-SDK, call webview to realize
Third Method: window.open/window.location.href redirect This way url you need to pass parameters returnUrl and transcode to specify the return/submit address. If it is EM client to use mode one or mode two!
Last updated