= 类图
== 引擎配置实体类图
=== 数据字典
[plantuml, diagram-classes-dictionary, svg]  
....
skinparam handwritten false

class "DictionaryEntity\n(数据字典)" as DictionaryEntity { 
	id 唯一标识
	code 代码
	name 名称
	...
	parent 父
	children 子集合
}

class "FolderDictionaryEntity\n(文件夹)" as FolderDictionaryEntity
class "JavaClassDictionaryEntity\n(Java类数据字典)" as JavaClassDictionaryEntity
class "UserDefinedJavaClassDictionaryEntity\n(用户自定义Java类数据字典)" as UserDefinedJavaClassDictionaryEntity
class "EnumDictionaryEntity\n(枚举数据字典)" as EnumDictionaryEntity

class "UserDefinedJavaClassFieldEntity\n(用于自定义Java类字段)" as UserDefinedJavaClassFieldEntity

class "EnumItemEntity\n(枚举项)" as EnumItemEntity

FolderDictionaryEntity 				-up-|> DictionaryEntity
JavaClassDictionaryEntity 			-up-|> DictionaryEntity
UserDefinedJavaClassDictionaryEntity 	-up-|> DictionaryEntity
EnumDictionaryEntity 				-up-|> DictionaryEntity

UserDefinedJavaClassDictionaryEntity "1"	*-down-> "N" UserDefinedJavaClassFieldEntity
EnumDictionaryEntity 				"1"	*-down-> "N" EnumItemEntity

....

=== 库
[plantuml, diagram-classes-lib, svg]  
....
skinparam handwritten false

class "DictionaryEntity\n(数据字典)" as DictionaryEntity { 
	id 唯一标识
	code 代码
	name 名称
	...
	parent 父
	children 子集合
}

class "LibEntity\n(库)" as LibEntity { 
	id 唯一标识
	...
	parent 父
	children 子集合
	testCases 测试用例集合
}

class "FolderLibEntity\n(文件夹)" as FolderLibEntity

class "IndicatorLibEntity(指标库)" as IndicatorLibEntity{
	indicators 指标集合
}

class "IndicatorEntity\n(指标)" as IndicatorEntity{
	valueType 值类型
	valueTypeVersion 值类型版本
	lib 所属指标库
	validators 验证器集合
	processors 处理器集合
}

class "InterfaceIndicatorEntity\n(接口指标)" as InterfaceIndicatorEntity
class "IndicatorIndicatorEntity\n(计算指标)" as IndicatorIndicatorEntity
class "IndicatorValidatorEntity\n(指标验证器)" as IndicatorValidatorEntity #green
class "IndicatorProcessorEntity\n(指标处理器)" as IndicatorProcessorEntity #green


IndicatorEntity				"N"		-right->	"1" DictionaryEntity : 引用 >
IndicatorLibEntity			"1"		-right->	"N" IndicatorEntity : 包含 >
InterfaceIndicatorEntity	"1"		*-down->	"N" IndicatorValidatorEntity : 包含 >
IndicatorIndicatorEntity	"1"		*-down->	"N" IndicatorProcessorEntity : 包含 >


LibEntity					"1" 	-right->	"N"	LibTestCaseEntity : 包含 >
LibEntity 							<|-down- 	FolderLibEntity
LibEntity							<|-down- 	IndicatorLibEntity	


IndicatorEntity 					<|-down- 	InterfaceIndicatorEntity
IndicatorEntity 					<|-down- 	IndicatorIndicatorEntity

FolderLibEntity -right[hidden]- IndicatorLibEntity
....

=== 指标验证器
[plantuml, diagram-classes-indicator-validator, svg]  
....
skinparam handwritten false

class "IndicatorValidatorEntity\n(指标验证器)" as IndicatorValidatorEntity #green

