1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
<?xml version="1.0" encoding="UTF-8"?>
<bm:model xmlns:o="leaf.database.local.oracle" xmlns:bm="http://www.leaf-framework.org/schema/bm" xmlns:f="leaf.database.features" baseTable="ZJ_WFL_GRAPHICS_DETAIL">
<bm:fields>
<bm:field name="detail_id" databaseType="NUMBER" datatype="java.lang.Long"/>
<bm:field name="graphic_id" databaseType="NUMBER" datatype="java.lang.Long" insertExpression="${../../@graphic_id}"/>
<bm:field name="config" databaseType="VARCHAR" datatype="java.lang.String"/>
<bm:field name="type" databaseType="VARCHAR" datatype="java.lang.String"/>
<bm:field name="table_name" databaseType="VARCHAR" datatype="java.lang.String"/>
<bm:field name="table_id" databaseType="NUMBER" datatype="java.lang.Long"/>
<bm:field name="node_desc" forInsert="false" forUpdate="false"/>
<bm:field name="node_type" forInsert="false" forUpdate="false"/>
</bm:fields>
<bm:operations>
<bm:operation name="query">
<bm:query-sql><![CDATA[
SELECT t1.detail_id,
t1.graphic_id,
t1.config,
t1.type,
t1.table_name,
(select n.node_desc
from zj_wfl_workflow_node n
where n.node_id = t1.table_id) as node_desc,
(select n.node_type
from zj_wfl_workflow_node n
where n.node_id = t1.table_id) as node_type,
t1.table_id
FROM zj_wfl_graphics_detail t1
where exists (select 1
from zj_wfl_graphics g
where g.workflow_id = ${@workflow_id}
and g.graphic_id = t1.graphic_id)
union all
SELECT NULL AS detail_id,
NULL AS graphic_id,
NULL AS config,
decode(n.node_type,
'SUB_PROCESS',
'oval',
'BRANCH_NODE',
'diamond',
'rect') as type,
null as table_name,
n.node_desc,
n.node_type,
n.node_id as table_id
from zj_wfl_workflow_node n
where n.workflow_id = ${@workflow_id}
and not exists (select 1
from zj_wfl_graphics_detail d, zj_wfl_graphics g
where g.workflow_id = n.workflow_id
and d.graphic_id = g.graphic_id
and d.table_id = n.node_id)
]]></bm:query-sql>
</bm:operation>
<bm:operation name="insert">
<bm:parameters>
<bm:parameter name="detail_id" input="false" output="true" outputPath="@detail_id"/>
<bm:parameter name="graphic_id" input="false" output="true" outputPath="@graphic_id"/>
</bm:parameters>
<bm:update-sql><![CDATA[
begin
${@graphic_id}:=${../../@graphic_id};
zj_wfl_graphics_pkg.graphics_detail_update(p_detail_id => ${@detail_id},
p_graphic_id => ${../../@graphic_id},
p_config => ${@config},
p_type => ${@type},
p_table_name => ${@table_name},
p_table_id => ${@table_id},
p_user_id => ${/session/@user_id});
end;
]]></bm:update-sql>
</bm:operation>
<bm:operation name="update">
<bm:update-sql><![CDATA[
begin
zj_wfl_graphics_pkg.graphics_detail_update(p_detail_id => ${@detail_id},
p_graphic_id => ${../../@graphic_id},
p_config => ${@config},
p_type => ${@type},
p_table_name => ${@table_name},
p_table_id => ${@table_id},
p_user_id => ${/session/@user_id});
end;
]]></bm:update-sql>
</bm:operation>
<bm:operation name="execute">
<bm:update-sql><![CDATA[
begin
zj_wfl_graphics_pkg.graphics_reset(p_workflow_id => ${/parameter/@workflow_id},
p_user_id => ${/session/@user_id});
end;
]]></bm:update-sql>
</bm:operation>
</bm:operations>
<bm:primary-key>
<bm:pk-field name="detail_id"/>
</bm:primary-key>
<bm:features>
<o:sequence-pk/>
</bm:features>
</bm:model>