/
SalesforceEndpointConfig.java
873 lines (723 loc) · 24.6 KB
/
SalesforceEndpointConfig.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
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
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
/**
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.camel.component.salesforce;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.apache.camel.RuntimeCamelException;
import org.apache.camel.component.salesforce.api.dto.analytics.reports.ReportMetadata;
import org.apache.camel.component.salesforce.api.dto.approval.ApprovalRequest;
import org.apache.camel.component.salesforce.api.dto.approval.ApprovalRequest.Action;
import org.apache.camel.component.salesforce.api.dto.bulk.ContentType;
import org.apache.camel.component.salesforce.internal.PayloadFormat;
import org.apache.camel.component.salesforce.internal.dto.NotifyForFieldsEnum;
import org.apache.camel.component.salesforce.internal.dto.NotifyForOperationsEnum;
import org.apache.camel.spi.UriParam;
import org.apache.camel.spi.UriParams;
/**
* Salesforce Endpoint configuration.
*/
@UriParams
public class SalesforceEndpointConfig implements Cloneable {
// default API version
public static final String DEFAULT_VERSION = "34.0";
// general parameter
public static final String API_VERSION = "apiVersion";
// parameters for Rest API
public static final String FORMAT = "format";
public static final String RAW_PAYLOAD = "rawPayload";
public static final String SOBJECT_NAME = "sObjectName";
public static final String SOBJECT_ID = "sObjectId";
public static final String SOBJECT_FIELDS = "sObjectFields";
public static final String SOBJECT_EXT_ID_NAME = "sObjectIdName";
public static final String SOBJECT_EXT_ID_VALUE = "sObjectIdValue";
public static final String SOBJECT_BLOB_FIELD_NAME = "sObjectBlobFieldName";
public static final String SOBJECT_CLASS = "sObjectClass";
public static final String SOBJECT_QUERY = "sObjectQuery";
public static final String SOBJECT_SEARCH = "sObjectSearch";
public static final String APEX_METHOD = "apexMethod";
public static final String APEX_URL = "apexUrl";
public static final String LIMIT = "limit";
// prefix for parameters in headers
public static final String APEX_QUERY_PARAM_PREFIX = "apexQueryParam.";
// parameters for Bulk API
public static final String CONTENT_TYPE = "contentType";
public static final String JOB_ID = "jobId";
public static final String BATCH_ID = "batchId";
public static final String RESULT_ID = "resultId";
// parameters for Analytics API
public static final String REPORT_ID = "reportId";
public static final String INCLUDE_DETAILS = "includeDetails";
public static final String REPORT_METADATA = "reportMetadata";
public static final String INSTANCE_ID = "instanceId";
// parameters for Streaming API
public static final String DEFAULT_REPLAY_ID = "defaultReplayId";
public static final String INITIAL_REPLAY_ID_MAP = "initialReplayIdMap";
// parameters for Approval API
public static final String APPROVAL = "approval";
// default maximum authentication retries on failed authentication or expired session
public static final int DEFAULT_MAX_AUTHENTICATION_RETRIES = 4;
// default increment and limit for Streaming connection restart attempts
public static final long DEFAULT_BACKOFF_INCREMENT = 1000L;
public static final long DEFAULT_MAX_BACKOFF = 30000L;
public static final String NOT_FOUND_BEHAVIOUR = "notFoundBehaviour";
public static final String SERIALIZE_NULLS = "serializeNulls";
// general properties
@UriParam
private String apiVersion = DEFAULT_VERSION;
// Rest API properties
@UriParam
private PayloadFormat format = PayloadFormat.JSON;
@UriParam
private boolean rawPayload;
@UriParam(displayName = "SObject Name")
private String sObjectName;
@UriParam(displayName = "SObject Id")
private String sObjectId;
@UriParam(displayName = "SObject Fields")
private String sObjectFields;
@UriParam(displayName = "SObject Id Name")
private String sObjectIdName;
@UriParam(displayName = "SObject Id Value")
private String sObjectIdValue;
@UriParam(displayName = "SObject Blob Field Name")
private String sObjectBlobFieldName;
@UriParam(displayName = "SObject Class")
private String sObjectClass;
@UriParam(displayName = "SObject Query")
private String sObjectQuery;
@UriParam(displayName = "SObject Search")
private String sObjectSearch;
@UriParam(displayName = "Serialize NULL values")
private boolean serializeNulls;
@UriParam
private String apexMethod;
@UriParam
private String apexUrl;
@UriParam
private Map<String, Object> apexQueryParams;
// Bulk API properties
@UriParam
private ContentType contentType;
@UriParam
private String jobId;
@UriParam
private String batchId;
@UriParam
private String resultId;
// Streaming API properties
@UriParam
private boolean updateTopic;
@UriParam
private NotifyForFieldsEnum notifyForFields;
@UriParam
private NotifyForOperationsEnum notifyForOperations;
@UriParam
private Boolean notifyForOperationCreate;
@UriParam
private Boolean notifyForOperationUpdate;
@UriParam
private Boolean notifyForOperationDelete;
@UriParam
private Boolean notifyForOperationUndelete;
// Analytics API properties
@UriParam
private String reportId;
@UriParam
private Boolean includeDetails;
@UriParam
private ReportMetadata reportMetadata;
@UriParam
private String instanceId;
// Streaming API properties
@UriParam
private Long defaultReplayId;
@UriParam
private Map<String, Long> initialReplayIdMap;
// Approval API properties
private ApprovalRequest approval;
// Salesforce Jetty9 HttpClient, set using reference
@UriParam
private SalesforceHttpClient httpClient;
// To allow custom ObjectMapper (for registering extra datatype modules)
@UriParam
private ObjectMapper objectMapper;
// Streaming connection restart attempt backoff interval increment
@UriParam
private long backoffIncrement = DEFAULT_BACKOFF_INCREMENT;
// Streaming connection restart attempt maximum backoff interval
@UriParam
private long maxBackoff = DEFAULT_MAX_BACKOFF;
@UriParam
private Integer limit;
@UriParam
private NotFoundBehaviour notFoundBehaviour = NotFoundBehaviour.EXCEPTION;
public SalesforceEndpointConfig copy() {
try {
final SalesforceEndpointConfig copy = (SalesforceEndpointConfig) super.clone();
// nothing to deep copy, getApexQueryParams() is readonly, so no need to deep copy
return copy;
} catch (CloneNotSupportedException ex) {
throw new RuntimeCamelException(ex);
}
}
public PayloadFormat getFormat() {
return format;
}
/**
* Payload format to use for Salesforce API calls, either JSON or XML, defaults to JSON
*/
public void setFormat(PayloadFormat format) {
this.format = format;
}
public boolean getRawPayload() {
return rawPayload;
}
/**
* Use raw payload {@link String} for request and response (either JSON or XML depending on {@code format}),
* instead of DTOs, false by default
*/
public void setRawPayload(boolean rawPayload) {
this.rawPayload = rawPayload;
}
public String getApiVersion() {
return apiVersion;
}
/**
* Salesforce API version, defaults to SalesforceEndpointConfig.DEFAULT_VERSION
*/
public void setApiVersion(String apiVersion) {
this.apiVersion = apiVersion;
}
public String getSObjectName() {
return sObjectName;
}
/**
* SObject name if required or supported by API
*/
public void setSObjectName(String sObjectName) {
this.sObjectName = sObjectName;
}
public String getSObjectId() {
return sObjectId;
}
/**
* SObject ID if required by API
*/
public void setSObjectId(String sObjectId) {
this.sObjectId = sObjectId;
}
public String getSObjectFields() {
return sObjectFields;
}
/**
* SObject fields to retrieve
*/
public void setSObjectFields(String sObjectFields) {
this.sObjectFields = sObjectFields;
}
public String getSObjectIdName() {
return sObjectIdName;
}
/**
* SObject external ID field name
*/
public void setSObjectIdName(String sObjectIdName) {
this.sObjectIdName = sObjectIdName;
}
public String getSObjectIdValue() {
return sObjectIdValue;
}
/**
* SObject external ID field value
*/
public void setSObjectIdValue(String sObjectIdValue) {
this.sObjectIdValue = sObjectIdValue;
}
public String getSObjectBlobFieldName() {
return sObjectBlobFieldName;
}
/**
* SObject blob field name
*/
public void setSObjectBlobFieldName(String sObjectBlobFieldName) {
this.sObjectBlobFieldName = sObjectBlobFieldName;
}
public String getSObjectClass() {
return sObjectClass;
}
/**
* Fully qualified SObject class name, usually generated using camel-salesforce-maven-plugin
*/
public void setSObjectClass(String sObjectClass) {
this.sObjectClass = sObjectClass;
}
public String getSObjectQuery() {
return sObjectQuery;
}
/**
* Salesforce SOQL query string
*/
public void setSObjectQuery(String sObjectQuery) {
this.sObjectQuery = sObjectQuery;
}
public String getSObjectSearch() {
return sObjectSearch;
}
/**
* Salesforce SOSL search string
*/
public void setSObjectSearch(String sObjectSearch) {
this.sObjectSearch = sObjectSearch;
}
/**
* Should the NULL values of given DTO be serialized with
* empty (NULL) values. This affects only JSON data format.
*/
public void setSerializeNulls(boolean serializeNulls) {
this.serializeNulls = serializeNulls;
}
public boolean isSerializeNulls() {
return serializeNulls;
}
public String getApexMethod() {
return apexMethod;
}
/**
* APEX method name
*/
public void setApexMethod(String apexMethod) {
this.apexMethod = apexMethod;
}
public String getApexUrl() {
return apexUrl;
}
/**
* APEX method URL
*/
public void setApexUrl(String apexUrl) {
this.apexUrl = apexUrl;
}
public Map<String, Object> getApexQueryParams() {
final Map<String, Object> value = Optional.ofNullable(apexQueryParams).orElse(Collections.emptyMap());
return Collections.unmodifiableMap(value);
}
/**
* Query params for APEX method
*/
public void setApexQueryParams(Map<String, Object> apexQueryParams) {
this.apexQueryParams = apexQueryParams;
}
public ApprovalRequest getApproval() {
return approval;
}
/**
* The approval request for Approval API.
*
* @param approval
*/
public void setApproval(final ApprovalRequest approval) {
this.approval = approval;
}
public ContentType getContentType() {
return contentType;
}
/**
* Bulk API content type, one of XML, CSV, ZIP_XML, ZIP_CSV
*/
public void setContentType(ContentType contentType) {
this.contentType = contentType;
}
public String getJobId() {
return jobId;
}
/**
* Bulk API Job ID
*/
public void setJobId(String jobId) {
this.jobId = jobId;
}
public String getBatchId() {
return batchId;
}
/**
* Bulk API Batch ID
*/
public void setBatchId(String batchId) {
this.batchId = batchId;
}
public String getResultId() {
return resultId;
}
/**
* Bulk API Result ID
*/
public void setResultId(String resultId) {
this.resultId = resultId;
}
public boolean isUpdateTopic() {
return updateTopic;
}
/**
* Whether to update an existing Push Topic when using the Streaming API, defaults to false
*/
public void setUpdateTopic(boolean updateTopic) {
this.updateTopic = updateTopic;
}
public NotifyForFieldsEnum getNotifyForFields() {
return notifyForFields;
}
/**
* Notify for fields, options are ALL, REFERENCED, SELECT, WHERE
*/
public void setNotifyForFields(NotifyForFieldsEnum notifyForFields) {
this.notifyForFields = notifyForFields;
}
public NotifyForOperationsEnum getNotifyForOperations() {
return notifyForOperations;
}
/**
* Notify for operations, options are ALL, CREATE, EXTENDED, UPDATE (API version < 29.0)
*/
public void setNotifyForOperations(NotifyForOperationsEnum notifyForOperations) {
this.notifyForOperations = notifyForOperations;
}
public Boolean getNotifyForOperationCreate() {
return notifyForOperationCreate;
}
/**
* Notify for create operation, defaults to false (API version >= 29.0)
*/
public void setNotifyForOperationCreate(Boolean notifyForOperationCreate) {
this.notifyForOperationCreate = notifyForOperationCreate;
}
public Boolean getNotifyForOperationUpdate() {
return notifyForOperationUpdate;
}
/**
* Notify for update operation, defaults to false (API version >= 29.0)
*/
public void setNotifyForOperationUpdate(Boolean notifyForOperationUpdate) {
this.notifyForOperationUpdate = notifyForOperationUpdate;
}
public Boolean getNotifyForOperationDelete() {
return notifyForOperationDelete;
}
/**
* Notify for delete operation, defaults to false (API version >= 29.0)
*/
public void setNotifyForOperationDelete(Boolean notifyForOperationDelete) {
this.notifyForOperationDelete = notifyForOperationDelete;
}
public Boolean getNotifyForOperationUndelete() {
return notifyForOperationUndelete;
}
/**
* Notify for un-delete operation, defaults to false (API version >= 29.0)
*/
public void setNotifyForOperationUndelete(Boolean notifyForOperationUndelete) {
this.notifyForOperationUndelete = notifyForOperationUndelete;
}
public String getReportId() {
return reportId;
}
/**
* Salesforce1 Analytics report Id
*/
public void setReportId(String reportId) {
this.reportId = reportId;
}
public Boolean getIncludeDetails() {
return includeDetails;
}
/**
* Include details in Salesforce1 Analytics report, defaults to false.
*/
public void setIncludeDetails(Boolean includeDetails) {
this.includeDetails = includeDetails;
}
public ReportMetadata getReportMetadata() {
return reportMetadata;
}
/**
* Salesforce1 Analytics report metadata for filtering
*/
public void setReportMetadata(ReportMetadata reportMetadata) {
this.reportMetadata = reportMetadata;
}
public String getInstanceId() {
return instanceId;
}
/**
* Salesforce1 Analytics report execution instance ID
*/
public void setInstanceId(String instanceId) {
this.instanceId = instanceId;
}
/**
* Custom Jetty Http Client to use to connect to Salesforce.
*/
public void setHttpClient(SalesforceHttpClient httpClient) {
this.httpClient = httpClient;
}
public SalesforceHttpClient getHttpClient() {
return httpClient;
}
public ObjectMapper getObjectMapper() {
return objectMapper;
}
public long getBackoffIncrement() {
return backoffIncrement;
}
/**
* Backoff interval increment for Streaming connection restart attempts for failures beyond CometD auto-reconnect.
*/
public void setBackoffIncrement(long backoffIncrement) {
this.backoffIncrement = backoffIncrement;
}
public long getMaxBackoff() {
return maxBackoff;
}
/**
* Maximum backoff interval for Streaming connection restart attempts for failures beyond CometD auto-reconnect.
*/
public void setMaxBackoff(long maxBackoff) {
this.maxBackoff = maxBackoff;
}
/**
* Custom Jackson ObjectMapper to use when serializing/deserializing Salesforce objects.
*/
public void setObjectMapper(ObjectMapper objectMapper) {
this.objectMapper = objectMapper;
}
public Map<String, Object> toValueMap() {
final Map<String, Object> valueMap = new HashMap<>();
valueMap.put(FORMAT, format.toString().toLowerCase());
valueMap.put(API_VERSION, apiVersion);
valueMap.put(SOBJECT_NAME, sObjectName);
valueMap.put(SOBJECT_ID, sObjectId);
valueMap.put(SOBJECT_FIELDS, sObjectFields);
valueMap.put(SOBJECT_EXT_ID_NAME, sObjectIdName);
valueMap.put(SOBJECT_BLOB_FIELD_NAME, sObjectBlobFieldName);
valueMap.put(SOBJECT_EXT_ID_VALUE, sObjectIdValue);
valueMap.put(SOBJECT_CLASS, sObjectClass);
valueMap.put(SOBJECT_QUERY, sObjectQuery);
valueMap.put(SOBJECT_SEARCH, sObjectSearch);
valueMap.put(SERIALIZE_NULLS, serializeNulls);
valueMap.put(APEX_METHOD, apexMethod);
valueMap.put(APEX_URL, apexUrl);
valueMap.put(LIMIT, limit);
valueMap.put(APPROVAL, approval);
// apexQueryParams are handled explicitly in AbstractRestProcessor
// add bulk API properties
if (contentType != null) {
valueMap.put(CONTENT_TYPE, contentType.value());
}
valueMap.put(JOB_ID, jobId);
valueMap.put(BATCH_ID, batchId);
valueMap.put(RESULT_ID, resultId);
// add analytics API properties
valueMap.put(REPORT_ID, reportId);
valueMap.put(INCLUDE_DETAILS, includeDetails);
valueMap.put(REPORT_METADATA, reportMetadata);
valueMap.put(INSTANCE_ID, instanceId);
// add streaming API properties
valueMap.put(DEFAULT_REPLAY_ID, defaultReplayId);
valueMap.put(INITIAL_REPLAY_ID_MAP, initialReplayIdMap);
valueMap.put(NOT_FOUND_BEHAVIOUR, notFoundBehaviour);
return Collections.unmodifiableMap(valueMap);
}
public Long getDefaultReplayId() {
return defaultReplayId;
}
/**
* Default replayId setting if no value is found in {@link #initialReplayIdMap}
*
* @param defaultReplayId
*/
public void setDefaultReplayId(Long defaultReplayId) {
this.defaultReplayId = defaultReplayId;
}
public Map<String, Long> getInitialReplayIdMap() {
return Optional.ofNullable(initialReplayIdMap).orElse(Collections.emptyMap());
}
/**
* Replay IDs to start from per channel name.
*/
public void setInitialReplayIdMap(Map<String, Long> initialReplayIdMap) {
this.initialReplayIdMap = initialReplayIdMap;
}
public Integer getLimit() {
return limit;
}
/**
* Limit on number of returned records. Applicable to some of the API, check the Salesforce documentation.
*
* @param limit
*/
public void setLimit(final Integer limit) {
this.limit = limit;
}
public Action getApprovalActionType() {
if (approval == null) {
return null;
}
return approval.getActionType();
}
public String getApprovalComments() {
if (approval == null) {
return null;
}
return approval.getComments();
}
public String getApprovalContextActorId() {
if (approval == null) {
return null;
}
return approval.getContextActorId();
}
public String getApprovalContextId() {
if (approval == null) {
return null;
}
return approval.getContextId();
}
public List<String> getApprovalNextApproverIds() {
if (approval == null) {
return null;
}
return approval.getNextApproverIds();
}
public String getApprovalProcessDefinitionNameOrId() {
if (approval == null) {
return null;
}
return approval.getProcessDefinitionNameOrId();
}
public boolean isApprovalSkipEntryCriteria() {
if (approval == null) {
return false;
}
return approval.isSkipEntryCriteria();
}
/**
* Represents the kind of action to take: Submit, Approve, or Reject.
*
* @param actionType
*/
public void setApprovalActionType(final Action actionType) {
if (approval == null) {
approval = new ApprovalRequest();
}
approval.setActionType(actionType);
}
/**
* The comment to add to the history step associated with this request.
*
* @param comments
*/
public void setApprovalComments(final String comments) {
if (approval == null) {
approval = new ApprovalRequest();
}
approval.setComments(comments);
}
/**
* The ID of the submitter who’s requesting the approval record.
*
* @param contextActorId
*/
public void setApprovalContextActorId(final String contextActorId) {
if (approval == null) {
approval = new ApprovalRequest();
}
approval.setContextActorId(contextActorId);
}
/**
* The ID of the item that is being acted upon.
*
* @param contextId
*/
public void setApprovalContextId(final String contextId) {
if (approval == null) {
approval = new ApprovalRequest();
}
approval.setContextId(contextId);
}
/**
* If the process requires specification of the next approval, the ID of the user to be assigned the next request.
*
* @param nextApproverIds
*/
public void setApprovalNextApproverIds(final List<String> nextApproverIds) {
if (approval == null) {
approval = new ApprovalRequest();
}
approval.setNextApproverIds(nextApproverIds);
}
/**
* If the process requires specification of the next approval, the ID of the user to be assigned the next request.
*
* @param nextApproverIds
*/
public void setApprovalNextApproverIds(String nextApproverId) {
if (approval == null) {
approval = new ApprovalRequest();
}
approval.setNextApproverIds(nextApproverId);
}
/**
* The developer name or ID of the process definition.
*
* @param processDefinitionNameOrId
*/
public void setApprovalProcessDefinitionNameOrId(final String processDefinitionNameOrId) {
if (approval == null) {
approval = new ApprovalRequest();
}
approval.setProcessDefinitionNameOrId(processDefinitionNameOrId);
}
/**
* Determines whether to evaluate the entry criteria for the process (true) or not (false) if the process definition
* name or ID isn’t null. If the process definition name or ID isn’t specified, this argument is ignored, and
* standard evaluation is followed based on process order. By default, the entry criteria isn’t skipped if it’s not
* set by this request.
*
* @param skipEntryCriteria
*/
public void setApprovalSkipEntryCriteria(final boolean skipEntryCriteria) {
if (approval == null) {
approval = new ApprovalRequest();
}
approval.setSkipEntryCriteria(skipEntryCriteria);
}
public NotFoundBehaviour getNotFoundBehaviour() {
return notFoundBehaviour;
}
/**
* Sets the behaviour of 404 not found status received from Salesforce API.
* Should the body be set to NULL {@link NotFoundBehaviour#NULL} or should a
* exception be signaled on the exchange {@link NotFoundBehaviour#EXCEPTION}
* - the default.
*/
public void setNotFoundBehaviour(final NotFoundBehaviour notFoundBehaviour) {
this.notFoundBehaviour = notFoundBehaviour;
}
}