首页 > 解决方案 > webSdk 过程的参数顺序

问题描述

我需要使用与订单和报价相关的 websdk 创建一些报告。我尝试按照文档进行操作,但即使是开发人员门户中给出的示例也缺少很多关键信息。

具体来说,我需要使用这两个过程:

我尝试围绕https://prioritysoftware.github.io/api/procedure/#Introduction上的示例编写一些逻辑

const procedure = priority.procStart(PROC_NAME,"R", () => {},customerName, function(procSuccess){
                        logger.info('Proc start OK, received documentOptions');
                        logger.info(JSON.stringify(procSuccess));
                        logger.info('Specifying format...');
                        resolve(new Promise((resolve, reject) => {
                            procSuccess.proc.documentOptions(1,1,2,procSuccess => {
                                logger.info('Received inputFields');
                                logger.info(JSON.stringify(procSuccess));
                                procSuccess.proc.inputFields(1,{ORDNUM: ordernum}, procSuccess => {
                                    logger.info('Received url');
                                    logger.info(JSON.stringify(procSuccess));
                                });
                            }, procError => {
                                reject(procError)
                            })
                        }));
                    }, function(procError){
                        logger.error('Proc start error');
                        logger.error(procError);
                        reject(procError);
                    });
                }).catch(err => {
                    logger.error(err);
                })

其中 PROC_NAME 是 WWWSHOWORDER

我试图了解这个过程对我的要求,但还不是很清楚。我尝试按照文档指定的顺序提供一些值,但是对于不了解优先级来龙去脉的人来说,我得到的错误描述性不是很强。

日志看起来像这样

 Starting Procedure WWWSHOWORDER
2019-11-26T11:55:31.718Z info: Proc start OK, received documentOptions
2019-11-26T11:55:31.719Z info: {"proc":{"name":"WWWSHOWORDER"},"type":"message","message":"No such Tabula entity"}
2019-11-26T11:55:31.721Z info: Specifying format...
2019-11-26T11:55:32.124Z info: Received inputFields
2019-11-26T11:55:32.125Z info: {"proc":{"name":"WWWSHOWORDER"},"type":"message","message":"Failure to p...

不幸的是,由于某种奇怪的原因,我的日志被截断了......

编辑:

我转而尝试使用 ESH_WWWSHOWORDER3,我得到了一个 inputFields 参数,我希望我需要做的是获取 iinputFields.input.EditFields 对象,并用订单名称填充值字段,我想,不幸的是这会导致来自服务器的 500 错误...

 {"proc":{"title":"(אישור הזמנה עם מפרט ללקוח (פריו","name":"ESH_WWWSHOWORDER3"},"type":"inputFields","input":{"EditFields":[{"field":1,"helpstring":"","ispassword":0,"mandatory":0,"operator":0,"readonly":0,"title":"Order","type":"text","code":"Str","value":"*","value1":"","maxlength":56,"zoom":"Zoom","format":""}],"Operators":[{"name":"= ","op":0,"title":"equals"},{"name":"< ","op":1,"title":"less than"},{"name":"<=","op":2,"title":"less than or equal to"},{"name":"> ","op":3,"title":"greater than"},{"name":">=","op":4,"title":"greater than or equal to"},{"name":"<>","op":5,"title":"not equal to"},{"name":"- ","op":6,"title":"between"},{"name":"! ","op":7,"title":"ולא"},{"name":"| ","op":8,"title":"או"}],"text":"","title":"Parameter Input"}}
2019-12-02T09:07:10.129Z info: Specifying input...
2019-12-02T09:07:10.550Z error: @@@Can't connect to server. HTTP Response: 500, Internal Server Error
details: <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" xmlns:u="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"><s:Header><o:Security s:mustUnderstand="1" xmlns:o="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"><u:Timestamp u:Id="_0"><u:Created>2019-12-02T09:07:07.700Z</u:Created><u:Expires>2019-12-02T09:12:07.700Z</u:Expires></u:Timestamp></o:Security></s:Header><s:Body><s:Fault><faultcode xmlns:a="http://schemas.microsoft.com/net/2005/12/windowscommunicationfoundation/dispatcher">a:InternalServiceFault</faultcode><faultstring xml:lang="he-IL">Object reference not set to an instance
of an object.</faultstring><detail><ExceptionDetail xmlns="http://schemas.datacontract.org/2004/07/System.ServiceModel" xmlns:i="http://www.w3.org/2001/XMLSchema-instance"><HelpLink i:nil="true"/><InnerException i:nil="true"/><Message>Object reference not set to an instance of an object.</Message><StackTrace>   at WCFService.ProcEditFieldsOKMob(String session, Boolean save, Byte[] xml)&#xD;
   at SyncInvokeProcEditFieldsOKMob(Object , Object[] , Object[] )&#xD;
   at System.ServiceModel.Dispatcher.SyncMethodInvoker.Invoke(Object instance, Object[] inputs, Object[]&amp; outputs)&#xD;
   at System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(MessageRpc&amp; rpc)&#xD;
   at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage5(MessageRpc&amp; rpc)&#xD;
   at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage11(MessageRpc&amp; rpc)&#xD;
   at System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean isOperationContextSet)</StackTrace><Type>System.NullReferenceException</Type></ExceptionDetail></detail></s:Fault></s:Body></s:Envelope>

同样,关于这个主题的文档似乎不是很详细,EditFields 对象本身的描述也不是很好......

我也不是经验丰富的优先用户,所以我不确定我需要导航到哪里来查看这些程序以及其他什么。

标签: priority-web-sdk

解决方案


您似乎将“R”作为第二个参数传递,这意味着您正在调用报告。尝试通过“P”代替。

另外,customerName 是什么?根据 Web SDK,我认为这应该是 dname:“运行该程序的公司的内部名称。”

您可以通过转到 SystemManagement -> Generators -> Procedures -> Procedure Generator并查询它来判断 WWWSHOWORDER 是一个过程而不是一个报告。如果您在过程生成器中找到它 - 它是一个过程(在这种情况下,它是一个生成报告的过程),您应该使用“P”参数调用它。

如果您在Management -> Generators -> Reports-> ReportGenerator其普通报告中找到实体,则应使用“R”参数调用它。


推荐阅读