SlideShare une entreprise Scribd logo
1  sur  22
Télécharger pour lire hors ligne
Scala in our BRMS
~BRMS開発でのScala利用事例~
                                                        BRMS: Business Rule Management System



                 三菱UFJインフォメーションテクノロジー株式会社
                                 ITプロデュース部
                                      土佐鉄平
                    Mitsubishi UFJ Information Technology, Ltd.
                                            IT Production Dept.
                                                   Teppei Tosa



     All Rights Reserved,Copyright © 2013 Mitsubishi UFJ Information Tecnology,Ltd.       1
Agenda
1.   About MUFG, MUIT
2.   About BRMS
3.   About our original BRMS, “BIWARD”
4.   How we have used Scala’s features in
     BIWARD
       Using the Recursive Call function
       Using DSL
5. Our thoughts on Scala in developing
   Enterprise Applications
            All Rights Reserved,Copyright © 2013 Mitsubishi UFJ Information Tecnology,Ltd.   2
About MUFG                                                                                       出典:MUFG Corporate Review
                                                                           http://www.mufg.jp/english/ir/annualreport/2012mufg/pdf/mar/cr1202.pdf




      All Rights Reserved,Copyright © 2013 Mitsubishi UFJ Information Tecnology,Ltd.                                        3
About MUIT
(Mitsubishi UFJ Information Technology, Ltd.)
 Started on July 1st, 2009 when these three companies merged
       Tokyo Mitsubishi Information Technology, Ltd.
       UFJ Hitachi Systems, Ltd.
       UFJIS, Ltd.
                                                                       For Bank Systems
 Amount of Capital: 181 million yen
     Capital from Bank of
                                               For Securities’ system                            For Credit Cards
     Tokyo Mitsubishi UFJ: 85%
     Capital from MUFG: 15%

 Currently over 1500 employees
                                           For Lease Systems                                     For MUFG’s Members



                                                                 For outside financial institutions




                    All Rights Reserved,Copyright © 2013 Mitsubishi UFJ Information Tecnology,Ltd.                  4
About BRMS
(Business Rule Management System)
アプリケーションから、ビジネスルール(業務判断ロジック)を切出して実行・設計・
管理を行うためのフレームワーク
BRMS is a framework that separates business logic from software
applications and executes, designs and manages that logic.
                                  WEB/AP Server                                                 Executes
                                                                                                 Executes
          Business Application
                                                                Rule Engine                     DB
          Framework      (ex. JavaEE)
                                                                                               Server
Client
            WEB/AP Server              (ex. Cosminexus、Websphere、GlassFish)

                                OS    (ex. RedhatLinux、AIX)



                Designs
                Designs                                                    Rule Base             Manages
                                                                                                 Manages
              All Rights Reserved,Copyright © 2013 Mitsubishi UFJ Information Tecnology,Ltd.            5
All Rights Reserved,Copyright © 2013 Mitsubishi UFJ Information Tecnology,Ltd.   6
The Reason for Creating an Original BRMS
金融関連のBRMS事例は保険のバックオフィス業務への適用が多いが、銀行では対面型業務での適用ニーズがあり、市場
製品では「前進判断」機能のみのため、これに応えることができない。
In the financial industry, there are some back-offices at insurance companies that use BRMSs. However, all banks
have to use BRMS for their teller-window type operations. Other BRMS products cannot fulfill our needs because
they have only “forward execution” functions.

 Back-office Type
  Input operations are fixed.




       Papers




                                  The system calculates how
                Rule Engine       payments need to be made
                                  based on accident and
                                  contract information.

                              All Rights Reserved,Copyright © 2013 Mitsubishi UFJ Information Tecnology,Ltd.       7
The Reason for Creating an Original BRMS
金融関連のBRMS事例は保険のバックオフィス業務への適用が多いが、銀行では対面型業務での適用ニーズがあり、市場
製品では「前進判断」機能のみのため、これに応えることができない。
In the financial industry, there are some back-offices at insurance companies that use BRMSs. However, all banks
have to use BRMS for their teller-window type operations. Other BRMS products cannot fulfill our needs because
they have only “forward execution” functions.

 Back-office Type                                                   Teller-window Type
  Input operations are fixed.                                        At teller-windows, we interact directly with
                                                                     customers, so we require a BRMS with not only
                                                                     “forward execution” but also “backward execution”.


       Papers



                                                                                               Sorry, we can’t authenticate
                                                                                               you with this kind of ID.
                                                                                                    【forward execution】
                                                                                                                      】
                                                                                So, what should I do?

                                                                                             If you have a driver’s license or a
                                                                                             health insurance ID card…
                                  The system calculates how
                Rule Engine       payments need to be made                                          【backward execution】
                                                                                                                       】
                                  based on accident and
                                                                               I have a health
                                  contract information.
                                                                               insurance ID card.
                              All Rights Reserved,Copyright © 2013 Mitsubishi UFJ Information Tecnology,Ltd.                       8