class "DateRangeIndicatorValidatorEntity\n(日期范围指标验证器)" as DateRangeIndicatorValidatorEntity
class "DecimalRangeIndicatorValidatorEntity\n(小数范围指标验证器)" as DecimalRangeIndicatorValidatorEntity
class "EmailIndicatorValidatorEntity\n(邮件地址指标验证器)" as EmailIndicatorValidatorEntity
class "EmptyIndicatorValidatorEntity\n(空指标验证器)" as EmptyIndicatorValidatorEntity
class "FalseIndicatorValidatorEntity\n(假指标验证器)" as FalseIndicatorValidatorEntity
class "IntegerRangeIndicatorValidatorEntity\n(整数范围指标验证器)" as IntegerRangeIndicatorValidatorEntity
class "LengthRangeIndicatorValidatorEntity\n(长度范围指标验证器)" as LengthRangeIndicatorValidatorEntity
class "NotEmptyIndicatorValidatorEntity\n(非空指标验证器)" as NotEmptyIndicatorValidatorEntity
class "PatternIndicatorValidatorEntity\n(正则表达式指标验证器)" as PatternIndicatorValidatorEntity
class "TrueIndicatorValidatorEntity\n(真指标验证器)" as TrueIndicatorValidatorEntity

IndicatorValidatorEntity		<|-up-		DateRangeIndicatorValidatorEntity		
IndicatorValidatorEntity       	<|-up-		DecimalRangeIndicatorValidatorEntity
IndicatorValidatorEntity		<|-up-		EmailIndicatorValidatorEntity			
IndicatorValidatorEntity		<|-up-		EmptyIndicatorValidatorEntity			
IndicatorValidatorEntity		<|-up-		FalseIndicatorValidatorEntity			
IndicatorValidatorEntity		<|-down-	IntegerRangeIndicatorValidatorEntity
IndicatorValidatorEntity		<|-down-	LengthRangeIndicatorValidatorEntity
IndicatorValidatorEntity		<|-down-	NotEmptyIndicatorValidatorEntity		
IndicatorValidatorEntity		<|-down-	PatternIndicatorValidatorEntity	
IndicatorValidatorEntity		<|-down-	TrueIndicatorValidatorEntity			

....

=== 指标处理器
[plantuml, diagram-classes-indicator-processor, svg]  
....
skinparam handwritten false

class "IndicatorProcessorEntity\n(指标处理器)" as IndicatorProcessorEntity #green

class "EmptyIndicatorProcessorEntity\n(空处理器)" as EmptyIndicatorProcessorEntity
class "TernaryIndicatorProcessorEntity\n(三元运算处理器)" as TernaryIndicatorProcessorEntity
class "ArithmeticIndicatorProcessorEntity\n(算数运算处理器)" as ArithmeticIndicatorProcessorEntity
class "WhenThenIndicatorProcessorEntity\n(When-Then处理器)" as WhenThenIndicatorProcessorEntity
class "NumberRangeIndicatorProcessorEntity\n(数值分段处理器)" as NumberRangeIndicatorProcessorEntity
class "ConditionRangeIndicatorProcessorEntity\n(条件分段处理器)" as ConditionRangeIndicatorProcessorEntity
class "GroovyScriptIndicatorProcessorEntity\n(Groovy 脚本处理器)" as GroovyScriptIndicatorProcessorEntity

IndicatorProcessorEntity		<|-up-				EmptyIndicatorProcessorEntity
IndicatorProcessorEntity		<|-up-				TernaryIndicatorProcessorEntity
IndicatorProcessorEntity		<|-up-				ArithmeticIndicatorProcessorEntity
IndicatorProcessorEntity		<|-down-			WhenThenIndicatorProcessorEntity
IndicatorProcessorEntity		<|-down-			NumberRangeIndicatorProcessorEntity
IndicatorProcessorEntity		<|-down-			ConditionRangeIndicatorProcessorEntity
IndicatorProcessorEntity		<|-down-			GroovyScriptIndicatorProcessorEntity
....

=== 资源模型
[plantuml, diagram-classes-resource, svg]  
....
skinparam handwritten false

class "ResourceEntity\n(资源)" as ResourceEntity
class "ReleasableResourceEntity\n(可发布的资源)" as ReleasableResourceEntity
class "FolderResourceEntity\n(文件夹)" as FolderResourceEntity
class "ModelResourceEntity\n(模型)" as ModelResourceEntity
class "ScoreCardResourceEntity\n(评分卡)" as ScoreCardResourceEntity
class "ResourceTestCaseEntity\n(资源测试用例)" as ResourceTestCaseEntity

class "ModelEntity\n(模型)" as ModelEntity{
	id 唯一标识
	code 代码
	name 名称
	...
	parent 父
	children 子集合
}

