Dffiltri 发表于 2022-3-18 15:39:52

流程保存表单到自定义表报错

我在表单中做了1个按钮,用于保存数据到自定义表;现在改为在流程完成时,自动保存表单数据到自定义表。在流程的收到文件后,加了按钮中的代码,如下:
var wageTable = new this.Table("wage");
this.statement.execute({
    "name": "selectPartWageByPt",
    "mode" : "data",

    "parameter" : {
      "pn" : this.data.pn,
      "pa" : this.data.pa,
      "seqrv" : this.data.seqrv,
      "setid" : this.data.setid
    }
}, function(json){
    print(json.data);
    var wg = {};
    var values = [];
    for (var i = 0;i < json.data.length; i++){
      if(this.data.datatable.data.partid && this.data.datatable.data.hr && this.data.datatable.data.wage && (this.data.datatable.data.hr != json.data[5] | this.data.datatable.data.wage != json.data[6])){
            wg = {
                partid : json.data[0],
                hr : this.data.datatable.data.hr,
                wage : this.data.datatable.data.wage,
                begintime : this.data.datatable.data.begintime,
                ed : this.data.datatable.data.ed
            };
            values.push(wg);
      };   
    };
    print(values);
    // this.form.confirm("wran", "新增工时确认", "您确定要新增工时吗?", 300, 100,function(){
            //执行新增代码
            wageTable.insertRow(values);
    //         this.close();
    // }, function(){
    //   this.close();
    // });

}.bind(this));


但是试用时报错,没有看懂,请老师给指导一下,下面是报错信息:

INFO
2022-03-18 14:39:22.524
2022-03-18 14:39:22.524 INFO com.x.calendar.assemble.control.schedule.AlarmTrigger - The trigger for calendar alarm execute completed.Fri Mar 18 14:39:22 GMT+08:00 2022

MT+08:00 2022

ERROR
2022-03-18 14:40:43.536
2022-03-18 14:40:43.536 ERROR com.x.base.core.project.scripting.JsonScriptingExecutor - id:d3142455-672a-4c31-9796-42376cb1af4a, name:com.x.base.core.project.scripting.JsonScriptingExecutor, message:ReferenceError: "MWF" is not defined in <eval> at line number 1, exception:javax.script.ScriptException.

javax.script.ScriptException: ReferenceError: "MWF" is not defined in <eval> at line number 1

at jdk.nashorn.api.scripting.NashornScriptEngine.throwAsScriptException(NashornScriptEngine.java:477) ~

at jdk.nashorn.api.scripting.NashornScriptEngine.evalImpl(NashornScriptEngine.java:433) ~

at jdk.nashorn.api.scripting.NashornScriptEngine$3.eval(NashornScriptEngine.java:521) ~

at com.x.base.core.project.scripting.JsonScriptingExecutor.eval(JsonScriptingExecutor.java:245)

at com.x.processplatform.service.processing.processor.AbstractProcessor.callAfterArriveScript(AbstractProcessor.java:165)

at com.x.processplatform.service.processing.processor.AbstractProcessor.arrive(AbstractProcessor.java:111)

at com.x.processplatform.service.processing.Processing.arrive(Processing.java:135)

at com.x.processplatform.service.processing.Processing.processing(Processing.java:87)

at com.x.processplatform.service.processing.Processing.processing(Processing.java:40)

at com.x.processplatform.service.processing.jaxrs.work.ActionProcessing$CallableExecute.call(ActionProcessing.java:99)

at com.x.processplatform.service.processing.jaxrs.work.ActionProcessing$CallableExecute.call(ActionProcessing.java:88)

at java.util.concurrent.FutureTask.run(FutureTask.java:264) [?:?]

at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [?:?]

at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [?:?]

at java.lang.Thread.run(Thread.java:834) [?:?]

Caused by: jdk.nashorn.internal.runtime.ECMAException: ReferenceError: "MWF" is not defined

at jdk.nashorn.internal.runtime.ECMAErrors.error(ECMAErrors.java:57) ~

at jdk.nashorn.internal.runtime.ECMAErrors.referenceError(ECMAErrors.java:319) ~

at jdk.nashorn.internal.runtime.ECMAErrors.referenceError(ECMAErrors.java:291) ~

at jdk.nashorn.internal.objects.Global.__noSuchProperty__(Global.java:1616) ~

at jdk.nashorn.internal.scripts.Script$Recompilation$895$49401AA$\^eval\_$cu1$restOf.execute(<eval>:1) ~[?:?]

at jdk.nashorn.internal.scripts.Script$Recompilation$886$9$\^eval\_$cu1$restOf.o(<eval>:13) ~[?:?]

at jdk.nashorn.internal.scripts.Script$Recompilation$864$\^eval\_.:program(<eval>:1) ~[?:?]

at jdk.nashorn.internal.runtime.ScriptFunctionData.invoke(ScriptFunctionData.java:655) ~

at jdk.nashorn.internal.runtime.ScriptFunction.invoke(ScriptFunction.java:513) ~

