Monday, March 7, 2016

How to change password policy in Domain Controller


Applies to Windows 2012




Click Group Policy Management on Start Screen or MMC snap-in


 

Right Click on Default Domain Policy then select Edit...


Change Password Policy that you want.

Changes take effect when click OK



Thursday, March 3, 2016

Update Human Task payload in process instance

Prerequisite

  • Known of BPMN process flow
  • Have a Human Task in process flow

Methodology
  1. Web Service API (HTTP protocol) :- Have bug in 11.1.1.6. DOC ID 1483290.1
  2. Java API (Oracle T3 protocol) :- some case in clustering environment not working with H/W load balancer (i.e. F5 etc) but can follow in􀀃 DOC ID 1541970.1􀀗􀀔􀀜

A. Web Service API

A.1 Query task Detail to become an input of next request in A.2

url: http://soabpm-vm.site:7001/integration/services/TaskQueryService/TaskQueryService?WSDL
operation : getTaskDetailById

Request
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tas="http://xmlns.oracle.com/bpel/workflow/taskQueryService" xmlns:com="http://xmlns.oracle.com/bpel/workflow/common">
   <soapenv:Header/>
   <soapenv:Body>
      <tas:taskDetailsByIdRequest>
         <!--Optional:-->
         <com:workflowContext>
            <!--Optional:-->
            <com:credential>
               <com:login>weblogic</com:login>
               <com:password>welcome1</com:password>
               <!--Optional:-->
               <com:identityContext>jazn.com</com:identityContext>
            </com:credential>
         </com:workflowContext>
         <tas:taskId>28c1a7a4-16c3-45c9-9c71-50be0da55a0e</tas:taskId>
      </tas:taskDetailsByIdRequest>
   </soapenv:Body>
</soapenv:Envelope>

