查看: 1602|回复: 3

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

升级   5.48%

34

主题

74

回帖

548

积分

注册会员

Rank: 2

积分
548
发表于 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 [ContextQuartzScheduler-x_calendar_assemble_control_Worker-1] 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 [ProcessPlatformExecutor-25] 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) ~[jdk.scripting.nashorn:?]

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

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

at com.x.base.core.project.scripting.JsonScriptingExecutor.eval(JsonScriptingExecutor.java:245) [x_base_core_project.jar:?]

at com.x.processplatform.service.processing.processor.AbstractProcessor.callAfterArriveScript(AbstractProcessor.java:165) [classes/:?]

at com.x.processplatform.service.processing.processor.AbstractProcessor.arrive(AbstractProcessor.java:111) [classes/:?]

at com.x.processplatform.service.processing.Processing.arrive(Processing.java:135) [classes/:?]

at com.x.processplatform.service.processing.Processing.processing(Processing.java:87) [classes/:?]

at com.x.processplatform.service.processing.Processing.processing(Processing.java:40) [classes/:?]

at com.x.processplatform.service.processing.jaxrs.work.ActionProcessing$CallableExecute.call(ActionProcessing.java:99) [classes/:?]

at com.x.processplatform.service.processing.jaxrs.work.ActionProcessing$CallableExecute.call(ActionProcessing.java:88) [classes/:?]

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) ~[jdk.scripting.nashorn:?]

at jdk.nashorn.internal.runtime.ECMAErrors.referenceError(ECMAErrors.java:319) ~[jdk.scripting.nashorn:?]

at jdk.nashorn.internal.runtime.ECMAErrors.referenceError(ECMAErrors.java:291) ~[jdk.scripting.nashorn:?]

at jdk.nashorn.internal.objects.Global.__noSuchProperty__(Global.java:1616) ~[jdk.scripting.nashorn:?]

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) ~[jdk.scripting.nashorn:?]

at jdk.nashorn.internal.runtime.ScriptFunction.invoke(ScriptFunction.java:513) ~[jdk.scripting.nashorn:?]

at jdk.nashorn.internal.runtime.ScriptRuntime.apply(ScriptRuntime.java:527) ~[jdk.scripting.nashorn:?]

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

... 13 more

ERROR
2022-03-18 14:40:43.659
2022-03-18 14:40:43.659 [ProcessPlatformExecutor-25] 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) ~[x_base_core_project.jar:?]

at com.x.base.core.container.checker.StringValuePersistChecker.check(StringValuePersistChecker.java:44) ~[x_base_core_project.jar:?]

44) ~[x_base_core_project.jar:?]

at com.x.base.core.container.EntityManagerContainer.check(EntityManagerContainer.java:90) ~[x_base_core_project.jar:?]

at com.x.processplatform.service.processing.processor.AeiObjects.lambda$commitRecord$45(AeiObjects.java:1282) ~[classes/:?]

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) [classes/:?]

at com.x.processplatform.service.processing.processor.AeiObjects.commit(AeiObjects.java:581) [classes/:?]

at com.x.processplatform.service.processing.processor.AbstractProcessor.execute(AbstractProcessor.java:232) [classes/:?]

at com.x.processplatform.service.processing.Processing.execute(Processing.java:195) [classes/:?]

at com.x.processplatform.service.processing.Processing.processing(Processing.java:77) [classes/:?]

at com.x.processplatform.service.processing.Processing.processing(Processing.java:40) [classes/:?]

at com.x.processplatform.service.processing.Processing.processing(Processing.java:95) [classes/:?]

at com.x.processplatform.service.processing.Processing.processing(Processing.java:40) [classes/:?]

at com.x.processplatform.service.processing.jaxrs.work.ActionProcessing$CallableExecute.call(ActionProcessing.java:99) [classes/:?]

at com.x.processplatform.service.processing.jaxrs.work.ActionProcessing$CallableExecute.call(ActionProcessing.java:88) [classes/:?]

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 [ProcessPlatformExecutor-25] 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) ~[x_base_core_project.jar:?]

