-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathsfg-advanced-search-web.bpml
166 lines (137 loc) · 7.86 KB
/
sfg-advanced-search-web.bpml
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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
<process name = "SFGAdvancedSearchWeb">
<rule name="partner_name">
<condition>string-length(/ProcessData/partnerName) > 0</condition>
</rule>
<rule name="partner_code">
<condition>string-length(/ProcessData/partnerCode) > 0</condition>
</rule>
<rule name="login_id">
<condition>string-length(/ProcessData/loginId) > 0</condition>
</rule>
<rule name="first_name">
<condition>string-length(/ProcessData/firstName) > 0</condition>
</rule>
<rule name="last_name">
<condition>string-length(/ProcessData/lastName) > 0</condition>
</rule>
<rule name="first_name_last_name">
<condition>string-length(/ProcessData/firstName) > 0 and string-length(/ProcessData/lastName) > 0</condition>
</rule>
<rule name="no_parameters">
<condition>string-length(/ProcessData/partnerName) = 0 and
string-length(/ProcessData/partnerCode) = 0 and
string-length(/ProcessData/loginId) = 0 and
string-length(/ProcessData/firstName) = 0 and
string-length(/ProcessData/lastName) = 0</condition>
</rule>
<rule name="is_new_page">
<condition>string(/ProcessData/ResponseData/newpage) = "Is New Page"</condition>
</rule>
<rule name="has_results">
<condition>count(/ProcessData/Result1/Row1) > 0</condition>
</rule>
<sequence>
<choice>
<select>
<case ref="partner_name" activity="PartnerName" />
<case ref="partner_code" activity="PartnerCode" />
<case ref="login_id" activity="LoginID" />
<case ref="first_name_last_name" activity="FirstNameLastName" />
<case ref="first_name" activity="FirstName" />
<case ref="last_name" activity="LastName" />
<case ref="no_parameters" activity="NoParams" />
</select>
<!--
select O.ORGANIZATION_NAME,O.ORGANIZATION_KEY,U.LOGINID,P.FIRST_NAME,P.LAST_NAME
from YFS_ORGANIZATION as O, YFS_USER as U, YFS_PERSON_INFO as P
where
O.ORGANIZATION_KEY = U.ORGANIZATION_KEY and U.BILLINGADDRESS_KEY = P.PERSON_INFO_KEY and
-->
<sequence name="PartnerName">
<assign to="This/sql" from="concat("select O.ORGANIZATION_NAME,TRIM(O.ORGANIZATION_KEY) as OKEY,TRIM(U.LOGINID) as LOGIN,P.FIRST_NAME,P.LAST_NAME from YFS_ORGANIZATION O, YFS_USER U, YFS_PERSON_INFO P where O.ORGANIZATION_KEY = U.ORGANIZATION_KEY and U.BILLINGADDRESS_KEY = P.PERSON_INFO_KEY and O.ORGANIZATION_NAME='",/ProcessData/partnerName/text(),"'")"></assign>
</sequence>
<sequence name="PartnerCode">
<assign to="This/sql" from="concat("select O.ORGANIZATION_NAME,TRIM(O.ORGANIZATION_KEY) as OKEY,TRIM(U.LOGINID) as LOGIN,P.FIRST_NAME,P.LAST_NAME from YFS_ORGANIZATION O, YFS_USER U, YFS_PERSON_INFO P where O.ORGANIZATION_KEY = U.ORGANIZATION_KEY and U.BILLINGADDRESS_KEY = P.PERSON_INFO_KEY and O.ORGANIZATION_KEY='",/ProcessData/partnerCode/text(),"'")"></assign>
</sequence>
<sequence name="LoginID">
<assign to="This/sql" from="concat("select O.ORGANIZATION_NAME,TRIM(O.ORGANIZATION_KEY) as OKEY,TRIM(U.LOGINID) as LOGIN,P.FIRST_NAME,P.LAST_NAME from YFS_ORGANIZATION O, YFS_USER U, YFS_PERSON_INFO P where O.ORGANIZATION_KEY = U.ORGANIZATION_KEY and U.BILLINGADDRESS_KEY = P.PERSON_INFO_KEY and U.LOGINID='",/ProcessData/loginId/text(),"'")"></assign>
</sequence>
<sequence name="FirstNameLastName">
<assign to="This/sql" from="concat("select O.ORGANIZATION_NAME,TRIM(O.ORGANIZATION_KEY) as OKEY,TRIM(U.LOGINID) as LOGIN,P.FIRST_NAME,P.LAST_NAME from YFS_ORGANIZATION O, YFS_USER U, YFS_PERSON_INFO P where O.ORGANIZATION_KEY = U.ORGANIZATION_KEY and U.BILLINGADDRESS_KEY = P.PERSON_INFO_KEY and P.FIRST_NAME like '%",/ProcessData/firstName/text(),"%' and LOWER(P.LAST_NAME) like LOWER('%",/ProcessData/lastName/text(),"%')")"></assign>
</sequence>
<sequence name="FirstName">
<assign to="This/sql" from="concat("select O.ORGANIZATION_NAME,TRIM(O.ORGANIZATION_KEY) as OKEY,TRIM(U.LOGINID) as LOGIN,P.FIRST_NAME,P.LAST_NAME from YFS_ORGANIZATION O, YFS_USER U, YFS_PERSON_INFO P where O.ORGANIZATION_KEY = U.ORGANIZATION_KEY and U.BILLINGADDRESS_KEY = P.PERSON_INFO_KEY and LOWER(P.FIRST_NAME) like LOWER('%",/ProcessData/firstName/text(),"%')")"></assign>
</sequence>
<sequence name="LastName">
<assign to="This/sql" from="concat("select O.ORGANIZATION_NAME,TRIM(O.ORGANIZATION_KEY) as OKEY,TRIM(U.LOGINID) as LOGIN,P.FIRST_NAME,P.LAST_NAME from YFS_ORGANIZATION O, YFS_USER U, YFS_PERSON_INFO P where O.ORGANIZATION_KEY = U.ORGANIZATION_KEY and U.BILLINGADDRESS_KEY = P.PERSON_INFO_KEY and LOWER(P.LAST_NAME) like LOWER('%",/ProcessData/lastName/text(),"%')")"></assign>
</sequence>
<sequence name="NoParams">
<assign to="/ProcessData/ResponseData/newpage">Is New Page</assign>
</sequence>
</choice>
<choice>
<select>
<case ref="is_new_page" negative="true" activity="QueryData" />
<case ref="is_new_page" activity="NewPage" />
</select>
<sequence name="QueryData">
<operation name="Lightweight JDBC Adapter">
<participant name="LightweightJDBCAdapterQuery" />
<output message="LightweightJDBCAdapterTypeInputMessage">
<assign to="." from="*"></assign>
<assign to="pool">db2Pool</assign>
<assign to="query_type">SELECT</assign>
<assign to="result_name">Result1</assign>
<assign to="row_name">Row1</assign>
<assign to="sql" from="/ProcessData/This/sql/text()"></assign>
</output>
<input message="inmsg">
<assign to="." from="DocToDOM(PrimaryDocument)"></assign>
</input>
</operation>
</sequence>
<sequence name="NewPage">
<assign to="/ProcessData/ResponseData/newpage">Is New Page</assign>
</sequence>
</choice>
<choice>
<select>
<case ref="is_new_page" activity="OutputNewPage" />
<case ref="has_results" activity="OutputData" />
<case ref="has_results" negative="true" activity="OutputNoResults" />
</select>
<sequence name="OutputNewPage">
<assign to="/ProcessData/ResponseData/newpage">Is New Page</assign>
</sequence>
<sequence name="OutputData">
<assign to="/ProcessData/ResponseData/data" from="/ProcessData/Result1/Row1"></assign>
</sequence>
<sequence name="OutputNoResults">
<assign to="/ProcessData/ResponseData/noresult">No Results</assign>
</sequence>
</choice>
<operation name="XSLT Service">
<participant name="XSLTService"/>
<output message="XSLTServiceTypeInputMessage">
<assign to="input_pd_xpath">/ProcessData/ResponseData</assign>
<assign to="xml_input_from">ProcData</assign>
<assign to="xml_input_validation">NO</assign>
<assign to="xslt_name">SFGAdvancedSearch</assign>
<assign to="." from="*"></assign>
</output>
<input message="inmsg">
<assign to="." from="*"></assign>
</input>
</operation>
<operation name="HttpRespond">
<participant name="HttpRespond"/>
<output message="HttpRespondInputMessage">
<assign to="doc-has-headers">false</assign> <!-- Implying non-raw mode by default. -->
<assign to="." from="*"></assign>
</output>
<input message="inmsg">
<assign to="." from="*"></assign>
</input>
</operation>
</sequence>
</process>