Drools Expert - stateless vs stateful
Jump to navigation
Jump to search
Drools Expert - mvel - RHS - basic Training Materials
Copyright Notice
Copyright © 2004-2023 by NobleProg Limited All rights reserved.
This publication is protected by copyright, and permission must be obtained from the publisher prior to any prohibited reproduction, storage in a retrieval system, or transmission in any form or by any means, electronic, mechanical, photocopying, recording, or likewise.
Stateless vs stateful ⌘。
- Validate age of an applicant
- 下围棋
Go ⌘。
- Stateless
- Make a move (facts.add(new WhiteStone(3,5))) 走一步
- run .execute(facts) method 执行execute方法
- make sure that facts array and working memory are in sync 确定facts array的事实和工作内存里面的事实同步
- make a move (facts.add(new BlackStone(3,4)))
- run .execute(facts) method
- make sure that facts array and working memory are in sync
- Stateful
- Make a move (ks.insert(new WhiteStone(3,5)))
- run .fireAllRules() method
- make a move (ks.insert(new BlackStone(3,4)))
- run .fireAllRules() method
- when game ends run ks.dispose()