at com.x.base.core.container.checker.StringValuePersistChecker.check(StringValuePersistChecker.java:44) ~[x_base_core_project.jar:?]

at com.x.base.core.container.EntityManagerContainer.check(EntityManagerContainer.java:90) ~[x_base_core_project.jar:?]

at com.x.processplatform.service.processing.processor.AeiObjects.lambda$commitRecord$45(AeiObjects.java:1282) ~[classes/:?]

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) [classes/:?]

at com.x.processplatform.service.processing.processor.AeiObjects.commit(AeiObjects.java:581) [classes/:?]

at com.x.processplatform.service.processing.processor.AbstractProcessor.execute(AbstractProcessor.java:232) [classes/:?]

at com.x.processplatform.service.processing.Processing.execute(Processing.java:195) [classes/:?]

at com.x.processplatform.service.processing.Processing.processing(Processing.java:77) [classes/:?]

at com.x.processplatform.service.processing.Processing.processing(Processing.java:40) [classes/:?]

at com.x.processplatform.service.processing.Processing.processing(Processing.java:95) [classes/:?]

at com.x.processplatform.service.processing.Processing.processing(Processing.java:40) [classes/:?]

at com.x.processplatform.service.processing.jaxrs.work.ActionProcessing$CallableExecute.call(ActionProcessing.java:99) [classes/:?]

at com.x.processplatform.service.processing.jaxrs.work.ActionProcessing$CallableExecute.call(ActionProcessing.java:88) [classes/:?]

ionProcessing.java:88) [classes/:?]

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 [ContextQuartzScheduler-x_program_center_Worker-1] 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 [ContextQuartzScheduler-x_program_center_Worker-1] 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 [ContextQuartzScheduler-x_program_center_Worker-1] 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 [ContextQuartzScheduler-x_program_center_Worker-1] 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 [ContextQuartzScheduler-x_program_center_Worker-1] 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 [ContextQuartzScheduler-x_program_center_Worker-1] 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 [ContextQuartzScheduler-x_program_center_Worker-1] 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 [ContextQuartzScheduler-x_program_center_Worker-1] 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 [ContextQuartzScheduler-x_calendar_assemble_control_Worker-2] 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 [ContextQuartzScheduler-x_processplatform_service_processing_Worker-2] 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 [ContextQuartzScheduler-x_cms_assemble_control_Worker-1] 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 [ContextQuartzScheduler-x_hotpic_assemble_control_Worker-1] 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 [ContextQuartzScheduler-x_hotpic_assemble_control_Worker-1] 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 [ContextQuartzScheduler-x_cms_assemble_control_Worker-1] 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 [ContextQuartzScheduler-x_bbs_assemble_control_Worker-2] INFO com.x.bbs.assemble.control.schedule.SubjectReplyTotalStatisticTask - Timertask[SubjectTotalStatisticTask] completed and excute success.

cute success.




回复

使用道具 举报

升级   100%

139

主题

1万

回帖

4万

积分

超级版主

Rank: 8Rank: 8

积分
41458
发表于 2022-3-21 10:50:20 | 显示全部楼层
这个是前后端脚本的差异,您可以不要放在流程的事件中,放在表单的beforeprocess或者afterProcess事件中去执行,也是一样的效果
回复

使用道具 举报

升级   5.48%

34

主题

74

回帖

548

积分

注册会员

Rank: 2

积分
548
发表于 2022-3-22 11:02:23 | 显示全部楼层
论坛管理员 发表于 2022-3-21 10:50
这个是前后端脚本的差异,您可以不要放在流程的事件中,放在表单的beforeprocess或者afterProcess事件中去 ...

谢谢,成功设置
回复

使用道具 举报

升级   100%

139

主题

1万

回帖

4万

积分

超级版主

Rank: 8Rank: 8

积分
41458
发表于 2022-3-22 13:43:59 | 显示全部楼层
回复

使用道具 举报

发表回复

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

联系客服 关注微信 下载APP 返回顶部 返回列表
viewthread