Response

  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
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
   <env:Header/>
   <env:Body>
      <task xmlns="http://xmlns.oracle.com/bpel/workflow/task">
         <title>กธ.: 121223</title>
         <payload>
            <EdasObject xmlns="http://xmlns.oracle.com/bpm/bpmobject/Data/EdasObject">
               <policy_no>121223</policy_no>
               <appl_no/>
               <scan_date/>
               <scan_time/>
               <endr_code>10</endr_code>
               <clientid>232323</clientid>
               <userid>301</userid>
               <team>CENTER</team>
               <insured_name>nutt</insured_name>
               <issue_location/>
               <doc_no/>
               <doc_version/>
               <doc_fax/>
               <page_number/>
               <permission/>
               <templateid/>
               <position/>
               <comment/>
               <url1/>
               <url2/>
               <operid/>
               <doc_type/>
               <doc_name/>
               <doc_status/>
            </EdasObject>
            <ItcreativeObject xmlns="http://xmlns.oracle.com/bpm/bpmobject/Data/ItcreativeObject">
               <policy_no>121223</policy_no>
               <appl_no/>
               <clientid>232323</clientid>
               <jobcode/>
               <insured_name>nutt</insured_name>
               <genpdf_date/>
               <genpdf_time/>
               <userid>301</userid>
               <operid/>
               <team>CENTER</team>
               <endrcreate_date>16-02-26</endrcreate_date>
               <endrcreate_time/>
               <endreff_date>16-02-26</endreff_date>
               <endreff_time/>
               <comment/>
               <endr_code>10</endr_code>
               <endr_desc/>
               <job_desc/>
               <assign_type/>
               <match_type>7777</match_type>
               <route/>
               <approveid/>
               <departmentid/>
               <headid/>
               <oper_name/>
               <url1>http://LOGFILE4</url1>
               <url2/>
               <spool_receipt>LOGFILE4</spool_receipt>
               <spool_return/>
               <identified/>
               <taskid/>
               <approveuserid/>
               <approve_date/>
               <approve_time/>
               <code>01</code>
               <log_name>LOGFILE4</log_name>
            </ItcreativeObject>
            <ProcessObject xmlns="http://xmlns.oracle.com/bpm/bpmobject/Data/ProcessObject">
               <outcome1/>
               <outcome2/>
               <outcome3/>
               <outcome4/>
               <attribute1/>
               <attribute2/>
               <attribute3/>
               <attribute4/>
               <attribute5/>
               <attribute6/>
               <attribute7/>
               <attribute8/>
               <attribute9/>
               <attribute10/>
               <route/>
            </ProcessObject>
            <policyno/>
            <insured_name/>
            <operid/>
            <endr_code/>
            <endr_desc/>
            <clientid/>
            <team/>
            <endrcreate_date/>
            <comment1/>
            <comment2/>
            <spool_receipt/>
            <eff_date/>
            <opername/>
            <pdf_date/>
            <create_datetime/>
            <eff_datetime/>
         </payload>
         <taskDefinitionURI>default/EndrPosWFProject!1.0/EndrJobcode1RoundTask</taskDefinitionURI>
         <priority>3</priority>
         <identityContext>jazn.com</identityContext>
         <processInfo>
            <instanceId>750002</instanceId>
            <processId>EndrPosWFProcess</processId>
            <processName>EndrPosWFProcess</processName>
         </processInfo>
         <systemAttributes>
            <assignedDate>2016-02-26T14:51:06+07:00</assignedDate>
            <assigneeUsers>
               <id>fkafka</id>
               <displayName>Franz Kafka</displayName>
               <type>user</type>
            </assigneeUsers>
            <createdDate>2016-02-26T14:51:06+07:00</createdDate>
            <digitalSignatureRequired>false</digitalSignatureRequired>
            <fromUser>
               <type>user</type>
            </fromUser>
            <hasSubTasks>false</hasSubTasks>
            <inShortHistory>false</inShortHistory>
            <isGroup>false</isGroup>
            <numberOfTimesModified>8</numberOfTimesModified>
            <passwordRequiredOnUpdate>false</passwordRequiredOnUpdate>
            <pushbackSequence>INITIAL_ASSIGNEES;1</pushbackSequence>
            <secureNotifications>false</secureNotifications>
            <shortHistory>
               <task>
                  <state>ASSIGNED</state>
                  <updatedBy>
                     <id>workflowsystem</id>
                     <type>user</type>
                  </updatedBy>
                  <updatedDate>2016-02-26T14:51:06+07:00</updatedDate>
                  <version>1</version>
                  <versionReason>TASK_VERSION_REASON_INITIATED</versionReason>
               </task>
               <task>
                  <state>ASSIGNED</state>
                  <updatedBy>
                     <id>fkafka</id>
                     <type>user</type>
                  </updatedBy>
                  <updatedDate>2016-02-26T14:53:06+07:00</updatedDate>
                  <version>2</version>
                  <versionReason>TASK_VERSION_REASON_UPDATED</versionReason>
               </task>
            </shortHistory>
            <state>ASSIGNED</state>
            <systemActions>
               <action>UPDATE_COMMENT</action>
            </systemActions>
            <systemActions>
               <action>SKIP_CURRENT_ASSIGNMENT</action>
            </systemActions>
            <systemActions>
               <action>VIEW_SUB_TASKS</action>
            </systemActions>
            <systemActions>
               <action>SUSPEND</action>
            </systemActions>
            <systemActions>
               <action>UPDATE</action>
            </systemActions>
            <systemActions>
               <action>UPDATE_ATTACHMENT</action>
            </systemActions>
            <systemActions>
               <action>SUSPEND_TIMERS</action>
            </systemActions>
            <systemActions>
               <action>ESCALATE</action>
            </systemActions>
            <systemActions>
               <action>VIEW_PROCESS_HISTORY</action>
            </systemActions>
            <systemActions>
               <action>REASSIGN</action>
            </systemActions>
            <systemActions>
               <action>VIEW_TASK</action>
            </systemActions>
            <systemActions>
               <action>OVERRIDE_ROUTING_SLIP</action>
            </systemActions>
            <systemActions>
               <action>WITHDRAW</action>
            </systemActions>
            <systemActions>
               <action>VIEW_TASK_HISTORY</action>
            </systemActions>
            <taskId>28c1a7a4-16c3-45c9-9c71-50be0da55a0e</taskId>
            <taskNumber>201005</taskNumber>
            <updatedBy>
               <id>fkafka</id>
               <displayName>Franz Kafka</displayName>
               <type>user</type>
            </updatedBy>
            <updatedDate>2016-03-01T16:14:31+07:00</updatedDate>
            <version>8</version>
            <versionReason>TASK_VERSION_REASON_UPDATED</versionReason>
            <taskDefinitionId>default/EndrPosWFProject!1.0/EndrJobcode1RoundTask</taskDefinitionId>
            <taskDefinitionName>EndrJobcode1RoundTask</taskDefinitionName>
            <workflowPattern>Participant</workflowPattern>
            <isTestTask>false</isTestTask>
            <participantName>default.DefaultPerformer</participantName>
            <assignees>
               <id>fkafka</id>
               <displayName>Franz Kafka</displayName>
               <type>user</type>
            </assignees>
            <rootTaskId>28c1a7a4-16c3-45c9-9c71-50be0da55a0e</rootTaskId>
            <systemStringActions>PUSH_BACK,sharePayload</systemStringActions>
            <stage>Stage1</stage>
            <isTemplateTask>false</isTemplateTask>
            <taskNamespace>http://xmlns.oracle.com/EndrPosWF/EndrPosWFProject/EndrJobcode1RoundTask</taskNamespace>
            <actionDisplayName>Task Updated</actionDisplayName>
            <componentType>Workflow</componentType>
            <activityName>EndrJobcode1RoundTask</activityName>
            <activityId>ABSTRACT_ACTIVITY14808830821823</activityId>
            <thread>0</thread>
            <parentThread>-1</parentThread>
            <swimlaneRole>EndrJobcode1</swimlaneRole>
            <timersSuspended>false</timersSuspended>
         </systemAttributes>
         <systemMessageAttributes>
            <protectedTextAttribute3>121223</protectedTextAttribute3>
            <protectedTextAttribute4>nutt</protectedTextAttribute4>
            <protectedTextAttribute5>10</protectedTextAttribute5>
            <protectedTextAttribute7>232323</protectedTextAttribute7>
            <protectedTextAttribute8>CENTER</protectedTextAttribute8>
            <protectedTextAttribute9>7777</protectedTextAttribute9>
            <flexfieldMappings>
               <attributeLabel>comment_key</attributeLabel>
               <flexfield>ProtectedTextAttribute2</flexfield>
               <description/>
            </flexfieldMappings>
            <flexfieldMappings>
               <attributeLabel>comment_lov</attributeLabel>
               <flexfield>ProtectedTextAttribute1</flexfield>
               <description/>
            </flexfieldMappings>
            <flexfieldMappings>
               <attributeLabel>match</attributeLabel>
               <flexfield>ProtectedTextAttribute9</flexfield>
               <description/>
            </flexfieldMappings>
            <flexfieldMappings>
               <attributeLabel>clientno</attributeLabel>
               <flexfield>ProtectedTextAttribute7</flexfield>
               <description/>
            </flexfieldMappings>
            <flexfieldMappings>
               <attributeLabel>team_group</attributeLabel>
               <flexfield>ProtectedTextAttribute8</flexfield>
               <description/>
            </flexfieldMappings>
            <flexfieldMappings>
               <attributeLabel>endr_desc</attributeLabel>
               <flexfield>ProtectedTextAttribute6</flexfield>
               <description/>
            </flexfieldMappings>
            <flexfieldMappings>
               <attributeLabel>insured_name</attributeLabel>
               <flexfield>ProtectedTextAttribute4</flexfield>
               <description/>
            </flexfieldMappings>
            <flexfieldMappings>
               <attributeLabel>policyno</attributeLabel>
               <flexfield>ProtectedTextAttribute3</flexfield>
               <description/>
            </flexfieldMappings>
            <flexfieldMappings>
               <attributeLabel>endr_code</attributeLabel>
               <flexfield>ProtectedTextAttribute5</flexfield>
               <description/>
            </flexfieldMappings>
         </systemMessageAttributes>
         <callback>
            <id>EndrPosWFProcess/HumanTasks.EndrJobcode1RoundTask.reference</id>
            <converstationId>urn:B04AF5C0DC5D11E58F0843A0EBF41DA3</converstationId>
         </callback>
         <category>ไม่พบเอกสาร</category>
         <isPublic>false</isPublic>
         <sca>
            <applicationName>default</applicationName>
            <componentName>EndrJobcode1RoundTask</componentName>
            <compositeDN>default/EndrPosWFProject!1.0*soa_8403c656-ccdc-4c1e-8a7b-e250ad6de79d</compositeDN>
            <compositeInstanceId>550006</compositeInstanceId>
            <compositeName>EndrPosWFProject</compositeName>
            <compositeVersion>1.0</compositeVersion>
            <ecId>11d1def534ea1be0:9ceed04:15317446564:-8000-000000000000a450</ecId>
            <parentComponentInstanceId>bpmn:750002</parentComponentInstanceId>
            <parentComponentInstanceRefId>750002-ABSTRACT_ACTIVITY14808830821823-EndrPosWFProcess_try.2-11</parentComponentInstanceRefId>
            <compositeCreatedTime>2016-02-26T14:50:51.796+07:00</compositeCreatedTime>
         </sca>
         <applicationContext>OracleBPMProcessRolesApp</applicationContext>
         <taskDefinitionId>default/EndrPosWFProject!1.0/EndrJobcode1RoundTask</taskDefinitionId>
         <correlationId>28c1a7a4-16c3-45c9-9c71-50be0da55a0e</correlationId>
         <mdsLabel>soa_31fbf488-68ba-42d0-8055-d4a859cf8cac</mdsLabel>
         <customAttributes>
            <customAttributeNumber1>0.0</customAttributeNumber1>
            <customAttributeNumber2>0.0</customAttributeNumber2>
         </customAttributes>
      </task>
   </env:Body>
