检索记录问题

发布于 2024-07-06 07:15:39 字数 741 浏览 5 评论 0原文

好吧,这可能不是最好的主题...

我正在应用程序中设置审批工作流程。 我将用户名和金额传递给子程序,并找出审批流程需要使用什么工作流程。 我以为我可以正常工作,直到我尝试处理尚未设置用户的情况。

因此,在我的表中,我有:

wfid    wfuser    wfamt
1         user1      0
2         user2      0
2         user2      10000.00

现在,如果 user3 尝试向工作流程发送某些内容,则它不会发送,因为它们尚未设置。 (请注意,我有另一个包含实际流定义的表)

我有这个代码来检索正确的工作流程:

     setgt (userId:amount) ARWFR1;
     readp ARWFR1;
     return wfid;

显然,如果用户设置正确,这将有效。 然而,把我们的 user3 sinareo 放回去,它就不能正常工作了。 然后我尝试了:

     setgt (userId:amount) ARWFR1;
     readpe (userId) ARWFR1;
     if (%eof());
       return 0;
     endif;
     return wfid;

这并没有像我预期的那样工作。 我确信我错过了明显的事情,你能看到吗? 我希望我目前的逻辑足够清晰。

Okay, that may not be the best subject...

I am setting up an approval workflow within an application. I pass the username and the dollar amount to the subprocedure and figure out what workflow I need to use for the approval process. I thought I had this working until I try to handle the condition when the user hasn't been setup.

So in my table I have:

wfid    wfuser    wfamt
1         user1      0
2         user2      0
2         user2      10000.00

Now if user3 tries to send something to the workflow, it shouldn't go becuase they are not setup. (Please note I have another table that contains the actual flow definition)

I had this code to retrieve the correct workflow:

     setgt (userId:amount) ARWFR1;
     readp ARWFR1;
     return wfid;

Obviously this works if the user is properly setup. However, throw our user3 sinareo back in and it won't work right. So then I tried:

     setgt (userId:amount) ARWFR1;
     readpe (userId) ARWFR1;
     if (%eof());
       return 0;
     endif;
     return wfid;

This is not working as I had expected. I am sure I am missing obvious, can you see it? I hope my current logic is clear enough.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

心欲静而疯不止 2024-07-13 07:15:39

对我有用的解决方案可以在以下位置找到: http://archive.midrange .com/rpg400-l/200809/msg00509.html

The solution that worked for me can be found at: http://archive.midrange.com/rpg400-l/200809/msg00509.html

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文