class "ParameterEntity\n(参数)" as ParameterEntity #green

class "ParameterValidatorEntity\n(参数验证器)" as ParameterValidatorEntity #green
class "ParameterProcessorEntity\n(参数处理器)" as ParameterProcessorEntity #green


ResourceEntity 				<|-down- 	FolderResourceEntity
ResourceEntity				<|-down- 	ReleasableResourceEntity
 
ReleasableResourceEntity 	<|-down- 	ModelResourceEntity
ReleasableResourceEntity 	<|-down- 	ScoreCardResourceEntity

ResourceEntity			"1"	-right-> "N" ResourceTestCaseEntity : 包含 >

ModelResourceEntity		"1" -down-> 	"1" ModelEntity : 包含

ModelEntity				"1" -down-> "N" ParameterEntity : 包含
ParameterEntity			"1" *-left-> "N" ParameterValidatorEntity : 包含
ParameterEntity			"1" *-right-> "N" ParameterProcessorEntity : 包含

FolderResourceEntity -right[hidden]- ReleasableResourceEntity
....

=== 模型参数
[plantuml, diagram-classes-parameter, svg]  
....
skinparam handwritten false

class "ParameterEntity\n(参数)" as ParameterEntity #green

class "ConstantParameterEntity\n(常量)" as ConstantParameterEntity
class "IndicatorParameterEntity\n(指标)" as IndicatorParameterEntity
class "InParameterEntity\n(输入值)" as InParameterEntity
class "InOptionParameterEntity\n(输入选项)" as InOptionParameterEntity
class "InSubOutParameterEntity\n(子模型输出)" as InSubOutParameterEntity
class "IntermediateParameterEntity\n(中间值)" as IntermediateParameterEntity
class "RuleResultParameterEntity\n(规则结果)" as RuleResultParameterEntity
class "SingleRuleResultParameterEntity\n(单规则结果)" as SingleRuleResultParameterEntity
class "OutParameterEntity\n(结果值)" as OutParameterEntity

ParameterEntity <|-up- ConstantParameterEntity	
ParameterEntity <|-up- IndicatorParameterEntity		
ParameterEntity <|-up- InParameterEntity				
ParameterEntity <|-up- InOptionParameterEntity	
ParameterEntity <|-left- InSubOutParameterEntity	
ParameterEntity <|-right- IntermediateParameterEntity
ParameterEntity <|-down- RuleResultParameterEntity		
ParameterEntity <|-down- SingleRuleResultParameterEntit
ParameterEntity <|-down- OutParameterEntity		
....

=== 参数验证器
[plantuml, diagram-classes-parameter-validator, svg]  
....
skinparam handwritten false

class "ParameterValidatorEntity\n(参数验证器)" as ParameterValidatorEntity #green

class "DateRangeParameterValidatorEntity\n(日期范围指标验证器)" as DateRangeParameterValidatorEntity
class "DecimalRangeParameterValidatorEntity\n(小数范围指标验证器)" as DecimalRangeParameterValidatorEntity
class "EmailParameterValidatorEntity\n(邮件地址指标验证器)" as EmailParameterValidatorEntity
class "EmptyParameterValidatorEntity\n(空指标验证器)" as EmptyParameterValidatorEntity
class "FalseParameterValidatorEntity\n(假指标验证器)" as FalseParameterValidatorEntity
class "IntegerRangeParameterValidatorEntity\n(整数范围指标验证器)" as IntegerRangeParameterValidatorEntity
class "LengthRangeParameterValidatorEntity\n(长度范围指标验证器)" as LengthRangeParameterValidatorEntity
class "NotEmptyParameterValidatorEntity\n(非空指标验证器)" as NotEmptyParameterValidatorEntity
class "PatternParameterValidatorEntity\n(正则表达式指标验证器)" as PatternParameterValidatorEntity
class "TrueParameterValidatorEntity\n(真指标验证器)" as TrueParameterValidatorEntity

