Class TxnBuilder
Provides a Txn value object builder class.
This class builds anonymous saved form, task form or review form transactions. If contactEmailAddress
is set, then it will be built anonymous saved form, otherwise specifying loginName
and
taskType
with [Form|Review] value will determine what form type will be created.
Building form task transaction basically creates a form task transaction for a user or a user group to do. The task form can be merged and rendered either by the form schema seed or using the prefill data services. Note that form data XML and prefill data XML are mutually exclusive. Note that this method contains database transactions.
Building review task transaction basically creates a review task transaction for a user or a user group to do. A review task is based on an existing transaction and can be pre-filled with schema seed data.
Examples
Please find transaction builder examples below.
Create an Anonymous Saved Form
Build an anonymous saved form transaction using the provided parameters data.
import com.avoka.tm.svc.* import com.avoka.tm.vo.* Txn txn = new TxnBuilder() .setAddress("1 Street") .setContactEmailAddress("[email protected]") .setDatetimeScheduled(new Date()) .setDatetimeExpiry(new Date()) .setEmailSubject("Email subject") .setEmailMessage("Email message") .setFormCode("FRM-1234") .setGroupName("Administrator") .setLatitude(new Double(40)) .setLongitude(new Double(50)) .setProperty("propKey", "propValue") .setReceiptNumber("RCPT-1234") .setSaveChallengeAnswer("saveChallengeAnswer") .setSequence(new Integer(2)) .setSpaceName("spaceName") .setTxnXml("<Txn></Txn>") .setTaskMessage("taskMessage") .setTaskSubject("taskSubject") .setTransRefNumber("TRANS-1234") .withFormDataMap() .withGroupNames() .withPropertyMap() .build()
Create a Form Task Form
Build a form task transaction using the provided parameter data.
import com.avoka.tm.svc.* import com.avoka.tm.vo.* Txn txn = new TxnBuilder() .setAddress("1 Street") .setDatetimeExpiry(new Date()) .setDatetimeScheduled(new Date()) .setEmailSubject("Email subject") .setEmailMessage("Email message") .setFormDataXml("<FormData></FormData>") .setFormCode("FRM-1234") .setLatitude(new Double(40)) .setLoginName("login") .setLongitude(new Double(50)) .setSequence(new Integer(2)) .setSpaceName("space") .setTaskMessage("taskMessage") .setTaskSubject("taskSubject") .setTaskType("Form") .withUserDeletableFlag() .build()
Create a Review Task
Build a review task transaction using the provided parameter data.
import com.avoka.tm.svc.* import com.avoka.tm.vo.* Txn txn = new TxnBuilder() .setLoginName("login") .setTaskType("Review") .setTaskSubject("Task subject") .setReviewTxn(new Long(12345678)) .build()
- Since:
- 5.0.0
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionaddFileAttach
(FileAttach fileAttach) Add the given file attachment to the transaction.addFormDataExtract
(String name, String value) Add form data (data extract) to the transaction.build()
Create a transaction based on the specified parameter and return the new Txn value object.setAddress
(String address) Set address parameter.setContactEmailAddress
(String contactEmailAddress) Set the contact email address parameter.setCopyAttachmentsNames
(List<String> copyAttachmentsNames) Set copy attachment names parameter.setCopyAttachmentsTxn
(Long copyAttachmentsTxn) Set copy attachments txn id parameter.setDatetimeExpiry
(Date datetimeExpiry) Set date time expiry parameter.setDatetimeScheduled
(Date datetimeScheduled) Set date time scheduled parameter.setEmailMessage
(String emailMessage) Set email message parameter.setEmailSubject
(String emailSubject) Set email subject parameter.setFormCode
(String formCode) Set the form code parameter.setFormDataXml
(String formDataXml) Set form data xml parameter.setFormPrefillServiceName
(String formPrefillServiceName) Set form prefill service name parameter.setFormVersion
(String formVersion) Set the form version parameter.setGroupName
(String groupName) Set group name parameter.setGroupNames
(Collection<String> groupNames) Set group names parameter.setInputXmlData
(String inputXmlData) Set input xml data parameter.setJobAction
(Long jobAction) Set job action parameter.setLatitude
(Double latitude) Set latitude parameter.setLinkedTxnId
(Number linkedTxnId) Set the linked transaction id (required).setLoginName
(String loginName) Set the login name parameter.setLongitude
(Double longitude) Set longiture parameter.setProperty
(String name, String value) Specify the property name and value on the transaction.setPropertyMap
(Map<String, String> propertyMap) Specify the property map on the transaction.setReceiptNumber
(String receiptNumber) Set receipt number parameter.setReviewTxn
(Long reviewTxnId) Set the review txn id parameter.setSaveChallengeAnswer
(String saveChallengeAnswer) Set save challenge answer parameter.setSequence
(Integer sequence) Set sequence number parameter.setSpaceName
(String spaceName) Set the space name parameter.setTaskMessage
(String taskMessage) Set task message parameter.setTaskSubject
(String taskSubject) Set the task subject parameter.setTaskType
(String taskType) Set the task type parameter [ Form | Review ].setTransRefNumber
(String transRefNumber) Set transaction reference number parameter.Set txn xml parameter.Set allow claim flag parameter totrue
.Set the query to return the transaction with the associated form data map information.Set the query to return the transaction with the associated group names information.Set the query to return the transaction with the associated property map information.Set send email flag parameter totrue
.Set user deletable flag parameter totrue
.
-
Constructor Details
-
TxnBuilder
-
-
Method Details
-
setLinkedTxnId
Set the linked transaction id (required).- Parameters:
linkedTxnId
- the linkedTxnId to set- Returns:
- the transaction builder
- Since:
- 21.11
-
setSpaceName
Set the space name parameter.- Parameters:
spaceName
- the space name parameter- Returns:
- the transaction builder
-
setContactEmailAddress
Set the contact email address parameter.- Parameters:
contactEmailAddress
- the email address parameter- Returns:
- the transaction builder
-
setFormCode
Set the form code parameter.- Parameters:
formCode
- the form code parameter- Returns:
- the transaction builder
-
setFormVersion
Set the form version parameter.- Parameters:
formVersion
- the form version parameter- Returns:
- the transaction builder
- Since:
- 19.11.0
-
setLoginName
Set the login name parameter.- Parameters:
loginName
- the login name parameter- Returns:
- the transaction builder
-
setTaskType
Set the task type parameter [ Form | Review ].- Parameters:
taskType
- the task type parameter [ Form | Review ]- Returns:
- the transaction builder
-
setReviewTxn
Set the review txn id parameter.- Parameters:
reviewTxnId
- the review txn id- Returns:
- the transaction builder
-
setTaskSubject
Set the task subject parameter.- Parameters:
taskSubject
- task subject- Returns:
- the transaction builder
-
setGroupName
Set group name parameter.- Parameters:
groupName
- group name- Returns:
- the transaction builder
-
setGroupNames
Set group names parameter.- Parameters:
groupNames
- group names- Returns:
- the transaction builder
-
setAddress
Set address parameter.- Parameters:
address
- address- Returns:
- the transaction builder
-
setCopyAttachmentsNames
Set copy attachment names parameter.- Parameters:
copyAttachmentsNames
- copy attachment names- Returns:
- the transaction builder
-
setCopyAttachmentsTxn
Set copy attachments txn id parameter.- Parameters:
copyAttachmentsTxn
- copy attachments txn id- Returns:
- the transaction builder
-
setEmailSubject
Set email subject parameter.- Parameters:
emailSubject
- email subject- Returns:
- the transaction builder
-
setEmailMessage
Set email message parameter.- Parameters:
emailMessage
- email message- Returns:
- the transaction builder
-
setDatetimeScheduled
Set date time scheduled parameter.- Parameters:
datetimeScheduled
- date time scheduled- Returns:
- the transaction builder
-
setDatetimeExpiry
Set date time expiry parameter.- Parameters:
datetimeExpiry
- date time expiry- Returns:
- the transaction builder
-
setFormPrefillServiceName
Set form prefill service name parameter.- Parameters:
formPrefillServiceName
- form prefill service name- Returns:
- the transaction builder
-
setInputXmlData
Set input xml data parameter.- Parameters:
inputXmlData
- input xml data- Returns:
- the transaction builder
-
setLatitude
Set latitude parameter.- Parameters:
latitude
- latitude parameter- Returns:
- the transaction builder
-
setLongitude
Set longiture parameter.- Parameters:
longitude
- longitude parameter- Returns:
- the transaction builder
-
setReceiptNumber
Set receipt number parameter.- Parameters:
receiptNumber
- receipt number- Returns:
- the transaction builder
-
setSaveChallengeAnswer
Set save challenge answer parameter.- Parameters:
saveChallengeAnswer
- save challenge answer- Returns:
- the transaction builder
-
setSequence
Set sequence number parameter.- Parameters:
sequence
- sequence number- Returns:
- the transaction builder
-
withSendEmailFlag
Set send email flag parameter totrue
.- Returns:
- the transaction builder
-
setTxnXml
Set txn xml parameter.- Parameters:
txnXml
- txn xml- Returns:
- the transaction builder
-
setTaskMessage
Set task message parameter.- Parameters:
taskMessage
- task message- Returns:
- the transaction builder
-
setTransRefNumber
Set transaction reference number parameter.- Parameters:
transRefNumber
- transaction reference number- Returns:
- the transaction builder
-
setJobAction
Set job action parameter.- Parameters:
jobAction
- job action- Returns:
- the transaction builder
-
setProperty
Specify the property name and value on the transaction.- Parameters:
name
- the property name (required)value
- the property value (required)- Returns:
- the transaction builder
- Since:
- 5.1.0
-
setPropertyMap
Specify the property map on the transaction.- Parameters:
propertyMap
- the property map- Returns:
- the transaction builder
- Since:
- 5.1.0
-
addFileAttach
Add the given file attachment to the transaction.- Parameters:
fileAttach
- the file attachment to add to the transaction- Returns:
- the transaction builder
-
withAllowClaimFlag
Set allow claim flag parameter totrue
.- Returns:
- the transaction builder
-
setFormDataXml
Set form data xml parameter.- Parameters:
formDataXml
- the form data XML- Returns:
- the transaction builder
-
addFormDataExtract
Add form data (data extract) to the transaction.- Parameters:
name
- form data (extract) namevalue
- form data (extract) value- Returns:
- the transaction builder
-
withUserDeletableFlag
Set user deletable flag parameter totrue
.- Returns:
- the transaction builder
-
withFormDataMap
Set the query to return the transaction with the associated form data map information.- Returns:
- the transaction builder
-
withGroupNames
Set the query to return the transaction with the associated group names information.- Returns:
- the transaction builder
-
withPropertyMap
Set the query to return the transaction with the associated property map information.- Returns:
- the transaction builder
- Since:
- 5.1.0
-
build
Create a transaction based on the specified parameter and return the new Txn value object.- Returns:
- the newly created Txn value object
-