使用 ILog Jrule 中的 BAL 从输入字符串类型参数值中删除空格

编程入门 行业动态 更新时间:2024-10-18 08:37:11
本文介绍了使用 ILog Jrule 中的 BAL 从输入字符串类型参数值中删除空格的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时送ChatGPT账号..

我有一个采用字符串类型输入参数的规则.我可以使用 BAL 从这个参数保存的值中删除空格吗?

I have a rule which take a String type input parameter. Can I remove the whitespaces from the value this parameter holds using BAL.

如果不是,还有什么其他选择可以做到这一点.在这个 JRule 中有一个决策表,其中条件列是这个参数,然后输出是动作列.

If not what is the other option to do this. In this JRule there is a decision table where condition column is this parameter and then output is action column.

假设您为 Rule IsDepartmentManager 定义了 String 类型的规则集参数名称",其中输出规则集参数是布尔值.

Say you define Rulset Paramter "Name" of type String for Rule IsDepartmentManager where output ruleset parameter is boolean.

现在在决策表中,Name 列中的值是John",因此为 True.否则为假.

Now in the decision table the values in Name column is say "John" and out for this is True. Otherwise False.

现在当这个规则作为网络服务被调用时,输入发送是John".由于名称包含空格,决策表进行精确匹配,结果返回False.

Now when this rule is invoked as web-service the input send is "John ". As the name contains white spaces and the decision table do the exact matching, the result return is False.

推荐答案

您可以添加 Initial Action 在您的规则任务(包含决策表或规则)中,您可以在其中执行输入字符串.修剪();

You can add an Initial Action in your Rule Task (that contains the Decision Table or the rule) in which you can execute theInputString.trim();

这篇关于使用 ILog Jrule 中的 BAL 从输入字符串类型参数值中删除空格的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

更多推荐

[db:关键词]

本文发布于:2023-04-26 03:15:36,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1128934.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:空格   字符串   参数   类型   ILog

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!