</env:Envelope>

A.2 Update a current task detail from A.1, you can change human task payload here see in <payload>

url : http://soabpm-vm.site:7001/integration/services/TaskService/TaskServicePort?WSDL
operation : updateTask

Request
  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
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tas="http://xmlns.oracle.com/bpel/workflow/taskService" xmlns:com="http://xmlns.oracle.com/bpel/workflow/common" xmlns:task="http://xmlns.oracle.com/bpel/workflow/task" xmlns:tas1="http://xmlns.oracle.com/bpel/workflow/TaskEvidenceService">
   <soapenv:Header/>
   <soapenv:Body>
      <tas:updateTask>
         <!--Optional:-->
         <com:workflowContext>
            <com:credential>
               <com:login>weblogic</com:login>
               <com:password>welcome1</com:password>
               <!--Optional:-->
               <com:identityContext>jazn.com</com:identityContext>
               <com:onBehalfOfUser>fkafka</com:onBehalfOfUser>
            </com:credential>
         </com:workflowContext>
      <task xmlns="http://xmlns.oracle.com/bpel/workflow/task">
         <title>กธ.: 121223</title>
         <payload>
            <EdasObject xmlns="http://xmlns.oracle.com/bpm/bpmobject/Data/EdasObject">
               <policy_no>121223</policy_no>
               <appl_no/>
               <scan_date/>
               <scan_time/>
               <endr_code>10</endr_code>
               <clientid>232323</clientid>
               <userid>301</userid>
               <team>CENTER</team>
               <insured_name>nutt</insured_name>
               <issue_location/>
               <doc_no/>
               <doc_version/>
               <doc_fax/>
               <page_number/>
               <permission/>
               <templateid/>
               <position/>
               <comment/>
               <url1/>
               <url2/>
               <operid/>
               <doc_type/>
               <doc_name/>
               <doc_status/>
            </EdasObject>
            <ItcreativeObject xmlns="http://xmlns.oracle.com/bpm/bpmobject/Data/ItcreativeObject">
               <policy_no>121223</policy_no>
               <appl_no/>
               <clientid>232323</clientid>
               <jobcode/>
               <insured_name>nutt</insured_name>
               <genpdf_date/>
               <genpdf_time/>
               <userid>301</userid>
               <operid/>
               <team>CENTER</team>
               <endrcreate_date>16-02-26</endrcreate_date>
               <endrcreate_time/>
               <endreff_date>16-02-26</endreff_date>
               <endreff_time/>
               <comment/>
               <endr_code>10</endr_code>
               <endr_desc/>
               <job_desc/>
               <assign_type/>
               <match_type>7777</match_type>
               <route/>
               <approveid/>
               <departmentid/>
               <headid/>
               <oper_name/>
               <url1>http://LOGFILE4</url1>
               <url2/>
               <spool_receipt>LOGFILE4</spool_receipt>
               <spool_return/>
               <identified/>
               <taskid/>
               <approveuserid/>
               <approve_date/>
               <approve_time/>
               <code>01</code>
               <log_name>LOGFILE4</log_name>
            </ItcreativeObject>
            <ProcessObject xmlns="http://xmlns.oracle.com/bpm/bpmobject/Data/ProcessObject">
               <outcome1/>
               <outcome2/>
               <outcome3/>
               <outcome4/>
               <attribute1/>
               <attribute2/>
               <attribute3/>
               <attribute4/>
               <attribute5/>
               <attribute6/>
               <attribute7/>
               <attribute8/>
               <attribute9/>
               <attribute10/>
               <route/>
            </ProcessObject>
            <policyno/>
            <insured_name/>
            <operid/>
            <endr_code/>
            <endr_desc/>
            <clientid/>
            <team/>
            <endrcreate_date/>
            <comment1/>
            <comment2/>
            <spool_receipt/>
            <eff_date/>
            <opername/>
            <pdf_date/>
            <create_datetime/>
            <eff_datetime/>
         </payload>
         <taskDefinitionURI>default/EndrPosWFProject!1.0/EndrJobcode1RoundTask</taskDefinitionURI>
         <priority>3</priority>
         <identityContext>jazn.com</identityContext>
         <processInfo>
            <instanceId>750002</instanceId>
            <processId>EndrPosWFProcess</processId>
            <processName>EndrPosWFProcess</processName>
         </processInfo>
         <systemAttributes>
            <assignedDate>2016-02-26T14:51:06+07:00</assignedDate>
            <assigneeUsers>
               <id>fkafka</id>
               <displayName>Franz Kafka</displayName>
               <type>user</type>
            </assigneeUsers>
            <createdDate>2016-02-26T14:51:06+07:00</createdDate>
            <digitalSignatureRequired>false</digitalSignatureRequired>
            <fromUser>
               <type>user</type>
            </fromUser>
            <hasSubTasks>false</hasSubTasks>
            <inShortHistory>false</inShortHistory>
            <isGroup>false</isGroup>
            <numberOfTimesModified>8</numberOfTimesModified>
            <passwordRequiredOnUpdate>false</passwordRequiredOnUpdate>
            <pushbackSequence>INITIAL_ASSIGNEES;1</pushbackSequence>
            <secureNotifications>false</secureNotifications>
            <shortHistory>
               <task>
                  <state>ASSIGNED</state>
                  <updatedBy>
                     <id>workflowsystem</id>
                     <type>user</type>
                  </updatedBy>
                  <updatedDate>2016-02-26T14:51:06+07:00</updatedDate>
                  <version>1</version>
                  <versionReason>TASK_VERSION_REASON_INITIATED</versionReason>
               </task>
               <task>
                  <state>ASSIGNED</state>
                  <updatedBy>
                     <id>fkafka</id>
                     <type>user</type>
                  </updatedBy>
                  <updatedDate>2016-02-26T14:53:06+07:00</updatedDate>
                  <version>2</version>
                  <versionReason>TASK_VERSION_REASON_UPDATED</versionReason>
               </task>
            </shortHistory>
            <state>ASSIGNED</state>
            <systemActions>
               <action>UPDATE_COMMENT</action>
            </systemActions>
            <systemActions>
               <action>SKIP_CURRENT_ASSIGNMENT</action>
            </systemActions>
            <systemActions>
               <action>VIEW_SUB_TASKS</action>
            </systemActions>
            <systemActions>
               <action>SUSPEND</action>
            </systemActions>
            <systemActions>
               <action>UPDATE</action>
            </systemActions>
            <systemActions>
               <action>UPDATE_ATTACHMENT</action>
            </systemActions>
            <systemActions>
               <action>SUSPEND_TIMERS</action>
            </systemActions>
            <systemActions>
               <action>ESCALATE</action>
            </systemActions>
            <systemActions>
               <action>VIEW_PROCESS_HISTORY</action>
            </systemActions>
            <systemActions>
               <action>REASSIGN</action>
            </systemActions>
            <systemActions>
               <action>VIEW_TASK</action>
            </systemActions>
            <systemActions>
               <action>OVERRIDE_ROUTING_SLIP</action>
            </systemActions>
            <systemActions>
               <action>WITHDRAW</action>
            </systemActions>
            <systemActions>
               <action>VIEW_TASK_HISTORY</action>
            </systemActions>
            <taskId>28c1a7a4-16c3-45c9-9c71-50be0da55a0e</taskId>
            <taskNumber>201005</taskNumber>
            <updatedBy>
               <id>fkafka</id>
               <displayName>Franz Kafka</displayName>
               <type>user</type>
            </updatedBy>
            <updatedDate>2016-03-01T16:14:31+07:00</updatedDate>
            <version>8</version>
            <versionReason>TASK_VERSION_REASON_UPDATED</versionReason>
            <taskDefinitionId>default/EndrPosWFProject!1.0/EndrJobcode1RoundTask</taskDefinitionId>
            <taskDefinitionName>EndrJobcode1RoundTask</taskDefinitionName>
            <workflowPattern>Participant</workflowPattern>
            <isTestTask>false</isTestTask>
            <participantName>default.DefaultPerformer</participantName>
            <assignees>
               <id>fkafka</id>
               <displayName>Franz Kafka</displayName>
               <type>user</type>
            </assignees>
            <rootTaskId>28c1a7a4-16c3-45c9-9c71-50be0da55a0e</rootTaskId>
            <systemStringActions>PUSH_BACK,sharePayload</systemStringActions>
            <stage>Stage1</stage>
            <isTemplateTask>false</isTemplateTask>
            <taskNamespace>http://xmlns.oracle.com/EndrPosWF/EndrPosWFProject/EndrJobcode1RoundTask</taskNamespace>
            <actionDisplayName>Task Updated</actionDisplayName>
            <componentType>Workflow</componentType>
            <activityName>EndrJobcode1RoundTask</activityName>
            <activityId>ABSTRACT_ACTIVITY14808830821823</activityId>
            <thread>0</thread>
            <parentThread>-1</parentThread>
            <swimlaneRole>EndrJobcode1</swimlaneRole>
            <timersSuspended>false</timersSuspended>
         </systemAttributes>
         <systemMessageAttributes>
            <protectedTextAttribute3>121223</protectedTextAttribute3>
            <protectedTextAttribute4>nutt</protectedTextAttribute4>
            <protectedTextAttribute5>10</protectedTextAttribute5>
            <protectedTextAttribute7>232323</protectedTextAttribute7>
            <protectedTextAttribute8>CENTER</protectedTextAttribute8>
            <protectedTextAttribute9>7777</protectedTextAttribute9>
            <flexfieldMappings>
               <attributeLabel>comment_key</attributeLabel>
               <flexfield>ProtectedTextAttribute2</flexfield>
               <description/>
            </flexfieldMappings>
            <flexfieldMappings>
               <attributeLabel>comment_lov</attributeLabel>
               <flexfield>ProtectedTextAttribute1</flexfield>
               <description/>
            </flexfieldMappings>
            <flexfieldMappings>
               <attributeLabel>match</attributeLabel>
               <flexfield>ProtectedTextAttribute9</flexfield>
               <description/>
            </flexfieldMappings>
            <flexfieldMappings>
               <attributeLabel>clientno</attributeLabel>
               <flexfield>ProtectedTextAttribute7</flexfield>
               <description/>
            </flexfieldMappings>
            <flexfieldMappings>
               <attributeLabel>team_group</attributeLabel>
               <flexfield>ProtectedTextAttribute8</flexfield>
               <description/>
            </flexfieldMappings>
            <flexfieldMappings>
               <attributeLabel>endr_desc</attributeLabel>
               <flexfield>ProtectedTextAttribute6</flexfield>
               <description/>
            </flexfieldMappings>
            <flexfieldMappings>
               <attributeLabel>insured_name</attributeLabel>
               <flexfield>ProtectedTextAttribute4</flexfield>
               <description/>
            </flexfieldMappings>
            <flexfieldMappings>
               <attributeLabel>policyno</attributeLabel>
               <flexfield>ProtectedTextAttribute3</flexfield>
               <description/>
            </flexfieldMappings>
            <flexfieldMappings>
               <attributeLabel>endr_code</attributeLabel>
               <flexfield>ProtectedTextAttribute5</flexfield>
               <description/>
            </flexfieldMappings>
         </systemMessageAttributes>
         <callback>
            <id>EndrPosWFProcess/HumanTasks.EndrJobcode1RoundTask.reference</id>
            <converstationId>urn:B04AF5C0DC5D11E58F0843A0EBF41DA3</converstationId>
         </callback>
         <category>ไม่พบเอกสาร</category>
         <isPublic>false</isPublic>
         <sca>
            <applicationName>default</applicationName>
            <componentName>EndrJobcode1RoundTask</componentName>
            <compositeDN>default/EndrPosWFProject!1.0*soa_8403c656-ccdc-4c1e-8a7b-e250ad6de79d</compositeDN>
            <compositeInstanceId>550006</compositeInstanceId>
            <compositeName>EndrPosWFProject</compositeName>
            <compositeVersion>1.0</compositeVersion>
            <ecId>11d1def534ea1be0:9ceed04:15317446564:-8000-000000000000a450</ecId>
            <parentComponentInstanceId>bpmn:750002</parentComponentInstanceId>
            <parentComponentInstanceRefId>750002-ABSTRACT_ACTIVITY14808830821823-EndrPosWFProcess_try.2-11</parentComponentInstanceRefId>
            <compositeCreatedTime>2016-02-26T14:50:51.796+07:00</compositeCreatedTime>
         </sca>
         <applicationContext>OracleBPMProcessRolesApp</applicationContext>
         <taskDefinitionId>default/EndrPosWFProject!1.0/EndrJobcode1RoundTask</taskDefinitionId>
         <correlationId>28c1a7a4-16c3-45c9-9c71-50be0da55a0e</correlationId>
         <mdsLabel>soa_31fbf488-68ba-42d0-8055-d4a859cf8cac</mdsLabel>
         <customAttributes>
            <customAttributeNumber1>0.0</customAttributeNumber1>
            <customAttributeNumber2>0.0</customAttributeNumber2>
         </customAttributes>
      </task>
 </tas:updateTask>
   </soapenv:Body>
