forked from mosip/mosip-config
-
Notifications
You must be signed in to change notification settings - Fork 0
/
registration-processor-camel-routes-activate-default.xml
156 lines (155 loc) · 6.95 KB
/
registration-processor-camel-routes-activate-default.xml
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
<routes xmlns="http://camel.apache.org/schema/spring">
<!-- Packet-Reciever to securezone-notification Route -->
<route id="packet-reciever-->securezone-notification activated route">
<from uri="eventbus://packet-receiver-activated-bus-out" />
<log message="packet-reciever-->securezone-notification activated-route ${bodyAs(String)}" />
<choice>
<when>
<jsonpath>$.[?(@['isValid'] == false && @['internalError'] == true)]</jsonpath>
<to uri="workflow-cmd://complete-as-failed" />
</when>
<when>
<jsonpath>$.[?(@['isValid'] == true && @['internalError'] == true)]</jsonpath>
<to uri="workflow-cmd://mark-as-reprocess" />
</when>
<when>
<jsonpath>$.[?(@['isValid'] == false && @['internalError'] == false)]</jsonpath>
<to uri="workflow-cmd://complete-as-failed" />
</when>
<otherwise>
<process ref="tokenGenerationProcessor" />
<setHeader headerName="CamelHttpMethod">
<constant>POST</constant>
</setHeader>
<setHeader headerName="Content-Type">
<constant>application/json</constant>
</setHeader>
<setHeader headerName="Cookie">
<simple>${header.Cookie}</simple>
</setHeader>
<setBody>
<simple>${bodyAs(String)}</simple>
</setBody>
<to uri="http://regproc-group2.regproc/registrationprocessor/v1/securezone/notification" />
</otherwise>
</choice>
</route>
<route id="securezone-notification-->packet-uploader activated route">
<from uri="eventbus://securezone-notification-activated-bus-out" />
<log message="securezone-notification-->packet-uploader activated route ${bodyAs(String)}" />
<choice>
<when>
<jsonpath>$.[?(@['isValid'] == false && @['internalError'] == true)]</jsonpath>
<to uri="workflow-cmd://complete-as-failed" />
</when>
<when>
<jsonpath>$.[?(@['isValid'] == true && @['internalError'] == true)]</jsonpath>
<to uri="workflow-cmd://mark-as-reprocess" />
</when>
<when>
<jsonpath>$.[?(@['isValid'] == false && @['internalError'] == false)]</jsonpath>
<to uri="workflow-cmd://complete-as-failed" />
</when>
<otherwise>
<to uri="eventbus://packet-uploader-bus-in" />
</otherwise>
</choice>
</route>
<!-- Packet uploader to uin-generator Route -->
<route id="packet-uploader-->uin-generator activated route">
<from uri="eventbus://packet-uploader-activated-bus-out" />
<log message="packet-uploader-->uin-generator activated route ${bodyAs(String)}" />
<choice>
<when>
<jsonpath>$.[?(@['isValid'] == false && @['internalError'] == true)]</jsonpath>
<to uri="workflow-cmd://complete-as-failed" />
<to uri="workflow-cmd://anonymous-profile" />
</when>
<when>
<jsonpath>$.[?(@['isValid'] == true && @['internalError'] == true)]</jsonpath>
<to uri="workflow-cmd://mark-as-reprocess" />
</when>
<when>
<jsonpath>$.[?(@['isValid'] == false && @['internalError'] == false)]</jsonpath>
<to uri="workflow-cmd://complete-as-failed" />
<to uri="workflow-cmd://anonymous-profile" />
</when>
<otherwise>
<to uri="eventbus://uin-generator-bus-in" />
</otherwise>
</choice>
</route>
<!-- UIN Generator to biometric-extraction Route -->
<route id="uin-generation route-->biometric-extraction-stage activated route">
<from uri="eventbus://uin-generator-activated-bus-out" />
<log message="uin-generation-->biometric-extraction-stage route ${bodyAs(String)}" />
<choice>
<when>
<jsonpath>$.[?(@['isValid'] == false && @['internalError'] == true)]</jsonpath>
<to uri="workflow-cmd://complete-as-failed" />
<to uri="workflow-cmd://anonymous-profile" />
</when>
<when>
<jsonpath>$.[?(@['isValid'] == true && @['internalError'] == true)]</jsonpath>
<to uri="workflow-cmd://mark-as-reprocess" />
</when>
<when>
<jsonpath>$.[?(@['isValid'] == false && @['internalError'] == false)]</jsonpath>
<to uri="workflow-cmd://complete-as-failed" />
<to uri="workflow-cmd://anonymous-profile" />
</when>
<otherwise>
<to uri="eventbus://biometric-extraction-bus-in" />
</otherwise>
</choice>
</route>
<!-- biometric-extraction to finalization Route -->
<route id="biometric-extraction route-->finalization-stage activated route">
<from uri="eventbus://biometric-extraction-activated-bus-out" />
<log message="biometric-extraction-->finalization-stage route ${bodyAs(String)}" />
<choice>
<when>
<jsonpath>$.[?(@['isValid'] == false && @['internalError'] == true)]</jsonpath>
<to uri="workflow-cmd://complete-as-failed" />
<to uri="workflow-cmd://anonymous-profile" />
</when>
<when>
<jsonpath>$.[?(@['isValid'] == true && @['internalError'] == true)]</jsonpath>
<to uri="workflow-cmd://mark-as-reprocess" />
</when>
<when>
<jsonpath>$.[?(@['isValid'] == false && @['internalError'] == false)]</jsonpath>
<to uri="workflow-cmd://complete-as-failed" />
<to uri="workflow-cmd://anonymous-profile" />
</when>
<otherwise>
<to uri="eventbus://finalization-bus-in" />
</otherwise>
</choice>
</route>
<!-- finalization to activated Route -->
<route id="finalization route--> activated route">
<from uri="eventbus://finalization-activated-bus-out" />
<log message="finalization--> activated route ${bodyAs(String)}" />
<choice>
<when>
<jsonpath>$.[?(@['isValid'] == false && @['internalError'] == true)]</jsonpath>
<to uri="workflow-cmd://complete-as-failed" />
<to uri="workflow-cmd://anonymous-profile" />
</when>
<when>
<jsonpath>$.[?(@['isValid'] == true && @['internalError'] == true)]</jsonpath>
<to uri="workflow-cmd://mark-as-reprocess" />
</when>
<when>
<jsonpath>$.[?(@['isValid'] == false && @['internalError'] == false)]</jsonpath>
<to uri="workflow-cmd://complete-as-failed" />
<to uri="workflow-cmd://anonymous-profile" />
</when>
<otherwise>
<to uri="workflow-cmd://complete-as-processed" />
<to uri="workflow-cmd://anonymous-profile" />
</otherwise>
</choice>
</route>
</routes>