ParameterValidatorEntity <|-up- 	DateRangeParameterValidatorEntity		
ParameterValidatorEntity <|-up- 	DecimalRangeParameterValidatorEntity	
ParameterValidatorEntity <|-up- 	EmailParameterValidatorEntity			
ParameterValidatorEntity <|-up- 	EmptyParameterValidatorEntity			
ParameterValidatorEntity <|-left- 	FalseParameterValidatorEntity			
ParameterValidatorEntity <|-right- 	IntegerRangeParameterValidatorEntity	
ParameterValidatorEntity <|-down- 	LengthRangeParameterValidatorEntity
ParameterValidatorEntity <|-down- 	NotEmptyParameterValidatorEntity		
ParameterValidatorEntity <|-down- 	PatternParameterValidatorEntity	
ParameterValidatorEntity <|-down- 	TrueParameterValidatorEntity			
....

=== 参数处理器
[plantuml, diagram-classes-parameter-processor, svg]  
....
skinparam handwritten false

class "ParameterProcessorEntity\n(参数处理器)" as ParameterProcessorEntity #green

class "OptionValueParameterProcessorEntity\n(选项值处理器)" as OptionValueParameterProcessorEntity
class "ArithmeticParameterProcessorEntity\n(算数操作处理器)" as ArithmeticParameterProcessorEntity
class "ConditionRangeParameterProcessorEntity\n(条件范围处理器)" as ConditionRangeParameterProcessorEntity
class "DecisionTable2CParameterProcessorEntity\n(简单决策表处理器)" as DecisionTable2CParameterProcessorEntity
class "DecisionTableParameterProcessorEntity\n(决策表处理器)" as DecisionTableParameterProcessorEntity
class "DecisionTreeParameterProcessorEntity\n(决策树处理器)" as DecisionTreeParameterProcessorEntity
class "EmptyParameterProcessorEntity\n(空处理器)" as EmptyParameterProcessorEntity
class "ExecutionFlowParameterProcessorEntity\n(执行流处理器)" as ExecutionFlowParameterProcessorEntity
class "NumberRangeParameterProcessorEntity\n(数值范围处理器)" as NumberRangeParameterProcessorEntity
class "PmmlParameterProcessorEntity\n(PMML处理器)" as PmmlParameterProcessorEntity
class "GroovyScriptParameterProcessorEntity\n(脚本代码处理器)" as GroovyScriptParameterProcessorEntity
class "TernaryParameterProcessorEntity\n(三元操作处理器)" as TernaryParameterProcessorEntity
class "WhenThenParameterProcessorEntity\n(When-Then 操作处理器)" as WhenThenParameterProcessorEntity
class "RuleParameterProcessorEntity\n(规则处理器)" as RuleParameterProcessorEntity
class "SingleRuleParameterProcessorEntity.\n(单规则处理器)" as SingleRuleParameterProcessorEntity

ParameterProcessorEntity <|-up- 	OptionValueParameterProcessorEntity		
ParameterProcessorEntity <|-up- 	ArithmeticParameterProcessorEntity		
ParameterProcessorEntity <|-up- 	ConditionRangeParameterProcessorEntity	
ParameterProcessorEntity <|-up-	 	DecisionTable2CParameterProcessorEntity	
ParameterProcessorEntity <|-up- 	DecisionTableParameterProcessorEntity		
ParameterProcessorEntity <|-up- 	DecisionTreeParameterProcessorEntity		
ParameterProcessorEntity <|-left- 	EmptyParameterProcessorEntity				
ParameterProcessorEntity <|-right- 	ExecutionFlowParameterProcessorEntity		
ParameterProcessorEntity <|-down- 	NumberRangeParameterProcessorEntity		
ParameterProcessorEntity <|-down- 	PmmlParameterProcessorEntity				
ParameterProcessorEntity <|-down- 	GroovyScriptParameterProcessorEntity		
ParameterProcessorEntity <|-down- 	TernaryParameterProcessorEntity			
ParameterProcessorEntity <|-down- 	WhenThenParameterProcessorEntity			
ParameterProcessorEntity <|-down- 	RuleParameterProcessorEntity				
ParameterProcessorEntity <|-down- 	SingleRuleParameterProcessorEntity
....

=== 评分卡
[plantuml, diagram-classes-scorecard, svg]  
....
skinparam handwritten false