</soapenv:Envelope>

Response

  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
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
   <env:Header/>
   <env:Body>
      <task xmlns="http://xmlns.oracle.com/bpel/workflow/task">
         <title>กธ.: 121223</title>
         <payload>
            <EdasObject xmlns="http://xmlns.oracle.com/bpm/bpmobject/Data/EdasObject">
               <policy_no>121223</policy_no>
               <appl_no/>
               <scan_date/>
               <scan_time/>
               <endr_code>10</endr_code>
               <clientid>232323</clientid>
               <userid>301</userid>
               <team>CENTER</team>
               <insured_name>nutt</insured_name>
               <issue_location/>
               <doc_no/>
               <doc_version/>
               <doc_fax/>
               <page_number/>
               <permission/>
               <templateid/>
               <position/>
               <comment/>
               <url1/>
               <url2/>
               <operid/>
               <doc_type/>
               <doc_name/>
               <doc_status/>
            </EdasObject>
            <ItcreativeObject xmlns="http://xmlns.oracle.com/bpm/bpmobject/Data/ItcreativeObject">
               <policy_no>121223</policy_no>
               <appl_no/>
               <clientid>232323</clientid>
               <jobcode/>
               <insured_name>nutt</insured_name>
               <genpdf_date/>
               <genpdf_time/>
               <userid>301</userid>
               <operid/>
               <team>CENTER</team>
               <endrcreate_date>16-02-26</endrcreate_date>
               <endrcreate_time/>
               <endreff_date>16-02-26</endreff_date>
               <endreff_time/>
               <comment/>
               <endr_code>10</endr_code>
               <endr_desc/>
               <job_desc/>
               <assign_type/>
               <match_type>7777</match_type>
               <route/>
               <approveid/>
               <departmentid/>
               <headid/>
               <oper_name/>
               <url1>http://LOGFILE4</url1>
               <url2/>
               <spool_receipt>LOGFILE4</spool_receipt>
               <spool_return/>
               <identified/>
               <taskid/>
               <approveuserid/>
               <approve_date/>
               <approve_time/>
               <code>01</code>
               <log_name>LOGFILE4</log_name>
            </ItcreativeObject>
            <ProcessObject xmlns="http://xmlns.oracle.com/bpm/bpmobject/Data/ProcessObject">
               <outcome1/>
               <outcome2/>
               <outcome3/>
               <outcome4/>
               <attribute1/>
               <attribute2/>
               <attribute3/>
               <attribute4/>
               <attribute5/>
               <attribute6/>
               <attribute7/>
               <attribute8/>
               <attribute9/>
               <attribute10/>
               <route/>
            </ProcessObject>
            <policyno/>
            <insured_name/>
            <operid/>
            <endr_code/>
            <endr_desc/>
            <clientid/>
            <team/>
            <endrcreate_date/>
            <comment1/>
            <comment2/>
            <spool_receipt/>
            <eff_date/>
            <opername/>
            <pdf_date/>
            <create_datetime/>
            <eff_datetime/>
         </payload>
         <taskDefinitionURI>default/EndrPosWFProject!1.0/EndrJobcode1RoundTask</taskDefinitionURI>
         <priority>3</priority>
         <identityContext>jazn.com</identityContext>
         <processInfo>
            <instanceId>750002</instanceId>
            <processId>EndrPosWFProcess</processId>
            <processName>EndrPosWFProcess</processName>
         </processInfo>
         <systemAttributes>
            <assignedDate>2016-02-26T14:51:06+07:00</assignedDate>
            <assigneeUsers>
               <id>fkafka</id>
               <displayName>Franz Kafka</displayName>
               <type>user</type>
            </assigneeUsers>
            <createdDate>2016-02-26T14:51:06+07:00</createdDate>
            <digitalSignatureRequired>false</digitalSignatureRequired>
            <fromUser>
               <type>user</type>
            </fromUser>
            <hasSubTasks>false</hasSubTasks>
            <inShortHistory>false</inShortHistory>
            <isGroup>false</isGroup>
            <numberOfTimesModified>9</numberOfTimesModified>
            <passwordRequiredOnUpdate>false</passwordRequiredOnUpdate>
            <pushbackSequence>INITIAL_ASSIGNEES;1</pushbackSequence>
            <secureNotifications>false</secureNotifications>
            <shortHistory>
               <task>
                  <state>ASSIGNED</state>
                  <updatedBy>
                     <id>workflowsystem</id>
                     <type>user</type>
                  </updatedBy>
                  <updatedDate>2016-02-26T14:51:06+07:00</updatedDate>
                  <version>1</version>
                  <versionReason>TASK_VERSION_REASON_INITIATED</versionReason>
               </task>
               <task>
                  <state>ASSIGNED</state>
                  <updatedBy>
                     <id>fkafka</id>
                     <type>user</type>
                  </updatedBy>
                  <updatedDate>2016-02-26T14:53:06+07:00</updatedDate>
                  <version>2</version>
                  <versionReason>TASK_VERSION_REASON_UPDATED</versionReason>
               </task>
            </shortHistory>
            <state>ASSIGNED</state>
            <systemActions>
               <action>UPDATE_COMMENT</action>
            </systemActions>
            <systemActions>
               <action>SKIP_CURRENT_ASSIGNMENT</action>
            </systemActions>
            <systemActions>
               <action>VIEW_SUB_TASKS</action>
            </systemActions>
            <systemActions>
               <action>SUSPEND</action>
            </systemActions>
            <systemActions>
               <action>UPDATE</action>
            </systemActions>
            <systemActions>
               <action>UPDATE_ATTACHMENT</action>
            </systemActions>
            <systemActions>
               <action>SUSPEND_TIMERS</action>
            </systemActions>
            <systemActions>
               <action>ESCALATE</action>
            </systemActions>
            <systemActions>
               <action>VIEW_PROCESS_HISTORY</action>
            </systemActions>
            <systemActions>
               <action>REASSIGN</action>
            </systemActions>
            <systemActions>
               <action>VIEW_TASK</action>
            </systemActions>
            <systemActions>
               <action>OVERRIDE_ROUTING_SLIP</action>
            </systemActions>
            <systemActions>
               <action>WITHDRAW</action>
            </systemActions>
            <systemActions>
               <action>VIEW_TASK_HISTORY</action>
            </systemActions>
            <taskId>28c1a7a4-16c3-45c9-9c71-50be0da55a0e</taskId>
            <taskNumber>201005</taskNumber>
            <updatedBy>
               <id>fkafka</id>
               <displayName>Franz Kafka</displayName>
               <type>user</type>
            </updatedBy>
            <updatedDate>2016-03-03T15:23:47+07:00</updatedDate>
            <version>9</version>
            <versionReason>TASK_VERSION_REASON_UPDATED</versionReason>
            <taskDefinitionId>default/EndrPosWFProject!1.0/EndrJobcode1RoundTask</taskDefinitionId>
            <taskDefinitionName>EndrJobcode1RoundTask</taskDefinitionName>
            <workflowPattern>Participant</workflowPattern>
            <isTestTask>false</isTestTask>
            <participantName>default.DefaultPerformer</participantName>
            <assignees>
               <id>fkafka</id>
               <displayName>Franz Kafka</displayName>
               <type>user</type>
            </assignees>
            <rootTaskId>28c1a7a4-16c3-45c9-9c71-50be0da55a0e</rootTaskId>
            <systemStringActions>PUSH_BACK,sharePayload</systemStringActions>
            <stage>Stage1</stage>
            <isTemplateTask>false</isTemplateTask>
            <taskNamespace>http://xmlns.oracle.com/EndrPosWF/EndrPosWFProject/EndrJobcode1RoundTask</taskNamespace>
            <actionDisplayName>Task Updated</actionDisplayName>
            <componentType>Workflow</componentType>
            <activityName>EndrJobcode1RoundTask</activityName>
            <activityId>ABSTRACT_ACTIVITY14808830821823</activityId>
            <thread>0</thread>
            <parentThread>-1</parentThread>
            <swimlaneRole>EndrJobcode1</swimlaneRole>
            <timersSuspended>false</timersSuspended>
         </systemAttributes>
         <systemMessageAttributes>
            <protectedTextAttribute1/>
            <protectedTextAttribute2/>
            <protectedTextAttribute3>121223</protectedTextAttribute3>
            <protectedTextAttribute4>nutt</protectedTextAttribute4>
            <protectedTextAttribute5>10</protectedTextAttribute5>
            <protectedTextAttribute6/>
            <protectedTextAttribute7>232323</protectedTextAttribute7>
            <protectedTextAttribute8>CENTER</protectedTextAttribute8>
            <protectedTextAttribute9>7777</protectedTextAttribute9>
            <flexfieldMappings>
               <attributeLabel>comment_key</attributeLabel>
               <flexfield>ProtectedTextAttribute2</flexfield>
               <description/>
            </flexfieldMappings>
            <flexfieldMappings>
               <attributeLabel>comment_lov</attributeLabel>
               <flexfield>ProtectedTextAttribute1</flexfield>
               <description/>
            </flexfieldMappings>
            <flexfieldMappings>
               <attributeLabel>match</attributeLabel>
               <flexfield>ProtectedTextAttribute9</flexfield>
               <description/>
            </flexfieldMappings>
            <flexfieldMappings>
               <attributeLabel>clientno</attributeLabel>
               <flexfield>ProtectedTextAttribute7</flexfield>
               <description/>
            </flexfieldMappings>
            <flexfieldMappings>
               <attributeLabel>team_group</attributeLabel>
               <flexfield>ProtectedTextAttribute8</flexfield>
               <description/>
            </flexfieldMappings>
            <flexfieldMappings>
               <attributeLabel>endr_desc</attributeLabel>
               <flexfield>ProtectedTextAttribute6</flexfield>
               <description/>
            </flexfieldMappings>
            <flexfieldMappings>
               <attributeLabel>insured_name</attributeLabel>
               <flexfield>ProtectedTextAttribute4</flexfield>
               <description/>
            </flexfieldMappings>
            <flexfieldMappings>
               <attributeLabel>policyno</attributeLabel>
               <flexfield>ProtectedTextAttribute3</flexfield>
               <description/>
            </flexfieldMappings>
            <flexfieldMappings>
               <attributeLabel>endr_code</attributeLabel>
               <flexfield>ProtectedTextAttribute5</flexfield>
               <description/>
            </flexfieldMappings>
         </systemMessageAttributes>
         <callback>
            <id>EndrPosWFProcess/HumanTasks.EndrJobcode1RoundTask.reference</id>
            <converstationId>urn:B04AF5C0DC5D11E58F0843A0EBF41DA3</converstationId>
         </callback>
         <category>ไม่พบเอกสาร</category>
         <isPublic>false</isPublic>
         <sca>
            <applicationName>default</applicationName>
            <componentName>EndrJobcode1RoundTask</componentName>
            <compositeDN>default/EndrPosWFProject!1.0*soa_8403c656-ccdc-4c1e-8a7b-e250ad6de79d</compositeDN>
            <compositeInstanceId>550006</compositeInstanceId>
            <compositeName>EndrPosWFProject</compositeName>
            <compositeVersion>1.0</compositeVersion>
            <ecId>11d1def534ea1be0:9ceed04:15317446564:-8000-000000000000a450</ecId>
            <parentComponentInstanceId>bpmn:750002</parentComponentInstanceId>
            <parentComponentInstanceRefId>750002-ABSTRACT_ACTIVITY14808830821823-EndrPosWFProcess_try.2-11</parentComponentInstanceRefId>
            <compositeCreatedTime>2016-02-26T14:50:51.796+07:00</compositeCreatedTime>
         </sca>
         <applicationContext>OracleBPMProcessRolesApp</applicationContext>
         <taskDefinitionId>default/EndrPosWFProject!1.0/EndrJobcode1RoundTask</taskDefinitionId>
         <correlationId>28c1a7a4-16c3-45c9-9c71-50be0da55a0e</correlationId>
         <mdsLabel>soa_31fbf488-68ba-42d0-8055-d4a859cf8cac</mdsLabel>
         <customAttributes>
            <customAttributeNumber1>0.0</customAttributeNumber1>
            <customAttributeNumber2>0.0</customAttributeNumber2>
         </customAttributes>
      </task>
   </env:Body>
