Package com.avoka.tm.svc
Class TxnUpdater
java.lang.Object
com.avoka.tm.svc.TxnUpdater
Provides a transaction value object updater class.
Examples
Please find the transaction updater examples below.
Set Transaction Delivery Ready
This Groovy example shows how to update a transaction setting its delivery status to 'Ready'.
import com.avoka.tm.svc.* import com.avoka.tm.vo.* new TxnUpdater(txn) .setDeliveryStatus(Txn.DELIVERY_READY) .update()
Set Transaction Abandoned
This Groovy example shows how to update a form status to 'Abandoned'. Note this update() method returns an updated Txn value object. Please note Txn objects are immutable, and you need to refetch them after performing anu updates.
import com.avoka.tm.svc.* import com.avoka.tm.vo.* new TxnUpdater(txn) .setFormStatus(Txn.FORM_ABANDONED) .update()
Set Transaction to be returned with file attachments after the update
This Groovy example shows how to update transaction and then get it with the attachments list loaded in the object.
import com.avoka.tm.svc.* import com.avoka.tm.vo.* Txn txn = new TxnUpdater(txn) .setFormStatus(Txn.FORM_ABANDONED) .withFileAttachList() .update() txn.fileAttachList
This Groovy example shows how to perform an immediate full purge on a transaction.
import com.avoka.tm.svc.* import com.avoka.tm.vo.* Txn txn2 = new TxnUpdater(txn) .setAbandonMode(TxnUpdater.AbandonMode.IMMEDIATE_ADMIN_FULL_PURGE) .update();
- Since:
- 5.0.0
-
Nested Class Summary
-
Constructor Summary
ConstructorDescriptionCreate a transaction updater.TxnUpdater
(Txn txn) Create a transaction updater for the given txn value object. -
Method Summary
Modifier and TypeMethodDescriptionaddComment
(Comment comment) Add comment to the transaction.addFileAttach
(FileAttach fileAttach) Add the given file attachment to the transaction.addFormDataExtract
(String name, String value) Add form data (data extract) to the transaction.addGroupName
(String groupName) Add group name parameter.addGroupNames
(Collection<String> groupNames) Add group names parameter.addMilestone
(String milestone) Add the transaction milestone event (maximum 100 characters).addSegment
(String name, String value) Add the transaction segment event name and valueaddServiceCallLog
(String svcName, String info, String url) Add a service call log to the transaction.removeFileAttach
(FileAttach fileAttach) Remove the given file attachment from the transaction.removeFormDataExtract
(String name) Remove form data (data extract) from the transaction.removeGroupNames
(Collection<String> removeGroupNames) Remove group names parameter.removeProperty
(String name) Specify the property to remove from the transaction.Set the updater to return null instead of a transaction object.setAbandonMode
(TxnUpdater.AbandonMode abandonMode) Perform an abandonment on the transaction to be purgedsetAttachmentsStatus
(String attachmentsStatus) The attachments status value to set on the transaction.setBillableFlag
(boolean billableFlag) Set the billable flag of the submission.setDeliveryChannel
(String deliveryChannel) The organization delivery channel to associate with the transaction.setDeliveryStatus
(String deliveryStatus) The delivery status value to set on the transaction.setExternalUserId
(String externalUserId) Set external user id to the transaction.setFormStatus
(String formStatus) Set the form status value to set on the transaction [ Txn.FORM_SAVED | Txn.FORM_COMPLETED | Txn.FORM_ABANDONED ].setFormVersionNumber
(String formVersionNumber) Set the form version number for the transaction.setFormXml
(String formXml) The form XML data value to set on the transaction.setGroupName
(String groupName) Set group name parameter.setGroupNames
(Collection<String> groupNames) Set group names parameter.Set the transaction id (PK) to identify the transaction to update.setLinkedTxnId
(Number linkedTxnId) Set the previous transaction id to update previous submission and linkedTxnId.setPaymentStatus
(String paymentStatus) The payment status value to set on the transaction.setProcessStatus
(String processStatus) Set the Process Status.setProperty
(String name, String value) Specify the property name and value to add or update on the transaction.setReceiptNumber
(String receiptNumber) Set the Receipt Number.Set the transaction PDF receipt generation status to be ready.setSaveChallengeAnswer
(String saveChallengeAnswer) Set save challenge answer to the transaction.setSaveChallengeLocked
(Boolean saveChallengeLocked) Set save challenge locked to the transaction.setSaveChallengeTimeout
(Date saveChallengeTimeout) Set save challenge timeout to the transaction.The space value to set on the transaction.setTaskAllowClaim
(boolean taskAllowClaim) Set the Task Allow Claim FlagsetTimeTaskExpiry
(Date timeTaskExpiry) Set the Task Expiry TimesetTimeTxnExpiry
(Date timeTxnExpiry) Set the Txn Expiry DateThe user value to set on the transaction.setUserSaved
(boolean userSaved) Set the user saved to the transaction.update()
Update the identified transaction with the specified parameters, and return a new immutable Txn value object.withAll()
Set the updater to return the transaction with all the associated attachments map, form data map, form XML, group names, property map, receipt PDF data, etc.Set the updater to return the transaction with the comments.Set the updater to return the transaction with the associated transaction delivery functions.Set the updater to return the transaction with the associated file attachment list.Set the updater to return the transaction with the associated form data map information.Set the updater to return the transaction with the associated form XML information.Set the updater to return the transaction with the associated group names information.withNone()
Set the updater to return the transaction with none of the associated attachments map, form data map, form XML, group names, property map, receipt PDF data, etc.Set the updater to return the transaction with the associated property map information.Set the updater to return the transaction with the associated receipt PDF data.
-
Constructor Details
-
TxnUpdater
Create a transaction updater. -
TxnUpdater
@FluentSecurityPermission(permissions={"submission-view","submission-edit"}) public TxnUpdater(Txn txn) Create a transaction updater for the given txn value object.- Parameters:
txn
- the transaction value object to update (required)
-
-
Method Details
-
setId
Set the transaction id (PK) to identify the transaction to update.- Parameters:
id
- the transaction id of the transaction to update (required)- Returns:
- the transaction updater
-
setLinkedTxnId
Set the previous transaction id to update previous submission and linkedTxnId.- Parameters:
linkedTxnId
- the transaction linkedTxnId of the transaction to update (required)- Returns:
- the transaction updater
- Since:
- 21.11
-
setFormStatus
Set the form status value to set on the transaction [ Txn.FORM_SAVED | Txn.FORM_COMPLETED | Txn.FORM_ABANDONED ]. Setting form status values other than those specified will either be ignored or result in an IllegalArgumentException.- Parameters:
formStatus
- the form status value to set on the transaction- Returns:
- the transaction updater
-
setAttachmentsStatus
The attachments status value to set on the transaction.- Parameters:
attachmentsStatus
- attachments status value on the transaction- Returns:
- the transaction updater
-
setBillableFlag
Set the billable flag of the submission.- Parameters:
billableFlag
- the billable flag value to be updated- Returns:
- the transaction updater
- Since:
- 22.10
-
setPaymentStatus
The payment status value to set on the transaction.- Parameters:
paymentStatus
- the payment status value to set on the transaction- Returns:
- the transaction updater
-
setSpace
The space value to set on the transaction.- Parameters:
space
- the space value to set on the transaction- Returns:
- the transaction updater
- Since:
- 5.0.3
-
setUser
The user value to set on the transaction.- Parameters:
user
- the user value to set on the transaction- Returns:
- the transaction updater
- Since:
- 5.0.3
-
setReceiptStatusReady
Set the transaction PDF receipt generation status to be ready.- Returns:
- the transaction updater
-
setDeliveryStatus
The delivery status value to set on the transaction.- Parameters:
deliveryStatus
- the delivery status value to set on the transaction- Returns:
- the transaction updater
-
setDeliveryChannel
@FluentSecurityPermission(permissions="delivery-details-edit") public TxnUpdater setDeliveryChannel(String deliveryChannel) The organization delivery channel to associate with the transaction.- Parameters:
deliveryChannel
- the name of the organization delivery channel (required)- Returns:
- the transaction updater
-
setProperty
@FluentSecurityPermission(permissions="submission-xml-data-edit") public TxnUpdater setProperty(String name, String value) Specify the property name and value to add or update on the transaction.- Parameters:
name
- the property name (required)value
- the property value (required)- Returns:
- the transaction updater
-
removeProperty
@FluentSecurityPermission(permissions="submission-xml-data-edit") public TxnUpdater removeProperty(String name) Specify the property to remove from the transaction.- Parameters:
name
- the property name to remove (required)- Returns:
- the transaction updater
-
setFormXml
@FluentSecurityPermission(permissions="submission-xml-data-edit") public TxnUpdater setFormXml(String formXml) The form XML data value to set on the transaction.- Parameters:
formXml
- the form XML data value to set on the transaction (required)- Returns:
- the transaction updater
-
addFileAttach
@FluentSecurityPermission(permissions="submission-xml-data-edit") public TxnUpdater addFileAttach(FileAttach fileAttach) Add the given file attachment to the transaction.- Parameters:
fileAttach
- the file attachment to add to the transaction (required)- Returns:
- the transaction updater
-
removeFileAttach
@FluentSecurityPermission(permissions="submission-xml-data-edit") public TxnUpdater removeFileAttach(FileAttach fileAttach) Remove the given file attachment from the transaction.- Parameters:
fileAttach
- the file attachment to remove from the transaction (required)- Returns:
- the transaction updater
-
addServiceCallLog
Add a service call log to the transaction.- Parameters:
svcName
- the service definition called (required)info
- the service call information (optional)url
- the service URL called (optional)- Returns:
- the transaction updater
-
setExternalUserId
Set external user id to the transaction.- Parameters:
externalUserId
- external user id- Returns:
- the transaction updater
-
addMilestone
Add the transaction milestone event (maximum 100 characters).- Parameters:
milestone
- the transaction milestone event to add (maximum 100 characters).- Returns:
- the transaction updater
- Since:
- 17.10.0
-
addSegment
Add the transaction segment event name and value- Parameters:
name
- the segment String key valuevalue
- the segment String value- Returns:
- the transaction updater
- Since:
- 18.05.0
-
addFormDataExtract
@FluentSecurityPermission(permissions="submission-xml-data-edit") public TxnUpdater addFormDataExtract(String name, String value) Add form data (data extract) to the transaction.- Parameters:
name
- form data (extract) namevalue
- form data (extract) value- Returns:
- the transaction updater
-
removeFormDataExtract
@FluentSecurityPermission(permissions="submission-xml-data-edit") public TxnUpdater removeFormDataExtract(String name) Remove form data (data extract) from the transaction.- Parameters:
name
- form data (extract) name- Returns:
- the transaction updater
-
setGroupName
Set group name parameter.- Parameters:
groupName
- group name- Returns:
- the transaction updater Note: Using method will override the existing ones and the add specified group.
- Since:
- 17.10.4
-
addGroupName
Add group name parameter.- Parameters:
groupName
- group name- Returns:
- the transaction updater Note: Using method will add group to the existing ones.
- Since:
- 23.10.0
-
setGroupNames
Set group names parameter.- Parameters:
groupNames
- group names- Returns:
- the transaction updater Note: Using this method will override the existing ones and the add specified groups.
- Since:
- 17.10.4
-
addGroupNames
Add group names parameter.- Parameters:
groupNames
- group names- Returns:
- the transaction updater Note: Using this method will add specified groups to the existing ones.
- Since:
- 23.10.0
-
removeGroupNames
Remove group names parameter.- Parameters:
removeGroupNames
- group names- Returns:
- the transaction updater
- Since:
- 23.10.0
-
setSaveChallengeAnswer
Set save challenge answer to the transaction.- Parameters:
saveChallengeAnswer
- save challenge answer- Returns:
- the transaction updater
- Since:
- 5.1.0
-
setSaveChallengeTimeout
Set save challenge timeout to the transaction.- Parameters:
saveChallengeTimeout
- save challenge timeout- Returns:
- the transaction updater
- Since:
- 5.1.0
-
setSaveChallengeLocked
Set save challenge locked to the transaction.- Parameters:
saveChallengeLocked
- save challenge locked- Returns:
- the transaction updater
- Since:
- 21.5.0
-
setUserSaved
Set the user saved to the transaction.- Parameters:
userSaved
- the the user saved- Returns:
- the transaction updater
- Since:
- 5.1.3
-
setFormVersionNumber
Set the form version number for the transaction.- Parameters:
formVersionNumber
- the form version number- Returns:
- the transaction updater
- Since:
- 17.10.0
-
setProcessStatus
Set the Process Status.- Parameters:
processStatus
- the processStatus to set- Returns:
- the transaction updater
- Since:
- 19.11.0
-
setReceiptNumber
Set the Receipt Number.- Parameters:
receiptNumber
- the receiptNumber to set- Returns:
- the transaction updater
- Since:
- 19.11.0
-
setTaskAllowClaim
@FluentSecurityPermission(permissions="task-edit") public TxnUpdater setTaskAllowClaim(boolean taskAllowClaim) Set the Task Allow Claim Flag- Parameters:
taskAllowClaim
- task allow claim boolean- Returns:
- the transaction updater
- Since:
- 19.11.0
-
setTimeTaskExpiry
@FluentSecurityPermission(permissions="task-edit") public TxnUpdater setTimeTaskExpiry(Date timeTaskExpiry) Set the Task Expiry Time- Parameters:
timeTaskExpiry
- task expiry timestamp- Returns:
- the transaction updater
- Since:
- 19.11.0
-
setTimeTxnExpiry
Set the Txn Expiry Date- Parameters:
timeTxnExpiry
- transaction expiry date- Returns:
- the transaction updater
- Since:
- 19.11.0
-
setAbandonMode
Perform an abandonment on the transaction to be purged- Parameters:
abandonMode
- purge abandon mode- Returns:
- the transaction updater
- Since:
- 19.11.0
-
addComment
Add comment to the transaction.- Parameters:
comment
- transaction comment- Returns:
- the transaction updater
- Since:
- 21.5.0
-
returnNull
Set the updater to return null instead of a transaction object. This can improve performance when the updated transaction object is not required by the caller. Note: If this method is called, update() will return null even if other with...() methods were called.- Returns:
- the transaction updater
- Since:
- 19.11.1
-
withAll
@FluentSecurityPermission(permissions={"submission-data-view","submission-xml-data-view"}) public TxnUpdater withAll()Set the updater to return the transaction with all the associated attachments map, form data map, form XML, group names, property map, receipt PDF data, etc.- Returns:
- the transaction updater
- Since:
- 19.5.4
-
withNone
Set the updater to return the transaction with none of the associated attachments map, form data map, form XML, group names, property map, receipt PDF data, etc.- Returns:
- the transaction updater
- Since:
- 19.5.4
-
withComments
Set the updater to return the transaction with the comments.- Returns:
- the transaction updater
- Since:
- 21.5.0
-
withFormDataMap
Set the updater to return the transaction with the associated form data map information.- Returns:
- the transaction updater
- Since:
- 19.5.4
-
withFormXml
Set the updater to return the transaction with the associated form XML information.- Returns:
- the transaction updater
- Since:
- 19.5.4
-
withGroupNames
Set the updater to return the transaction with the associated group names information.- Returns:
- the transaction updater
- Since:
- 19.5.4
-
withPropertyMap
Set the updater to return the transaction with the associated property map information.- Returns:
- the transaction updater
- Since:
- 19.5.4
-
withReceiptPdf
Set the updater to return the transaction with the associated receipt PDF data.- Returns:
- the transaction updater
- Since:
- 19.5.4
-
withFileAttachList
@FluentSecurityPermission(permissions="submission-data-view") public TxnUpdater withFileAttachList()Set the updater to return the transaction with the associated file attachment list.- Returns:
- the transaction updater
- Since:
- 19.5.4
-
withDeliveryFuncs
Set the updater to return the transaction with the associated transaction delivery functions.- Returns:
- the transaction updater
- Since:
- 19.5.4
-
update
Update the identified transaction with the specified parameters, and return a new immutable Txn value object.- Returns:
- an updated immutable Txn value object
-