Algorithm for BIWARD
Logic operating in a TREE form




                All Rights Reserved,Copyright © 2013 Mitsubishi UFJ Information Tecnology,Ltd.   9
Algorithm for BIWARD
Logic operating in a TREE form
  Forward Execution




                      All Rights Reserved,Copyright © 2013 Mitsubishi UFJ Information Tecnology,Ltd.   10
Algorithm for BIWARD
Logic operating in a TREE form                                        Logic operating as a NETWORK
  Forward Execution




                      All Rights Reserved,Copyright © 2013 Mitsubishi UFJ Information Tecnology,Ltd.   11
Algorithm for BIWARD
Logic operating in a TREE form                                        Logic operating as a NETWORK
  Forward Execution                                                     Forward Exec.




                      All Rights Reserved,Copyright © 2013 Mitsubishi UFJ Information Tecnology,Ltd.   12
Algorithm for BIWARD
Logic operating in a TREE form                                        Logic operating as a NETWORK
  Forward Execution                                                     Forward Exec.         Backward Exec.




                      All Rights Reserved,Copyright © 2013 Mitsubishi UFJ Information Tecnology,Ltd.           13
Algorithm for BIWARD
Logic operating in a TREE form                                        Logic operating as a NETWORK
  Forward Execution                                                     Forward Exec.         Backward Exec.   Biward Exec.




                      All Rights Reserved,Copyright © 2013 Mitsubishi UFJ Information Tecnology,Ltd.           14
Example: Logic for Authentication
                             Conditions                                                             Result
    Bring a                   Have a                           Bring a
                                                                                         Can authenticate
driver’s license             home loan                      resident card

                                                                   YES                               YES
                                  YES
     YES                                                            NO                               NO


                                   NO                                                                YES


      NO                                                                                             NO

                   All Rights Reserved,Copyright © 2013 Mitsubishi UFJ Information Tecnology,Ltd.            15
Internal Structure of Logic
                                                   Root                                                  :Node


                                Conditions                                                           Result
     Bring a                     Have a                           Bring a
                                                                                             Can authenticate
 driver’s license               home loan                      resident card

                                                                      Y
                                     Y
       Y                                                                                               Y
                                                                      N

                                    N
                                                                                                       N
       N

                    All Rights Reserved,Copyright © 2013 Mitsubishi UFJ Information Tecnology,Ltd.              16
BIWARD walks on nodes recursively.
  BIWARDはRootNodeからスタートして、RootNodeまでを辿る
  辿ったNodeを記録しながら、「walk」関数を再帰的に処理していき、
  最終的に記録したNodeを結果として応答
  Scalaによって、こういった処理を非常にシンプルに構築


  BIWARD can “walk” on the network in both directions from the
  Root Node and back to the Root Node.
  The nodes use the “walk” function to call one another recursively.
  BIWARD records the nodes that have been “walked” through,
  then returns the results by displaying the recorded nodes.
  Thanks to Scala, we were able to create this program very
  elegantly.



             All Rights Reserved,Copyright © 2013 Mitsubishi UFJ Information Tecnology,Ltd.   17
Steps of Creating Rules



                                                                        Compiles
                                                                        Compiles
         XML                  register
                               register          Scala                    and
                                                                           and
                                                                        packages
                                                                        packages
                                                                                              JAR

   Exported from WEB-UI
   or input by the user




             All Rights Reserved,Copyright © 2013 Mitsubishi UFJ Information Tecnology,Ltd.         18