class "ScoreCardResourceEntity\n(评分卡)" as ScoreCardResourceEntity
class "ScoreCardVarEntity\n(评分卡变量)" as ScoreCardVarEntity
class "NumberRangeScoreCardVarEntity\n(数值范围评分卡变量)" as NumberRangeScoreCardVarEntity
class "OptionScoreCardVarEntity\n(选项评分卡变量)" as OptionScoreCardVarEntity

class "ScoreCardIndicatorVarEntity\n(评分卡变量(指标))" as ScoreCardIndicatorVarEntity

class "NumberRangeScoreCardIndicatorVarEntity\n(数值范围评分卡变量(指标))" as NumberRangeScoreCardIndicatorVarEntity
class "OptionScoreCardIndicatorVarEntity\n(选项评分卡变量(指标))" as OptionScoreCardIndicatorVarEntity
class "ScoreCardIndicatorValueVarEntity\n(评分卡值变量(指标))" as ScoreCardIndicatorValueVarEntity

ScoreCardResourceEntity "1" *-down-> "N" ScoreCardVarEntity
ScoreCardVarEntity <|-down- ScoreCardIndicatorVarEntity
ScoreCardVarEntity <|-down- NumberRangeScoreCardVarEntity
ScoreCardVarEntity <|-down- OptionScoreCardVarEntity

ScoreCardIndicatorVarEntity <|-down- NumberRangeScoreCardIndicatorVarEntity
ScoreCardIndicatorVarEntity <|-down- OptionScoreCardIndicatorVarEntity
ScoreCardIndicatorVarEntity <|-down- ScoreCardIndicatorValueVarEntity
....

=== 测试用例
[plantuml, diagram-classes-testcase, svg]  
....
class "TestCaseEntity\n(测试用例)" as TestCaseEntity
class "ResourceTestCaseEntity\n(资源测试用例)" as ResourceTestCaseEntity
class "ModelTestCaseEntity\n(模型资源测试用例)" as ModelTestCaseEntity
class "ScoreCardTestCaseEntity\n(评分卡资源测试用例)" as ScoreCardTestCaseEntity
class "LibTestCaseEntity\n(库测试用例)" as LibTestCaseEntity

class "TestCaseParameterEntity\n(测试用例参数)" as TestCaseParameterEntity

TestCaseEntity "1" -right-> "N" TestCaseParameterEntity : 包含 >
TestCaseEntity <|-down- ResourceTestCaseEntity
TestCaseEntity <|-down- LibTestCaseEntity

ResourceTestCaseEntity <|-down- ModelTestCaseEntity
ResourceTestCaseEntity <|-down- ScoreCardTestCaseEntity
....

== 客户端接口与实现
[plantuml, diagram-classes-client, svg]  
....
package "org.wsp.engine.rule.client" {
	interface "Executor\n(执行器)" as Executor {
		compileById()
		compileByCode()
		executeById()
		executeByCode()
		getLoader()
	}
	
	interface "Loader\n(加载器)" as Loader {
		getResourceById()
		getResourceByCode()
		getAllReleasableResourceAbstract()
		cleanCache()
	}
	
	Executor "1" -right-> "1" Loader : 包含 >
}

package "org.wsp.engine.rule.client.local" {
	class "LocalExecutor\n(本地执行器)" as LocalExecutor
	
	class LocalExecutor implements Executor
}

package "org.wsp.engine.rule.client.remote" {
	class "RemoteExecutor\n(本地执行器)" as RemoteExecutor
	class "RemoteLoader\n(远程加载器)" as RemoteLoader
	
	class RemoteExecutor implements Executor
	class RemoteLoader implements Loader
}

package "org.wsp.engine.rule.client.spring.service" {	
	interface "LocalLoader\n(Spring 本地加载器)" as LocalLoader
	interface LocalLoader extends Loader
	
	interface "ExecutorFactoryService\n(Spring 执行器工厂服务)" as ExecutorFactoryService {
		getExecutor()
	}
}

package "org.wsp.engine.rule.client.spring.service.impl" {
	class "LocalLoaderImpl(Spring 本地加载器实现)" as LocalLoaderImpl
	class "ExecutorFactoryServiceImpl(Spring 执行器工厂服务实现)" as ExecutorFactoryServiceImpl
	
	class LocalLoaderImpl implements LocalLoader
	class ExecutorFactoryServiceImpl implements ExecutorFactoryService
}
....