</env:Envelope>


B. Java API

** An additional files see in Albin's Blog.


The scenario use in this section  is in SOA clustering.

UpdatePayload.java

  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
package com.workflow.client;


import java.util.*;

import oracle.bpel.services.workflow.IWorkflowConstants;
import oracle.bpel.services.workflow.client.*;
import oracle.bpel.services.workflow.query.ITaskQueryService;
import oracle.bpel.services.workflow.repos.*;
import oracle.bpel.services.workflow.task.ITaskService;
import oracle.bpel.services.workflow.task.model.Task;
import oracle.bpel.services.workflow.verification.IWorkflowContext;

import org.w3c.dom.Element;
import org.w3c.dom.NodeList;

import java.io.ByteArrayInputStream;
import java.io.InputStream;
import java.io.InputStreamReader;




public class UpdatePayload implements UpdatePayloadInterface {
    public UpdatePayload() {
        super();
    }
    
    public String updatePayload(String taskId,
                                     String adminUserId,
                                     String userId, 
                                     String passWord, 
                                     String serverUrl, 
                                     String domain, 
                                     String matchType)        {
            List displayColumns = new ArrayList();
            displayColumns.add("TASKNUMBER");
            displayColumns.add("TITLE");
            displayColumns.add("STATE");
            displayColumns.add("CREATOR");
            
            List optionalInfo = new ArrayList();      
            optionalInfo.add("Comments");
            optionalInfo.add("Payload");      
            
            String postUpdate = "FAIL";
            
        try {
                  
                  Map<IWorkflowServiceClientConstants.CONNECTION_PROPERTY, String> connProperties = new HashMap<IWorkflowServiceClientConstants.CONNECTION_PROPERTY, String>();              
                    connProperties.put(IWorkflowServiceClientConstants.CONNECTION_PROPERTY.CLIENT_TYPE,WorkflowServiceClientFactory.REMOTE_CLIENT);              
                    connProperties.put(IWorkflowServiceClientConstants.CONNECTION_PROPERTY.EJB_PROVIDER_URL,serverUrl);
                    connProperties.put(IWorkflowServiceClientConstants.CONNECTION_PROPERTY.EJB_INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory");       
                  
                  IWorkflowServiceClient wfSvcClient = WorkflowServiceClientFactory.getWorkflowServiceClient(connProperties, null, null);   
                  
                  // Admin can authenticate on behalf of another user
                  IWorkflowContext adminCtx = wfSvcClient.getTaskQueryService().authenticate(adminUserId, passWord.toCharArray(), domain);  
                  IWorkflowContext ctx = wfSvcClient.getTaskQueryService().authenticateOnBehalfOf(adminCtx, userId);
                  
                  ITaskQueryService querySvc = wfSvcClient.getTaskQueryService();
                  ITaskService taskSvc = wfSvcClient.getTaskService();       
                  
                  Predicate statePredicate =new Predicate(TableConstants.WFTASK_STATE_COLUMN,Predicate.OP_EQ,IWorkflowConstants.TASK_STATE_ASSIGNED);
                  Predicate compositenamePredicate = new Predicate(TableConstants.COMPONENT_COMPOSITE_NAME_COLUMN,Predicate.OP_EQ,"HumanWorkflow");
                  Predicate predicate = new Predicate(statePredicate, Predicate.AND, compositenamePredicate);
                
           
                  Task currentTask = querySvc.getTaskDetailsById(ctx,taskId);                                       
                  Element payload = currentTask.getPayloadAsElement();
                  if (payload.getNodeName() == "payload") {
                    postUpdate = "OK";
                    Map namespacemap = new HashMap();
                    namespacemap.put("ns0", "http://xmlns.oracle.com/bpel/workflow/task");
                    namespacemap.put("ns1", "http://xmlns.oracle.com/bpm/bpmobject/Data/ItcreativeObject");
                                                       
                    setPayloadValue(payload,"/ns0:task/ns0:payload/ns1:ItcreativeObject/ns1:match_type",namespacemap, matchType);
                  
                    currentTask.setPayloadAsElement(payload);
                    taskSvc.updateTask(ctx, currentTask);
                    // taskSvc.updateTaskOutcome(ctx, currentTask,"APPROVE");
                  }
                   
                 
              } catch (Exception e) {
                  e.printStackTrace();
              
              }
        
        return postUpdate;
    }
    
    public static void setPayloadValue(Element payload,String xpath,Map namespacemap,String value) {
            try {
                XPathUtils.setNodeValue(payload, namespacemap, xpath,value);
            } catch (Exception e) {
            }
        }
    public static void getPayloadValue(NodeList nodes) {
            try {
                XPathUtils.getNodeValue(nodes);
            } catch (Exception e) {
            }
        }
    
    public static String getDefaultCharEncoding(){
            byte [] bArray = {'w'};
            InputStream is = new ByteArrayInputStream(bArray);
            InputStreamReader reader = new InputStreamReader(is);
            String defaultCharacterEncoding = reader.getEncoding();
            return defaultCharacterEncoding;
        }
    
    public static void main(String[] args) {

       UpdatePayload payload = new UpdatePayload();
       payload.updatePayload("28c1a7a4-16c3-45c9-9c71-50be0da55a0e", "weblogic", "fkafka", "welcome1", "t3://192.168.13.100:7001,192.168.13.101:7001", "jazn.com", "Match") ;
    }
}

UpdatePayloadInterface.java

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
package com.workflow.client;

public interface UpdatePayloadInterface {
    public String updatePayload(String taskId, 
                                String adminUserId,
                                String userId, 
                                String passWord, 
                                String serverUrl, 
                                String domain, 
                                String matchType);
}

XPathUtils.java

 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
package com.workflow.client;

import java.util.Map;
import javax.xml.namespace.NamespaceContext;
import javax.xml.xpath.*;
import oracle.bpel.services.common.util.XMLUtil;
import oracle.fabric.common.xml.xpath.SimpleNamespaceContext;
import org.w3c.dom.*;

public class XPathUtils {
    public XPathUtils() {
        super();
    }
    