Using Scala’s Parser
BIWARD parses these conditional expressions with Scala’s DSL function.
<rule id=“rule1” … >
  <parameters>
                                                           運転免許証持参有無”
                                                           運転免許証持参有無
    <booleanParameter id=“hasDriversLicence” label=“運転免許証持参有無 … />
    …
  </parameters>
  <results>                                                                     Not only boolean, but
    <booleanResult id=“canAuthenticate” label=“本人確認可否本人確認可否”/>
                                                     本人確認可否                     also strings, numbers
  </results>                                                                    and date types in
  <patterns>                                                                    conditional expressions.
    <pattern>
      <conditions>
        <condition … ><![CDATA[ param(“hasDriversLicense”)==true ]]></condition>
      </conditions>
      <results>
        <booleanResult id=“canAuthenticate”>true</booleanResult>
      </results>
    </pattern>
    …               Exported Scala Code
                    Condition(Equal(
  </patterns>
                     BooleanParameter(“”“9”“”, “”“bringDriversLicense”“”,
</rule>               List(BooleanValue(true, """Yes"""), BooleanValue(false, """No"""))),
                         BooleanValue(true, """Yes""")
                       )),
                      All Rights Reserved,Copyright © 2013 Mitsubishi UFJ Information Tecnology,Ltd.   19
Thoughts on Scala
 高生産性を確かに実感
 Javaとの親和性メリットは大きい
  ScalaプログラムがJavaリソースを利用するという観点はもちろん、
  Javaに対してScalaリソースを提供するという観点でもメリット大きい。
 言語仕様が強力で、標準言語とするにはまだまだハードル高い
 Javaの置き換えではなく、ポイントを抑えた部分的な活用が有効

 Achieve a higher level of productivity
 Compatibility with Java is a strong merit
  Scala can use Java as a library, and Java can use Scala the same way.
 As a result of its elaborate syntax, it will still be difficult to adopt
 Scala as the standard.


             All Rights Reserved,Copyright © 2013 Mitsubishi UFJ Information Tecnology,Ltd.   20
Our Goal for Scala
DSLやJavaAPIを通した機能提供を前提に、より汎
用的な機能の開発にScalaを活用
To develop universal features with Scala and
supply them using DSL or Java API
                                                 DSL

        Business Application                                     Common Parts (Scala)
              (Java)                          Java API


                                                                  Common Parts (Java)

Specific features for business                                                      Universal features
                All Rights Reserved,Copyright © 2013 Mitsubishi UFJ Information Tecnology,Ltd.      21
御静聴ありがとうございました
Thank you for listening




      All Rights Reserved,Copyright © 2013 Mitsubishi UFJ Information Tecnology,Ltd.   22

Contenu connexe

Similaire à Scala in our BRMS

Cepoke Product eng
Cepoke Product engCepoke Product eng
Cepoke Product eng
incubusen
 
Apptio up cloud conference 2012 [final].pptx
Apptio up cloud conference 2012 [final].pptxApptio up cloud conference 2012 [final].pptx
Apptio up cloud conference 2012 [final].pptx
Khazret Sapenov
 

Similaire à Scala in our BRMS (20)

Cloud computing
Cloud computingCloud computing
Cloud computing
 
SOC/NOC Convergence by Spire Research
SOC/NOC Convergence by Spire ResearchSOC/NOC Convergence by Spire Research
SOC/NOC Convergence by Spire Research
 
Forecasteronline.Com
Forecasteronline.ComForecasteronline.Com
Forecasteronline.Com
 
TigerBSM
TigerBSMTigerBSM
TigerBSM
 
predictor
predictorpredictor
predictor
 
Cognitive Computing in IBM Spectrum LSF
Cognitive Computing in IBM Spectrum LSFCognitive Computing in IBM Spectrum LSF
Cognitive Computing in IBM Spectrum LSF
 
Ims01 ims trends and directions - IMS UG May 2014 Sydney & Melbourne
Ims01   ims trends and directions - IMS UG May 2014 Sydney & MelbourneIms01   ims trends and directions - IMS UG May 2014 Sydney & Melbourne
Ims01 ims trends and directions - IMS UG May 2014 Sydney & Melbourne
 
How to design good APIs
How to design good APIsHow to design good APIs
How to design good APIs
 
Architecture Driven IT Modernization &amp; Migration roadmap
Architecture Driven IT Modernization &amp; Migration roadmapArchitecture Driven IT Modernization &amp; Migration roadmap
Architecture Driven IT Modernization &amp; Migration roadmap
 
Cepoke Product eng
Cepoke Product engCepoke Product eng
Cepoke Product eng
 