at jdk.nashorn.internal.runtime.ScriptRuntime.apply(ScriptRuntime.java:527) ~

at jdk.nashorn.api.scripting.NashornScriptEngine.evalImpl(NashornScriptEngine.java:428) ~

... 13 more

ERROR
2022-03-18 14:40:43.659
2022-03-18 14:40:43.659 ERROR com.x.processplatform.service.processing.processor.AeiObjects - id:2b5221d7-7fc3-47ac-86bb-3bdd6a1d7202, name:com.x.processplatform.service.processing.processor.AeiObjects, message:check persist stirngValue allowEmpty error, class:com.x.processplatform.core.entity.content.Record, field:unit, can not be null or empty., exception:java.lang.Exception.

java.lang.Exception: check persist stirngValue allowEmpty error, class:com.x.processplatform.core.entity.content.Record, field:unit, can not be null or empty.

at com.x.base.core.container.checker.StringValuePersistChecker.allowEmpty(StringValuePersistChecker.java:63) ~

at com.x.base.core.container.checker.StringValuePersistChecker.check(StringValuePersistChecker.java:44) ~

44) ~

at com.x.base.core.container.EntityManagerContainer.check(EntityManagerContainer.java:90) ~

at com.x.processplatform.service.processing.processor.AeiObjects.lambda$commitRecord$45(AeiObjects.java:1282) ~

at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1655) [?:?]

at java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:658) [?:?]

at com.x.processplatform.service.processing.processor.AeiObjects.commitRecord(AeiObjects.java:1280)

at com.x.processplatform.service.processing.processor.AeiObjects.commit(AeiObjects.java:581)

at com.x.processplatform.service.processing.processor.AbstractProcessor.execute(AbstractProcessor.java:232)

at com.x.processplatform.service.processing.Processing.execute(Processing.java:195)

at com.x.processplatform.service.processing.Processing.processing(Processing.java:77)

at com.x.processplatform.service.processing.Processing.processing(Processing.java:40)

at com.x.processplatform.service.processing.Processing.processing(Processing.java:95)

at com.x.processplatform.service.processing.Processing.processing(Processing.java:40)

at com.x.processplatform.service.processing.jaxrs.work.ActionProcessing$CallableExecute.call(ActionProcessing.java:99)

at com.x.processplatform.service.processing.jaxrs.work.ActionProcessing$CallableExecute.call(ActionProcessing.java:88)

at java.util.concurrent.FutureTask.run(FutureTask.java:264) [?:?]

at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [?:?]

at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [?:?]

at java.lang.Thread.run(Thread.java:834) [?:?]

ERROR
2022-03-18 14:40:43.727
2022-03-18 14:40:43.727 ERROR com.x.processplatform.service.processing.processor.AeiObjects - id:f46c4aaa-f963-4843-a2cf-442736a193dd, name:com.x.processplatform.service.processing.processor.AeiObjects, message:check persist stirngValue allowEmpty error, class:com.x.processplatform.core.entity.content.Record, field:unit, can not be null or empty., exception:java.lang.Exception.

java.lang.Exception: check persist stirngValue allowEmpty error, class:com.x.processplatform.core.entity.content.Record, field:unit, can not be null or empty.

at com.x.base.core.container.checker.StringValuePersistChecker.allowEmpty(StringValuePersistChecker.java:63) ~

at com.x.base.core.container.checker.StringValuePersistChecker.check(StringValuePersistChecker.java:44) ~

at com.x.base.core.container.EntityManagerContainer.check(EntityManagerContainer.java:90) ~

at com.x.processplatform.service.processing.processor.AeiObjects.lambda$commitRecord$45(AeiObjects.java:1282) ~

at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1655) [?:?]

at java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:658) [?:?]

at com.x.processplatform.service.processing.processor.AeiObjects.commitRecord(AeiObjects.java:1280)

at com.x.processplatform.service.processing.processor.AeiObjects.commit(AeiObjects.java:581)

at com.x.processplatform.service.processing.processor.AbstractProcessor.execute(AbstractProcessor.java:232)

at com.x.processplatform.service.processing.Processing.execute(Processing.java:195)

at com.x.processplatform.service.processing.Processing.processing(Processing.java:77)

at com.x.processplatform.service.processing.Processing.processing(Processing.java:40)

at com.x.processplatform.service.processing.Processing.processing(Processing.java:95)

at com.x.processplatform.service.processing.Processing.processing(Processing.java:40)

at com.x.processplatform.service.processing.jaxrs.work.ActionProcessing$CallableExecute.call(ActionProcessing.java:99)

at com.x.processplatform.service.processing.jaxrs.work.ActionProcessing$CallableExecute.call(ActionProcessing.java:88)

ionProcessing.java:88)

at java.util.concurrent.FutureTask.run(FutureTask.java:264) [?:?]

at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [?:?]

at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [?:?]

at java.lang.Thread.run(Thread.java:834) [?:?]

:?]

