---
title: "drl文件中使用map"
author: "bluebreath"
date: "2011-08-09T11:58:37Z"
tags: []
categories: ["开源软件"]
slug: "drl-map"
draft: false
lastmod: "2011-08-09T11:58:37Z"
id: 1143330
url: "https://breath.iteye.com/blog/1143330"
---

JAVA代码：

```java

   Map map1 = new HashMap();
			Map map11 = new HashMap();
			map11.put("name", "jack");
			map11.put("address", "xian");
			
			map1.put("id", "001");
			map1.put("money", "5000");
			map1.put("item", map11);

			ksession.insert(map1);
```


规则文件片段：

```java
rule "rule1"
	when
		$m:Map(this["id"]=="001",$item:this["item"]!=null)
	then
		//获得第二层Map的值
		System.out.println(((Map)$m.get("item")).get("name"));	
end
```