Java and the GPU - Everything You Need To Know
Java and the GPU - Everything You Need To KnowJava and the GPU - Everything You Need To Know
Java and the GPU - Everything You Need To Know
 
Ultimate Solutions YS in Gulf
Ultimate Solutions YS in Gulf Ultimate Solutions YS in Gulf
Ultimate Solutions YS in Gulf
 
Agile labs 2011
Agile labs   2011Agile labs   2011
Agile labs 2011
 
Agents vs Agentless
Agents vs AgentlessAgents vs Agentless
Agents vs Agentless
 
Microsoft Analysis Services July 2010
Microsoft Analysis Services July 2010Microsoft Analysis Services July 2010
Microsoft Analysis Services July 2010
 
Jvg Media An Insight Into Intranet
Jvg Media   An Insight Into IntranetJvg Media   An Insight Into Intranet
Jvg Media An Insight Into Intranet
 
inSis Suite - Process Data Analytics, Dashboards, Portal & Historian
inSis Suite - Process Data Analytics, Dashboards, Portal & HistorianinSis Suite - Process Data Analytics, Dashboards, Portal & Historian
inSis Suite - Process Data Analytics, Dashboards, Portal & Historian
 
IBM zUniversity 2004 : ILOG JRules on IBM eServer zSeries
IBM zUniversity 2004 : ILOG JRules on IBM eServer zSeriesIBM zUniversity 2004 : ILOG JRules on IBM eServer zSeries
IBM zUniversity 2004 : ILOG JRules on IBM eServer zSeries
 
Apptio up cloud conference 2012 [final].pptx
Apptio up cloud conference 2012 [final].pptxApptio up cloud conference 2012 [final].pptx
Apptio up cloud conference 2012 [final].pptx
 
Delivering Operational Excellence with Innovation
Delivering Operational Excellence with InnovationDelivering Operational Excellence with Innovation
Delivering Operational Excellence with Innovation
 

Plus de scalaconfjp

Scalaに対して意識の低いエンジニアがScalaで何したかの話, by 芸者東京エンターテインメント
Scalaに対して意識の低いエンジニアがScalaで何したかの話, by 芸者東京エンターテインメントScalaに対して意識の低いエンジニアがScalaで何したかの話, by 芸者東京エンターテインメント
Scalaに対して意識の低いエンジニアがScalaで何したかの話, by 芸者東京エンターテインメント
scalaconfjp
 

Plus de scalaconfjp (20)

脆弱性対策のためのClean Architecture ~脆弱性に対するレジリエンスを確保せよ~
脆弱性対策のためのClean Architecture ~脆弱性に対するレジリエンスを確保せよ~脆弱性対策のためのClean Architecture ~脆弱性に対するレジリエンスを確保せよ~
脆弱性対策のためのClean Architecture ~脆弱性に対するレジリエンスを確保せよ~
 
Alp x BizReach SaaS事業を営む2社がお互い気になることをゆるゆる聞いてみる会
Alp x BizReach SaaS事業を営む2社がお互い気になることをゆるゆる聞いてみる会Alp x BizReach SaaS事業を営む2社がお互い気になることをゆるゆる聞いてみる会
Alp x BizReach SaaS事業を営む2社がお互い気になることをゆるゆる聞いてみる会
 
GraalVM Overview Compact version
GraalVM Overview Compact versionGraalVM Overview Compact version
GraalVM Overview Compact version
 
Run Scala Faster with GraalVM on any Platform / GraalVMで、どこでもScalaを高速実行しよう by...
Run Scala Faster with GraalVM on any Platform / GraalVMで、どこでもScalaを高速実行しよう by...Run Scala Faster with GraalVM on any Platform / GraalVMで、どこでもScalaを高速実行しよう by...
Run Scala Faster with GraalVM on any Platform / GraalVMで、どこでもScalaを高速実行しよう by...
 
Monitoring Reactive Architecture Like Never Before / 今までになかったリアクティブアーキテクチャの監視...
Monitoring Reactive Architecture Like Never Before / 今までになかったリアクティブアーキテクチャの監視...Monitoring Reactive Architecture Like Never Before / 今までになかったリアクティブアーキテクチャの監視...
Monitoring Reactive Architecture Like Never Before / 今までになかったリアクティブアーキテクチャの監視...
 
