[Share] RSB语言实战

RSB语言是知行EDI系统内实施使用的语言,方便用户处理和实现个性化业务。RSB语言依赖知行EDI系统自带的RSB引擎。
更多相关知识可安装下载知行EDI系统后,在HELP界面查看。

RSB语言包含类型

RSB语言中所有的函数以及格式化是针对item或者属性的,取值使用的是方括号[]。

关键字

RSB语言的关键字与其他编程语言不同,所有的关键字前都带有 “rsb:”,使用时将关键字放在一组尖括号中,和标签一样使用,值放在属性value中,也可以放置在两个关键字标签内。

如设置test对象的一个属性name的值为demo,以下两种方式都可以。

还有很多其他语言支持的,比如枚举 rsb:enum,跳出循环 rsb:break,switch…case语句 rsb:switch rsb:case等等。

格式化方法

RSB语言中包含了许多格式化的方法,主要分为以下几类:

字符串格式化:支持对字符串的查找,比较以及空格等特殊字符的处理,如将字符串“ABCD”中的A替换为a:

日期格式化:支持对日期格式的转换,例如将格式为YYMMDD 的日期 200225 转换为 YYYYMMDD的格式 20200225:

数字格式化:支持不同类型的数字格式转换,以及数字的运算,计算 4/2 的值:

文件格式化:支持对文件的处理,获取文件名称:

其他特殊格式化:支持对XML, CSV等格式文件的处理。

不同的格式化,所需要的参数和返回类型都不同,需要参考格式化使用指南。

函数

RSB中自带了许多的函数,主要用于处理不同的对象,包括:

  • 数据库操作函数:对接数据库和运行数据库SQL;
  • EXCEL 操作函数:对EXCEL 的创建,删除,读取等等;
  • XML 操作函数:对XML 的创建,删除,读取等等;
  • 文件操作函数:对文件的创建,删除,读取等等;
  • 其他函数。

不同的函数输入的对象和返回的结果不一样,需要参考操作手册。

RSB语言的使用环境

端口

知行EDI系统中包含的端口,支持自定义脚本,输入的文件会按照自定义脚本处理。比如,用户需要根据业务逻辑,抛出定义的异常,如下。

可以使用rsb:check关键字检查该值是否为空:

或者直接使用rsb:try和rsb:catch关键字将可能出现异常的表达式包起来:

Event 事件

知行EDI系统中每个端口都有一个Event页面,支持在文件处理前,处理后,转发前等对文件进行处理,处理逻辑则需要使用RSB语言实现。

RSB 文件

RSB引擎会对RSB语句编写的RSB文件进行处理,包括以下几类文件:

  • .rst文件:支持在输出,可以直接访问;
  • .rsb文件:用于函数以及逻辑的实现,可以被调用和放在其他的rst文件中;
  • .rsd文件:放配置数据。

千里之行,始于足下。学会一门语言最好的办法就是开始,快下载知行EDI系统开始你的RSB之旅吧!