    public static void setNodeValue(Element payload, Map namespacemap, String xpath,
                             String value) throws Exception {
               Node node = null;
               NodeList nodes = null;
               NodeList children =null;
               int length = 0;
               try {
                   nodes = XPathUtils.selectNodes(XMLUtil.getDocumentElement(payload), xpath, namespacemap);
               } catch (Exception e) {
                   e.printStackTrace();
                   throw e;
               }
               node = nodes.item(0);          
               if(nodes.getLength()>0){
               children = node.getChildNodes();
               length = children.getLength();          
               if (length == 1) {
                   Node textNode = children.item(0);
                   String oldValue = textNode.getNodeValue();
                   
                   value=value==null?"":value; System.out.println("New value = "+ value);
                   oldValue=oldValue==null?"":oldValue;    System.out.println("Old value = " + oldValue);          
                   if (!oldValue.equals(value)) {
                       textNode.setNodeValue(value);
                   }
                 System.out.println("After = " + textNode.getNodeValue());
               } else if (length == 0 && value != null && !value.equals("")) {
                   Node valueNode = node.getOwnerDocument().createTextNode(value);
                   node.appendChild(valueNode);
                   System.out.println("After = " + valueNode.getNodeValue());
                   }
                   
               }
               
           }
    
    public static NodeList selectNodes(Element pElement, String xpathExpression, Map prefixNamespaceMapping)  throws Exception {
              XPath xPath = createXPath(prefixNamespaceMapping);
              Document doc = null;
              if(pElement instanceof Document)
                  doc = (Document)pElement;
              else
                  doc = pElement != null ? pElement.getOwnerDocument() : null;
              NodeList value = (NodeList)xPath.evaluate(xpathExpression, doc, XPathConstants.NODESET);
              return value;
          }
    
    public static  String getNodeValue(NodeList nodes) {
             Node node = nodes.item(0);
             String value = null;
             if(nodes.getLength()>0){
             NodeList children = node.getChildNodes();
             int length = children.getLength();
             if (length == 1) {
                 Node textNode = children.item(0);
                 value = textNode.getNodeValue();
             }
             }
             return value;
            
         }  
    
    private static XPath createXPath(Map namespaceMapping) {
              XPath xpath = null;
              NamespaceContext nc = null;
              if(namespaceMapping != null)
              {
                  if(namespaceMapping.containsKey(""))
                      namespaceMapping.remove("");
                  nc = new SimpleNamespaceContext(namespaceMapping);
              }
              xpath = getXPath(nc);
              return xpath;
          }
    
    public static XPath getXPath(NamespaceContext nsContext)     {
               XPath xpath = XPathFactory.newInstance().newXPath();
               if(nsContext != null)
                   xpath.setNamespaceContext(nsContext);
               return xpath;
           }   
}