Scala 3, what does it means for me? / Scala 3って、私にはどんな影響があるの? by Joan Goyeau
Scala 3, what does it means for me? / Scala 3って、私にはどんな影響があるの? by Joan GoyeauScala 3, what does it means for me? / Scala 3って、私にはどんな影響があるの? by Joan Goyeau
Scala 3, what does it means for me? / Scala 3って、私にはどんな影響があるの? by Joan Goyeau
 
Functional Object-Oriented Imperative Scala / 関数型オブジェクト指向命令型 Scala by Sébasti...
Functional Object-Oriented Imperative Scala / 関数型オブジェクト指向命令型 Scala by Sébasti...Functional Object-Oriented Imperative Scala / 関数型オブジェクト指向命令型 Scala by Sébasti...
Functional Object-Oriented Imperative Scala / 関数型オブジェクト指向命令型 Scala by Sébasti...
 
Scala ♥ Graal by Flavio Brasil
Scala ♥ Graal by Flavio BrasilScala ♥ Graal by Flavio Brasil
Scala ♥ Graal by Flavio Brasil
 
Introduction to GraphQL in Scala
Introduction to GraphQL in ScalaIntroduction to GraphQL in Scala
Introduction to GraphQL in Scala
 
Safety Beyond Types
Safety Beyond TypesSafety Beyond Types
Safety Beyond Types
 
Reactive Kafka with Akka Streams
Reactive Kafka with Akka StreamsReactive Kafka with Akka Streams
Reactive Kafka with Akka Streams
 
Reactive microservices with play and akka
Reactive microservices with play and akkaReactive microservices with play and akka
Reactive microservices with play and akka
 
Scalaに対して意識の低いエンジニアがScalaで何したかの話, by 芸者東京エンターテインメント
Scalaに対して意識の低いエンジニアがScalaで何したかの話, by 芸者東京エンターテインメントScalaに対して意識の低いエンジニアがScalaで何したかの話, by 芸者東京エンターテインメント
Scalaに対して意識の低いエンジニアがScalaで何したかの話, by 芸者東京エンターテインメント
 
DWANGO by ドワンゴ
DWANGO by ドワンゴDWANGO by ドワンゴ
DWANGO by ドワンゴ
 
OCTOPARTS by M3, Inc.
OCTOPARTS by M3, Inc.OCTOPARTS by M3, Inc.
OCTOPARTS by M3, Inc.
 
Try using Aeromock by Marverick, Inc.
Try using Aeromock by Marverick, Inc.Try using Aeromock by Marverick, Inc.
Try using Aeromock by Marverick, Inc.
 
統計をとって高速化する
Scala開発 by CyberZ,Inc.
統計をとって高速化する
Scala開発 by CyberZ,Inc.統計をとって高速化する
Scala開発 by CyberZ,Inc.
統計をとって高速化する
Scala開発 by CyberZ,Inc.
 
Short Introduction of Implicit Conversion by TIS, Inc.
Short Introduction of Implicit Conversion by TIS, Inc.Short Introduction of Implicit Conversion by TIS, Inc.
Short Introduction of Implicit Conversion by TIS, Inc.
 
ビズリーチ x ScalaMatsuri by BIZREACH, Inc.
ビズリーチ x ScalaMatsuri  by BIZREACH, Inc.ビズリーチ x ScalaMatsuri  by BIZREACH, Inc.
ビズリーチ x ScalaMatsuri by BIZREACH, Inc.
 
sbt, past and future / sbt, 傾向と対策
sbt, past and future / sbt, 傾向と対策sbt, past and future / sbt, 傾向と対策
sbt, past and future / sbt, 傾向と対策
 

