{ "contentType": "application/vnd.gorules.decision", "nodes": [ { "id": "6716ac00-2b7a-4599-b4a7-2a19a2a63b17", "name": "decisionTable1", "type": "decisionTableNode", "content": { "rules": [ { "_id": "172b5ab5-25c4-4785-9cf9-d106730ee55d", "_description": "", "268ca3e3-4f15-4c6a-a8f2-bbb5338c1f43": "startOf(date(insured_person_layer.commencement_date), \"day\") >= date(report_layer.report_time)", "3320dce8-b9ca-415b-8b3c-adcfebb06f79": "\"证件有效起期大于等于报案时间\"", "3404e5f2-f063-40d1-b27a-d3ecfb41c652": "\"中银保险有限公司苏州分公司\"", "c9e2be65-c7a5-463b-8d62-0a5f503c844e": "\"R001\"" }, { "_id": "bf01e2f6-572f-47f5-8773-d5b81a02e7c8", "_description": "", "268ca3e3-4f15-4c6a-a8f2-bbb5338c1f43": "endOf(date(insured_person_layer.termination_date), \"day\") <= date(report_layer.report_time)", "3320dce8-b9ca-415b-8b3c-adcfebb06f79": "\"证件有效止期小于等于报案时间\"", "3404e5f2-f063-40d1-b27a-d3ecfb41c652": "\"中银保险有限公司苏州分公司\"", "c9e2be65-c7a5-463b-8d62-0a5f503c844e": "\"R002\"" }, { "_id": "9fa2cd42-2297-4719-bf35-559026e0dc20", "_description": "", "268ca3e3-4f15-4c6a-a8f2-bbb5338c1f43": "insured_person_layer.account != insured_person_layer.insured_person", "3320dce8-b9ca-415b-8b3c-adcfebb06f79": "\"领款人和被保险人不一致\"", "3404e5f2-f063-40d1-b27a-d3ecfb41c652": "\"中银保险有限公司苏州分公司\"", "c9e2be65-c7a5-463b-8d62-0a5f503c844e": "\"R003\"" } ], "inputs": [ { "id": "3404e5f2-f063-40d1-b27a-d3ecfb41c652", "name": "保险分公司", "field": "report_layer.insurer_company" } ], "outputs": [ { "id": "c9e2be65-c7a5-463b-8d62-0a5f503c844e", "name": "规则编码", "field": "code" }, { "id": "268ca3e3-4f15-4c6a-a8f2-bbb5338c1f43", "name": "命是规则", "field": "hit" }, { "id": "3320dce8-b9ca-415b-8b3c-adcfebb06f79", "name": "规则说明", "field": "explanation" } ], "hitPolicy": "collect", "inputField": null, "outputPath": "hits", "passThrough": false, "executionMode": "single" }, "position": { "x": 430, "y": 292.5 } }, { "id": "5c628b40-4007-449e-84db-e8bdf3d6899d", "name": "request", "type": "inputNode", "content": { "schema": "" }, "position": { "x": 110, "y": 292.5 } }, { "id": "2ee64660-9abd-4b56-b6ed-97d892041cfd", "name": "response", "type": "outputNode", "content": { "schema": "" }, "position": { "x": 1390, "y": 292.5 } }, { "id": "d0835a6d-72a3-4c21-a3de-b38d962d8518", "name": "decisionTable2", "type": "decisionTableNode", "content": { "rules": [ { "_id": "09f82f88-75be-42b2-bd40-23457ec5aed9", "_description": "保险分公司未配置拒付规则", "722fc57b-5166-4457-b9f0-c3437c6159b4": "len(hits) == 0", "b2b97b2a-5e59-4c23-a116-7e49e59e65c3": "", "bd0ca899-7c74-40e4-9b61-1c058ef5e83f": "" }, { "_id": "843e7960-c5d8-4867-a283-b2641d31f3d7", "_description": "", "722fc57b-5166-4457-b9f0-c3437c6159b4": "none(hits, #.hit)", "b2b97b2a-5e59-4c23-a116-7e49e59e65c3": "\"赔付\"", "bd0ca899-7c74-40e4-9b61-1c058ef5e83f": "\"\"" }, { "_id": "e5dbd162-d188-4170-9b6b-9fc7077c47bf", "_description": "", "722fc57b-5166-4457-b9f0-c3437c6159b4": "", "b2b97b2a-5e59-4c23-a116-7e49e59e65c3": "\"拒付\"", "bd0ca899-7c74-40e4-9b61-1c058ef5e83f": "explanations" } ], "inputs": [ { "id": "722fc57b-5166-4457-b9f0-c3437c6159b4", "name": "命中", "field": "hits" } ], "outputs": [ { "id": "b2b97b2a-5e59-4c23-a116-7e49e59e65c3", "name": "拒付", "field": "conclusion" }, { "id": "bd0ca899-7c74-40e4-9b61-1c058ef5e83f", "name": "拒付说明", "field": "explanation" } ], "hitPolicy": "first", "inputField": null, "outputPath": null, "passThrough": false, "executionMode": "single" }, "position": { "x": 1070, "y": 292.5 } }, { "id": "476b8b59-221c-4ff6-b3e2-dfeec58eee10", "name": "function", "type": "functionNode", "content": { "source": "import zen from 'zen';\r\n\r\n/** @type {Handler} **/\r\nexport const handler = async (input) => {\r\n const explanations = input.hits.reduce((arr, obj) => {\r\n const hit = obj[\"hit\"];\r\n const explanation = obj[\"explanation\"];\r\n if (hit && explanation) {\r\n arr.push(explanation);\r\n }\r\n return arr; \r\n }, [])\r\n .join('; ');\r\n return {\r\n hits: input.hits,\r\n explanations: explanations,\r\n };\r\n};\r\n", "omitNodes": false }, "position": { "x": 750, "y": 292.5 } } ], "edges": [ { "id": "02f2d409-3077-46fd-95f4-6b4b441fa99f", "type": "edge", "sourceId": "5c628b40-4007-449e-84db-e8bdf3d6899d", "targetId": "6716ac00-2b7a-4599-b4a7-2a19a2a63b17" }, { "id": "3c17140a-e97a-40d7-a0d2-f0696051bde8", "type": "edge", "sourceId": "d0835a6d-72a3-4c21-a3de-b38d962d8518", "targetId": "2ee64660-9abd-4b56-b6ed-97d892041cfd" }, { "id": "778027ba-7228-4d94-a778-a26f7c3ea9bb", "type": "edge", "sourceId": "6716ac00-2b7a-4599-b4a7-2a19a2a63b17", "targetId": "476b8b59-221c-4ff6-b3e2-dfeec58eee10" }, { "id": "a8422289-e0cb-4529-8c8a-1edceeac98ae", "type": "edge", "sourceId": "476b8b59-221c-4ff6-b3e2-dfeec58eee10", "targetId": "d0835a6d-72a3-4c21-a3de-b38d962d8518" } ] }