了解更多EDI讯息,请您电话 150-0298-3180 / 177-8250-8152 或邮件 edi@kasoftware.cn 联系我们,获取 30 天全功能 免费试用 版本EDI软件。
标签: , , , , , , , ,
文章分类 edi 电子数据交换, edi方案工作流, mft 管理文件传输, share 知识分享, 动态
25 条评论在 “[Share] RSB语言实战” 上
  1. I was pretty pleased to discover this website. I need to to thank you for ones time just for this wonderful read!!
    I definitely enjoyed every bit of it and i also have you saved as a favorite to see
    new things in your web site.

  2. I simply could not leave your website prior to suggesting that I really loved the usual info
    an individual provide for your visitors? Is gonna be back frequently to
    inspect new posts

  3. This is the perfect blog for everyone who would like to find out about this topic.

    You know so much its almost tough to argue with you (not that I really will need to…HaHa).
    You definitely put a fresh spin on a subject that has been discussed for decades.
    Excellent stuff, just great!

  4. black mass说道:

    Excellent site. A lot of useful info here. I am sending it to a few friends ans additionally sharing in delicious.
    And naturally, thanks on your effort!

  5. cheap flights说道:

    Thanks , I’ve recently been searching for info approximately this subject for ages and yours is
    the greatest I have discovered till now. However, what about the conclusion? Are you positive about the source?

  6. cheap flights说道:

    When some one searches for his required thing, thus he/she wishes to be available that in detail, thus that thing is maintained over here.

  7. cheap flights说道:

    It’s going to be ending of mine day, but before end I am
    reading this impressive paragraph to increase my knowledge.

  8. cheap flights说道:

    I simply couldn’t leave your site before suggesting
    that I extremely loved the usual info a person supply on your visitors?
    Is gonna be back incessantly to check up on new posts

  9. cheap flights说道:

    Hello there! This article could not be written much better!
    Looking through this article reminds me of my previous roommate!
    He always kept preaching about this. I’ll forward
    this post to him. Pretty sure he’ll have a good read.
    Thank you for sharing!

  10. cheap flights说道:

    I will right away clutch your rss feed as I can not in finding your email subscription link or newsletter service.

    Do you have any? Please allow me recognise in order that I may subscribe.
    Thanks. 31muvXS cheap flights

  11. cheap flights说道:

    I enjoy, result in I discovered just what I used to be looking for.
    You’ve ended my 4 day long hunt! God Bless you man. Have a nice day.

    Bye

  12. cheap flights说道:

    Hi, its fastidious post regarding media print, we all be
    familiar with media is a great source of information. 34pIoq5 cheap flights

  13. cheap flights说道:

    Excellent post. I was checking continuously this blog and I’m impressed!
    Extremely useful info particularly the last part :) I care for such info much.

    I was seeking this certain info for a long time.
    Thank you and good luck. cheap flights y2yxvvfw

  14. web hosting说道:

    Heya i’m for the first time here. I found this board and I find It truly useful & it helped me out
    a lot. I hope to give something back and aid others like you aided me.

  15. cheap flights说道:

    My brother suggested I would possibly like this blog. He
    used to be entirely right. This submit truly made my day.
    You cann’t consider just how so much time I had spent
    for this info! Thank you! cheap flights 3gqLYTc

  16. cheap flights说道:

    This web site certainly has all of the information and facts I wanted concerning this subject and didn’t know who to ask.

    34pIoq5 cheap flights

  17. cheap flights说道:

    I’m curious to find out what blog platform you happen to be using?
    I’m experiencing some minor security problems with my latest
    blog and I’d like to find something more safe. Do you have any solutions?
    31muvXS cheap flights

  18. cheap flights说道:

    If some one wants to be updated with most recent technologies afterward he
    must be visit this website and be up to date
    daily.

  19. cheap flights说道:

    Sweet blog! I found it while searching on Yahoo News. Do you have any tips on how to get listed in Yahoo
    News? I’ve been trying for a while but I never seem to
    get there! Thanks

  20. Hey very nice blog!

  21. My partner and I absolutely love your blog and find most
    of your post’s to be what precisely I’m looking for.
    can you offer guest writers to write content in your case?
    I wouldn’t mind composing a post or elaborating on a
    number of the subjects you write about here. Again, awesome website!

  22. I got this site from my pal who informed me regarding this web site and now this time I am
    visiting this site and reading very informative articles or reviews at this place.

  23. It is appropriate time to make some plans for the long run and it’s time to
    be happy. I’ve read this post and if I could I wish to recommend you few interesting things or
    advice. Maybe you can write next articles referring to this article.
    I want to read even more things about it!

  24. Pretty component of content. I simply stumbled upon your site and in accession capital to assert
    that I acquire in fact enjoyed account your
    blog posts. Any way I’ll be subscribing in your feeds or even I achievement you get
    entry to consistently rapidly. adreamoftrains web hosting reviews

  25. This design is steller! You certainly know how to keep a reader amused.
    Between your wit and your videos, I was almost moved to
    start my own blog (well, almost…HaHa!) Great job. I really loved what you had to say, and more than that,
    how you presented it. Too cool!

发表评论

电子邮件地址不会被公开。

您可以使用这些HTML标签和属性: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">