Scala in our BRMS

  • 1. Scala in our BRMS ~BRMS開発でのScala利用事例~ BRMS: Business Rule Management System 三菱UFJインフォメーションテクノロジー株式会社 ITプロデュース部 土佐鉄平 Mitsubishi UFJ Information Technology, Ltd. IT Production Dept. Teppei Tosa All Rights Reserved,Copyright © 2013 Mitsubishi UFJ Information Tecnology,Ltd. 1
  • 2. Agenda 1. About MUFG, MUIT 2. About BRMS 3. About our original BRMS, “BIWARD” 4. How we have used Scala’s features in BIWARD Using the Recursive Call function Using DSL 5. Our thoughts on Scala in developing Enterprise Applications All Rights Reserved,Copyright © 2013 Mitsubishi UFJ Information Tecnology,Ltd. 2
  • 3. About MUFG 出典:MUFG Corporate Review http://www.mufg.jp/english/ir/annualreport/2012mufg/pdf/mar/cr1202.pdf All Rights Reserved,Copyright © 2013 Mitsubishi UFJ Information Tecnology,Ltd. 3
  • 4. About MUIT (Mitsubishi UFJ Information Technology, Ltd.) Started on July 1st, 2009 when these three companies merged Tokyo Mitsubishi Information Technology, Ltd. UFJ Hitachi Systems, Ltd. UFJIS, Ltd. For Bank Systems Amount of Capital: 181 million yen Capital from Bank of For Securities’ system For Credit Cards Tokyo Mitsubishi UFJ: 85% Capital from MUFG: 15% Currently over 1500 employees For Lease Systems For MUFG’s Members For outside financial institutions All Rights Reserved,Copyright © 2013 Mitsubishi UFJ Information Tecnology,Ltd. 4
  • 5. About BRMS (Business Rule Management System) アプリケーションから、ビジネスルール(業務判断ロジック)を切出して実行・設計・ 管理を行うためのフレームワーク BRMS is a framework that separates business logic from software applications and executes, designs and manages that logic. WEB/AP Server Executes Executes Business Application Rule Engine DB Framework (ex. JavaEE) Server Client WEB/AP Server (ex. Cosminexus、Websphere、GlassFish) OS (ex. RedhatLinux、AIX) Designs Designs Rule Base Manages Manages All Rights Reserved,Copyright © 2013 Mitsubishi UFJ Information Tecnology,Ltd. 5
  • 6. All Rights Reserved,Copyright © 2013 Mitsubishi UFJ Information Tecnology,Ltd. 6
  • 7. The Reason for Creating an Original BRMS 金融関連のBRMS事例は保険のバックオフィス業務への適用が多いが、銀行では対面型業務での適用ニーズがあり、市場 製品では「前進判断」機能のみのため、これに応えることができない。 In the financial industry, there are some back-offices at insurance companies that use BRMSs. However, all banks have to use BRMS for their teller-window type operations. Other BRMS products cannot fulfill our needs because they have only “forward execution” functions. Back-office Type Input operations are fixed. Papers The system calculates how Rule Engine payments need to be made based on accident and contract information. All Rights Reserved,Copyright © 2013 Mitsubishi UFJ Information Tecnology,Ltd. 7
  • 8. The Reason for Creating an Original BRMS 金融関連のBRMS事例は保険のバックオフィス業務への適用が多いが、銀行では対面型業務での適用ニーズがあり、市場 製品では「前進判断」機能のみのため、これに応えることができない。 In the financial industry, there are some back-offices at insurance companies that use BRMSs. However, all banks have to use BRMS for their teller-window type operations. Other BRMS products cannot fulfill our needs because they have only “forward execution” functions. Back-office Type Teller-window Type Input operations are fixed. At teller-windows, we interact directly with customers, so we require a BRMS with not only “forward execution” but also “backward execution”. Papers Sorry, we can’t authenticate you with this kind of ID. 【forward execution】 】 So, what should I do? If you have a driver’s license or a health insurance ID card… The system calculates how Rule Engine payments need to be made 【backward execution】 】 based on accident and I have a health contract information. insurance ID card. All Rights Reserved,Copyright © 2013 Mitsubishi UFJ Information Tecnology,Ltd. 8
  • 9. Algorithm for BIWARD Logic operating in a TREE form All Rights Reserved,Copyright © 2013 Mitsubishi UFJ Information Tecnology,Ltd. 9
  • 10. Algorithm for BIWARD Logic operating in a TREE form Forward Execution All Rights Reserved,Copyright © 2013 Mitsubishi UFJ Information Tecnology,Ltd. 10
  • 11. Algorithm for BIWARD Logic operating in a TREE form Logic operating as a NETWORK Forward Execution All Rights Reserved,Copyright © 2013 Mitsubishi UFJ Information Tecnology,Ltd. 11
  • 12. Algorithm for BIWARD Logic operating in a TREE form Logic operating as a NETWORK Forward Execution Forward Exec. All Rights Reserved,Copyright © 2013 Mitsubishi UFJ Information Tecnology,Ltd. 12
  • 13. Algorithm for BIWARD Logic operating in a TREE form Logic operating as a NETWORK Forward Execution Forward Exec. Backward Exec. All Rights Reserved,Copyright © 2013 Mitsubishi UFJ Information Tecnology,Ltd. 13
  • 14. Algorithm for BIWARD Logic operating in a TREE form Logic operating as a NETWORK Forward Execution Forward Exec. Backward Exec. Biward Exec. All Rights Reserved,Copyright © 2013 Mitsubishi UFJ Information Tecnology,Ltd. 14
  • 15. Example: Logic for Authentication Conditions Result Bring a Have a Bring a Can authenticate driver’s license home loan resident card YES YES YES YES NO NO NO YES NO NO All Rights Reserved,Copyright © 2013 Mitsubishi UFJ Information Tecnology,Ltd. 15
  • 16. Internal Structure of Logic Root :Node Conditions Result Bring a Have a Bring a Can authenticate driver’s license home loan resident card Y Y Y Y N N N N All Rights Reserved,Copyright © 2013 Mitsubishi UFJ Information Tecnology,Ltd. 16
  • 17. BIWARD walks on nodes recursively. BIWARDはRootNodeからスタートして、RootNodeまでを辿る 辿ったNodeを記録しながら、「walk」関数を再帰的に処理していき、 最終的に記録したNodeを結果として応答 Scalaによって、こういった処理を非常にシンプルに構築 BIWARD can “walk” on the network in both directions from the Root Node and back to the Root Node. The nodes use the “walk” function to call one another recursively. BIWARD records the nodes that have been “walked” through, then returns the results by displaying the recorded nodes. Thanks to Scala, we were able to create this program very elegantly. All Rights Reserved,Copyright © 2013 Mitsubishi UFJ Information Tecnology,Ltd. 17
  • 18. Steps of Creating Rules Compiles Compiles XML register register Scala and and packages packages JAR Exported from WEB-UI or input by the user All Rights Reserved,Copyright © 2013 Mitsubishi UFJ Information Tecnology,Ltd. 18
  • 19. Using Scala’s Parser BIWARD parses these conditional expressions with Scala’s DSL function. <rule id=“rule1” … > <parameters> 運転免許証持参有無” 運転免許証持参有無 <booleanParameter id=“hasDriversLicence” label=“運転免許証持参有無 … /> … </parameters> <results> Not only boolean, but <booleanResult id=“canAuthenticate” label=“本人確認可否本人確認可否”/> 本人確認可否 also strings, numbers </results> and date types in <patterns> conditional expressions. <pattern> <conditions> <condition … ><![CDATA[ param(“hasDriversLicense”)==true ]]></condition> </conditions> <results> <booleanResult id=“canAuthenticate”>true</booleanResult> </results> </pattern> … Exported Scala Code Condition(Equal( </patterns> BooleanParameter(“”“9”“”, “”“bringDriversLicense”“”, </rule> List(BooleanValue(true, """Yes"""), BooleanValue(false, """No"""))), BooleanValue(true, """Yes""") )), All Rights Reserved,Copyright © 2013 Mitsubishi UFJ Information Tecnology,Ltd. 19
  • 20. Thoughts on Scala 高生産性を確かに実感 Javaとの親和性メリットは大きい ScalaプログラムがJavaリソースを利用するという観点はもちろん、 Javaに対してScalaリソースを提供するという観点でもメリット大きい。 言語仕様が強力で、標準言語とするにはまだまだハードル高い Javaの置き換えではなく、ポイントを抑えた部分的な活用が有効 Achieve a higher level of productivity Compatibility with Java is a strong merit Scala can use Java as a library, and Java can use Scala the same way. As a result of its elaborate syntax, it will still be difficult to adopt Scala as the standard. All Rights Reserved,Copyright © 2013 Mitsubishi UFJ Information Tecnology,Ltd. 20
  • 21. Our Goal for Scala DSLやJavaAPIを通した機能提供を前提に、より汎 用的な機能の開発にScalaを活用 To develop universal features with Scala and supply them using DSL or Java API DSL Business Application Common Parts (Scala) (Java) Java API Common Parts (Java) Specific features for business Universal features All Rights Reserved,Copyright © 2013 Mitsubishi UFJ Information Tecnology,Ltd. 21
  • 22. 御静聴ありがとうございました Thank you for listening All Rights Reserved,Copyright © 2013 Mitsubishi UFJ Information Tecnology,Ltd. 22