INFO
2022-03-18 14:41:21.497
2022-03-18 14:41:21.497 INFO com.x.program.center.schedule.FireSchedule - fire schedule className: com.x.calendar.assemble.control.schedule.AlarmTrigger, cron: 0/30 * * * * ?, node: 127.0.0.1, application: com.x.base.core.project.x_calendar_assemble_control.

INFO
2022-03-18 14:41:21.513
2022-03-18 14:41:21.513 INFO com.x.program.center.schedule.FireSchedule - fire schedule className: com.x.processplatform.assemble.surface.schedule.CleanKeyLock, cron: 2 0/2 * * * ?, node: 127.0.0.1, application: com.x.base.core.project.x_processplatform_assemble_surface.

INFO
2022-03-18 14:41:21.529
2022-03-18 14:41:21.529 INFO com.x.program.center.schedule.FireSchedule - fire schedule className: com.x.processplatform.service.processing.schedule.TouchDelay, cron: 5 0/5 * * * ?, node: 127.0.0.1, application: com.x.base.core.project.x_processplatform_service_processing.

INFO
2022-03-18 14:41:21.544
2022-03-18 14:41:21.544 INFO com.x.program.center.schedule.FireSchedule - fire schedule className: com.x.hotpic.assemble.control.schedule.InfoExistsCheckTask, cron: 0 0/10 * * * ?, node: 127.0.0.1, application: com.x.base.core.project.x_hotpic_assemble_control.

INFO
2022-03-18 14:41:21.560
2022-03-18 14:41:21.560 INFO com.x.program.center.schedule.FireSchedule - fire schedule className: com.x.bbs.assemble.control.schedule.SubjectReplyTotalStatisticTask, cron: 0 40 * * * ?, node: 127.0.0.1, application: com.x.base.core.project.x_bbs_assemble_control.

INFO
2022-03-18 14:41:21.576
2022-03-18 14:41:21.576 INFO com.x.program.center.schedule.FireSchedule - fire schedule className: com.x.cms.assemble.control.timertask.Timertask_BatchOperationTask, cron: 0 */5 * * * ?, node: 127.0.0.1, application: com.x.base.core.project.x_cms_assemble_control.

INFO
2022-03-18 14:41:21.576
2022-03-18 14:41:21.576 INFO com.x.program.center.schedule.FireSchedule - fire schedule className: com.x.query.service.processing.schedule.CrawlWork, cron: 40 40 10,12,14,16 * * ?, node: 127.0.0.1, application: com.x.base.core.project.x_query_service_processing.

INFO
2022-03-18 14:41:21.607
2022-03-18 14:41:21.607 INFO com.x.program.center.schedule.FireSchedule - fire schedule className: com.x.organization.assemble.personal.schedule.DisableExpiredEmpower, cron: 0 0/20 * * * ?, node: 127.0.0.1, application: com.x.base.core.project.x_organization_assemble_personal.

INFO
2022-03-18 14:41:22.628
2022-03-18 14:41:22.628 INFO com.x.calendar.assemble.control.schedule.AlarmTrigger - The trigger for calendar alarm execute completed.Fri Mar 18 14:41:22 GMT+08:00 2022

INFO
2022-03-18 14:41:22.628
2022-03-18 14:41:22.628 INFO com.x.processplatform.service.processing.schedule.TouchDelay - 完成触发0个延时工作, 耗时:0ms.

INFO
2022-03-18 14:41:22.706
2022-03-18 14:41:22.706 INFO com.x.cms.assemble.control.timertask.Timertask_BatchOperationTask - Timertask_BatchOperationTask -> not found any cms batch operation, try to check unreview document in database......

INFO
2022-03-18 14:41:22.706
2022-03-18 14:41:22.706 INFO com.x.hotpic.assemble.control.service.HotPictureInfoServiceAdv - Hotpicture document exists check excute completed.

INFO
2022-03-18 14:41:22.706
2022-03-18 14:41:22.706 INFO com.x.hotpic.assemble.control.schedule.InfoExistsCheckTask - Timertask Hotpicture InfoExistsCheckTask excute completed.

INFO
2022-03-18 14:41:22.706
2022-03-18 14:41:22.706 INFO com.x.cms.assemble.control.timertask.Timertask_BatchOperationTask - Timertask_BatchOperationTask -> batch operations timer task excute completed.

INFO
2022-03-18 14:41:22.769
2022-03-18 14:41:22.769 INFO com.x.bbs.assemble.control.schedule.SubjectReplyTotalStatisticTask - Timertask completed and excute success.

cute success.




论坛管理员 发表于 2022-3-21 10:50:20

这个是前后端脚本的差异,您可以不要放在流程的事件中,放在表单的beforeprocess或者afterProcess事件中去执行,也是一样的效果

Dffiltri 发表于 2022-3-22 11:02:23

论坛管理员 发表于 2022-3-21 10:50
这个是前后端脚本的差异,您可以不要放在流程的事件中,放在表单的beforeprocess或者afterProcess事件中去 ...

谢谢,成功设置

论坛管理员 发表于 2022-3-22 13:43:59

:)
页: [1]
查看完整版本: 流程保存表单到自定义表报错