Package com.avoka.fc.core.service
Class TaskService
- java.lang.Object
-
- com.avoka.fc.core.service.BaseService
-
- com.avoka.fc.core.service.CayenneService
-
- com.avoka.fc.core.service.TaskService
-
public class TaskService extends CayenneService
Provides a task service.
-
-
Constructor Summary
Constructors Constructor Description TaskService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Submission
createFormTask(Form form, String taskSubject, String taskMessage, Integer sequence, UserAccount user, Group group, String formDataXml, String inputXmlData, Double latitude, Double longitude, String address, Date datetimeScheduled, Date datetimeExpiry, boolean sendEmailFlag, String emailSubject, String emailMessage, boolean userDeletableFlag)
Create a form task for a user or a user group to do.Submission
createFormTask(Form form, String taskSubject, String taskMessage, Integer sequence, UserAccount user, Group group, String formDataXml, String inputXmlData, Double latitude, Double longitude, Date datetimeScheduled, Date datetimeExpiry, boolean sendEmailFlag, String emailSubject, String emailMessage, boolean userDeletableFlag)
Create a form task for a user or a user group to do.Submission
createReviewTask(Submission reviewSubmission, Form form, String taskSubject, String taskMessage, Integer sequence, UserAccount user, Group group, String formDataXml, Double latitude, Double longitude, String address, Date datetimeScheduled, Date datetimeExpiry, boolean sendEmailFlag, String emailSubject, String emailMessage, boolean userDeletableFlag)
Create a review task for a user or a user group to do.Submission
createReviewTask(Submission reviewSubmission, Form form, String taskSubject, String taskMessage, Integer sequence, UserAccount user, Group group, String formDataXml, Double latitude, Double longitude, Date datetimeScheduled, Date datetimeExpiry, boolean sendEmailFlag, String emailSubject, String emailMessage, boolean userDeletableFlag)
Create a review task for a user or a user group to do.boolean
isAssignee(Submission task, UserAccount user)
Check whether the task is assigned to a particular user.-
Methods inherited from class com.avoka.fc.core.service.CayenneService
commitChanges, deleteObject, deleteObjects, findObject, getDataContext, getDataDomain, getObjectForPK, getObjectStore, newObject, performNamedQuery, performNamedQuery, performNamedQuery, performNonSelectingQuery, performNonSelectingQuery, performNonSelectingQuery, performNonSelectingQuery, performQuery, performQuery, refetchEntity, refetchObject, registerNewObject, rollbackChanges, toMap, toMap
-
Methods inherited from class com.avoka.fc.core.service.BaseService
getLogger
-
-
-
-
Method Detail
-
createFormTask
public Submission createFormTask(Form form, String taskSubject, String taskMessage, Integer sequence, UserAccount user, Group group, String formDataXml, String inputXmlData, Double latitude, Double longitude, Date datetimeScheduled, Date datetimeExpiry, boolean sendEmailFlag, String emailSubject, String emailMessage, boolean userDeletableFlag)
Create a form task 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.- Parameters:
form
- the form to filltaskSubject
- the task subject (required)taskMessage
- task messagesequence
- a sequence number that can be set to number tasks that are part of a set (optional)user
- the user account to assign the task to (must be specified if group is not)group
- the forms group to assign the task to (must be specified if user is not)formDataXml
- the schema seed for the forminputXmlData
- the pre-filled data XML for the form.latitude
- the latitude component of the geolocation information (optional; can range from -90 to 90)longitude
- the longitude component of the geolocation information (optional; can range from -180 to 180)datetimeScheduled
- scheduling information that can be displayed to the assignee(s) (optional)datetimeExpiry
- the date/time when the task shall expire (optional; needs to be in the future)sendEmailFlag
- whether this task needs to send out emailemailSubject
- the email subjectemailMessage
- the email bodyuserDeletableFlag
- whether the user can delete this flag- Returns:
- the created task object
-
createFormTask
public Submission createFormTask(Form form, String taskSubject, String taskMessage, Integer sequence, UserAccount user, Group group, String formDataXml, String inputXmlData, Double latitude, Double longitude, String address, Date datetimeScheduled, Date datetimeExpiry, boolean sendEmailFlag, String emailSubject, String emailMessage, boolean userDeletableFlag)
Create a form task 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.- Parameters:
form
- the form to filltaskSubject
- the task subject (required)taskMessage
- task messagesequence
- a sequence number that can be set to number tasks that are part of a set (optional)user
- the user account to assign the task to (must be specified if group is not)group
- the forms group to assign the task to (must be specified if user is not)formDataXml
- the schema seed for the forminputXmlData
- the pre-filled data XML for the form.latitude
- the latitude component of the geolocation information (optional; can range from -90 to 90)longitude
- the longitude component of the geolocation information (optional; can range from -180 to 180)address
- the task location addressdatetimeScheduled
- scheduling information that can be displayed to the assignee(s) (optional)datetimeExpiry
- the date/time when the task shall expire (optional; needs to be in the future)sendEmailFlag
- whether this task needs to send out emailemailSubject
- the email subjectemailMessage
- the email bodyuserDeletableFlag
- whether the user can delete this flag- Returns:
- the created task object
- Since:
- 4.0.0
-
createReviewTask
public Submission createReviewTask(Submission reviewSubmission, Form form, String taskSubject, String taskMessage, Integer sequence, UserAccount user, Group group, String formDataXml, Double latitude, Double longitude, Date datetimeScheduled, Date datetimeExpiry, boolean sendEmailFlag, String emailSubject, String emailMessage, boolean userDeletableFlag)
Create a review task for a user or a user group to do. A review task is based on an existing submission and can be pre-filled with schema seed data. Note that this method contains database transactions.- Parameters:
reviewSubmission
- the submission to review (required)form
- the form to fill (optional; the submission form will be used if not set)taskSubject
- the task subject (required)taskMessage
- task message (optional)sequence
- a sequence number that can be set to number tasks that are part of a set (optional)user
- the user account to assign the task to (must be specified if group is not)group
- the forms group to assign the task to (must be specified if user is not)formDataXml
- the populated schema seed for the form (optional)latitude
- the latitude component of the geolocation information (optional; can range from -90 to 90)longitude
- the longitude component of the geolocation information (optional; can range from -180 to 180)datetimeScheduled
- scheduling information that can be displayed to the assignee(s) (optional)datetimeExpiry
- the date/time when the task shall expire (optional; needs to be in the future)sendEmailFlag
- whether this task needs to send out email to the assignee(s)emailSubject
- the email subjectemailMessage
- the email bodyuserDeletableFlag
- whether the user can delete this task- Returns:
- the created task object
-
createReviewTask
public Submission createReviewTask(Submission reviewSubmission, Form form, String taskSubject, String taskMessage, Integer sequence, UserAccount user, Group group, String formDataXml, Double latitude, Double longitude, String address, Date datetimeScheduled, Date datetimeExpiry, boolean sendEmailFlag, String emailSubject, String emailMessage, boolean userDeletableFlag)
Create a review task for a user or a user group to do. A review task is based on an existing submission and can be pre-filled with schema seed data. Note that this method contains database transactions.- Parameters:
reviewSubmission
- the submission to review (required)form
- the form to fill (optional; the submission form will be used if not set)taskSubject
- the task subject (required)taskMessage
- task message (optional)sequence
- a sequence number that can be set to number tasks that are part of a set (optional)user
- the user account to assign the task to (must be specified if group is not)group
- the forms group to assign the task to (must be specified if user is not)formDataXml
- the populated schema seed for the form (optional)latitude
- the latitude component of the geolocation information (optional; can range from -90 to 90)longitude
- the longitude component of the geolocation information (optional; can range from -180 to 180)address
- the task location addressdatetimeScheduled
- scheduling information that can be displayed to the assignee(s) (optional)datetimeExpiry
- the date/time when the task shall expire (optional; needs to be in the future)sendEmailFlag
- whether this task needs to send out email to the assignee(s)emailSubject
- the email subjectemailMessage
- the email bodyuserDeletableFlag
- whether the user can delete this task- Returns:
- the created task object
- Since:
- 4.0.0
-
isAssignee
public boolean isAssignee(Submission task, UserAccount user)
Check whether the task is assigned to a particular user. This method is provided for backward compatibility, use IFormSubmissionAccessController instead.- Parameters:
task
- the task (required)user
- the user account- Returns:
- true if the task is assigned to the user, otherwise false
-
-