Class JobTaskAssignService
- java.lang.Object
-
- com.avoka.fc.core.service.BaseService
-
- com.avoka.fc.core.service.CayenneService
-
- com.avoka.fc.core.service.job.impl.AbstractJobActionService
-
- com.avoka.fc.core.service.job.impl.JobTaskAssignService
-
- All Implemented Interfaces:
IServiceDefinitionAware
,IJobActionService
public class JobTaskAssignService extends AbstractJobActionService
Provides a 'Job Task Assign' Action Service.Configuration
Please note "Task Review Submission Step" must contain an action of type "Form Start" or "Task Assign" which will reference the form submission to be reviewed by this step. Also note either a user or a group must be assigned to as task.
This service can add a submission processing status messages to the specified Submission. These appear in the user's submission history.
It can also send a status update via email
The Job Task Assign service has a lot of configuration properties. These properties are either associated with:
-
Status Updates and Email: This service can add a submission processing status messages to the specified Submission.
These appear in the user's submission history.
It can also send a status update via email -
Task Assignment: These properties are used in the creation and assignment of user and group tasks. Tasks can be
categorised as:
-
Standard Tasks: to an authenticated user or group.
-
Review Tasks: these are the similar to the standard tasks but attachments are copied from a previous submission.
- Anonymous Save: A Submission record is saved but not assigned to a user in the TM database. They are usually assigned to a email address, the user is sent a notification email. They click on a link. The user has to enter a challenge response before they have access to the task form.
-
Standard Tasks: to an authenticated user or group.
Configuration: Task Assignment
Below is a list of the Job Action Properties which are associated with e use to configure this step action.
Name Description Examples Task Type Specify what type of task to create [ Anonymous | Form | Review ]. { "name": "Task Type", "value": "Review" } Task Form XML Data the form XML data (schema seed) { "name": "Task Form XML Data", "value": "$func.startSubmissionXml()" }
Task Input XML Prefill the input pre-fill data XML which is mapped into the form XML data using prefill input XPath mappings. This property value is ignored for 'Anonymous' Task Types. { "name": "Task Input XML Prefill", "value": "$func.invoke('Job Prefill Service', $job)" }
Task Form Code the form code of the form to assign in this Task.
Since 5.1 Review Tasks do not need to specify a Task Form Code, in which case the form code and form version from the previous submission will be used.
If a form code is specified without a form version then the current form version will be used.{ "name": "Task Form Code", "value": "ABC123" }
{ "name": "Task Form Code", "value": "$func.startFormCode()" }Task Form Version this explicitly sets the form version of the form assigned in Task Form Code. Note this requires the Task Form Code to be specified.
Since 5.1{ "name": "Task Form Version", "value": "1" }
Task Review Previous Step This property is only valid with 'Review' Task Type. Specify whether to review a form submission of the previous step [ true | false ]. If true this will override the value in Task Review Submission Step { "name": "Task Review Previous Step", "value": "true" } Task Review Submission Step This property is only valid with 'Review' Task Type. Specify the name of the form submission step to review. Ignored if Task Review Previous Step" is set to true { "name": "Task Review Submission Step", "value": "Application Start" } Task Attachments Previous Step Specify whether to copy attachments from the submission of the previous step [ true | false ]. If true this will override the value in Task Attachments Submission Step. This property is ignored if a 'Review' Task which will automatically copy attachments form the reviewed submission. { "name": "Task Attachments Previous Step", "value": "true" } Task Attachments Submission Step Specify the name of the form submission step to copy the attachments from. Ignored if Task Attachments Previous Step" is set to true. This property is also ignored if a 'Review' Task which will automatically copy attachments form the reviewed submission. { "name": "Task Attachments Submission Step", "value": "Application Start" } Task Assign Group This property is only valid with 'Form' or 'Review' Task Types. The assigned task group name. A function can also specify the assigned group. { "name": "Task Assign Group", "value": "Initial Review Group" }
{ "name": "Task Assign Group", "value": "$func.formProperty('Manager Review Group')" }Task Assign Groups This property is only valid with 'Form' or 'Review' Task Types. The assigned task groups. A function can also specify the assigned groups. { "name": "Task Assign Groups", "value": "Blue-Reviewers, Red-Reviewers" }
{ "name": "Task Assign Groups", "value": "$func.formProperty('Reviewer Groups')" }Task Assign Group Create Enable form groups to be automatically created if they don't already exist, and create submission group association. { "name": "Task Assign Groups", "value": "$formDataMap.assignGroups" }
{ "name": "Task Assign Group Create", "value": "true" } { "name": "Task Assign Repeating", "value": "true" }Task Assign User This property is only valid with 'Form' or 'Review' Task Types. The assigned task user's login name. The user has to be an active user in the databse. { "name": "Task Assign User", "value": "johnsmith" }
{ "name": "Task Assign User", "value": "$func.startUser()" }
{ "name": "Task Assign User", "value": "$formDataMap.managerLoginName" }
{ "name": "Task Assign User", "value": "$func.userForEmail($formDataMap.managerEmail)" }
{ "name": "Task Assign User", "value": "$func.formProperty('Manager Login')" }Task Assign Email This property is only valid with 'Anonymous' Task Type. The assigned task email for anonymous user email assignment { "name": "Task Assign Email", "value": "[email protected]" }
{ "name": "Task Assign Email", "value": "$formDataMap.doctorEmailAddress" }Task Assign Repeating This property specifies whether the Task Assignment is repeating, and a task assignments should be performed to each assignment member, either Email, Group or User.
The example below will assign separate Tasks to the 'App QA' group and the 'App Reviewers' group.{ "name": "Task Assign Group", "value": "App QA|App Reviewers" }
{ "name": "Task Assign Repeating", "value": "true" }Task Assign Repeat Item This property specifies the Task Assign Repeat Item, and its value is made available during the evaluation of other properties as ${assignRepeatItem} and is stored in the JobAction record. This value can be used to differentiate task assignments during repeating assignment.
This data is also populated into the XML form data element://SystemProfile/Job/AssignRepeatItem
{ "name": "Task Assign Group", "value": "App QA|App Reviewers" }
{ "name": "Task Assign Repeating", "value": "true" }
{ "name": "Task Assign Repeat Item", "value": "$formDataMap.divisionChoice" }Task Enable Claiming Enable group tasks to be claimed/assigned to individual users belonging to the task's groups. { "name": "Task Enable Claiming", "value": "true" } Task Save Challenge This property is only valid with 'Anonymous' Task Type and is is associated with Anonymous save and the Task Assign Email property. The save challenge question is configured in the form version. { "name": "Task Save Challenge", "value": "${formDataMap.email}" } Task Assign Portal the space name to be used for the task assignment, for anonymous user email assignment (manditory) for user or group assignment (optional). If not specified then it uses the first space that is assigned to the form. { "name": "Task Assign Portal", "value": "Maguire" }
{ "name": "Task Assign Portal", "value": "$func.formProperty('Review Portal')" }Task User Deletable specify whether the task can be deleted by the assignee [ true | false ]. If unset this is false { "name": "Task User Deletable", "value": "true" } Task Scheduled the task's scheduled time, format: yyyy-[m]m-[d]d { "name": "Task Scheduled", "value": "2014-04-10" } Task Expiry the task's expiry time, format: yyyy-[m]m-[d]d { "name": "Task Expiry", "value": "2014-04-10" } Task Menu Label the task menu label value for use in application bundle navigation menus { "name": "Task Menu Label", "value": "Credit Card" }
{ "name": "Task Menu Category", "value": "Products" }Task Menu Category the task menu category for use in application bundle navigation menus to group related tasks into a menu grouping { "name": "Task Menu Label", "value": "Credit Card" }
{ "name": "Task Menu Category", "value": "Products" }Task Subject the task subject line / title { "name": "Task Email Subject", "value": "Application Review Job" }
{ "name": "Task Email Subject", "value": "$job.referenceNumber for $formDataMap.firstName $formDataMap.lastName" }Task Message the task descriptive message { "name": "Task Email Message", "value": "$job.referenceNumber for $formDataMap.firstName $formDataMap.lastName } Task Sequence the sort order task sequence number { "name": "Task Sequence", "value": "1" } Task Address the task location address { "name": "Task Address", "value": "1a Rialto Lane, Manly, New South Wales" } Task Latitude the task location latitude in decimal degrees { "name": "Task Latitude", "value": "-33.79833" } Task Longitude the task location longitude in decimal degrees { "name": "Task Longitude", "value": "151.28723" } Task Send Email specify whether a notification email should be sent to task assignees [ true | false ] { "name": "Task Send Email", "value": "true" } Task Email Message the task email notification email message body (template).
The following model is used:
- submission (Submission): the previous submission
- formDataMap: Map<String, String> the form data map for the submission
- task (Submission): the task submission
- format(EmailFormat): the email formatter
- portal (Portal): the Space (Portal), if the portal is specified or resolved
- taskUrl (String) the link to the newly created task, if portal specified or resolved
- environmentName (String): the environment name deployment property
- supportEmail (String): the email for the default sender
Note:- Most of the time this property should be removed in which case it will use the "Email Task Notification Message" template property
will be looked up in this order:
form -> organization -> space (portal) -> deployment property - Adding large templates into the JobDefinitionJSON can be problematic. It may be better to set an "Email Task Notification Message" property.
{ "name": "Task Email Message", "value": "$job.referenceNumber for $formDataMap.firstName $formDataMap.lastName" }
{ "name": "Task Email Message", "value": '$job.referenceNumber for $formDataMap.firstName $formDataMap.lastName
click here to open your task' }Task Email Subject the task email notification subject template.
The following model is used:
- submission (Submission): the previous submission
- formDataMap: Map<String, String> the form data map for the submission
- task (Submission): the task submission
- format(EmailFormat): the email formatter
- portal (Portal): the Space (Portal), if the portal is specified or resolved
- taskUrl (String) the link to the newly created task, if portal specified or resolved
- environmentName (String): the environment name deployment property
- supportEmail (String): the email for the default sender
Note:- Most of the time this property should be removed in which case it will use the "Email Task Notification Subject" template property
will be looked up in this order:
form -> organization -> space (portal) -> deployment property - Adding large templates into the JobDefinitionJSON can be problematic. It may be better to set an "Email Task Notification Subject" property.
{ "name": "Task Email Subject", "value": "Application Review Job" }
{ "name": "Task Email Subject", "value": "$job.referenceNumber for $formDataMap.firstName $formDataMap.lastName" }
Configuration: Status Updates and Email
Below is a list of the Job Action Properties which are used to configure this step action associated with Status Updates and Emails.
Name Description Examples Process Message Text The submission processing status message text { "name": "Process Message Text", "value": "${formDataMap.name} your application has been approved" }
Process Message Submission Specify the submission to update the processing status message on. { "name": "Process Message Submission", "value": "$func.startSubmission()" }
{ "name": "Process Message Submission", "value": "$funct.previousSubmission()" }Process Message Submission Step Specify the step name of the submission to update the processing status message on. { "name": "Process Message Submission Step", "value": "Application Start" } Process Message Send Email Specify whether to send an processing message email. { "name": "Process Message Send Email", "value": "true" } Process Message Email To Specify whether to send an processing message email. If not specified then the submissions contact email address will be used. { "name": "Process Message Email To", "value": "${formDataMap.email}" } Process Message Email Subject Template Specify an alternative email subject template to the default Form and Organization email template: 'Email Submission Status Subject'
{ "name": "Process Message Email Subject Template", "value": "Welcome Email Subject" } Process Message Email Message Template Specify an alternative email subject template to the default Form and Organization property email template: 'Email Submission Status Message'
{ "name": "Process Message Email Message Template", "value": "Welcome Email Message" } - Since:
- 4.0.0
-
-
Field Summary
Fields Modifier and Type Field Description static String
PROPERTY_TASK_ADDRESS
The step/service property "Task Address"static String
PROPERTY_TASK_ASSIGN_PORTAL
The step/service property "Task Assign Portal"static String
PROPERTY_TASK_ASSIGN_REPEATING
The step/service property "Task Assign Repeating"static String
PROPERTY_TASK_ATTACHMENTS_PREVIOUS_STEP
The step/service property "Task Attachments Previous Step"static String
PROPERTY_TASK_ATTACHMENTS_SUBMISSION_STEP
The step/service property "Task Attachments Submission Step"static String
PROPERTY_TASK_EMAIL_MESSAGE
The step/service property "Task Email Message"static String
PROPERTY_TASK_EMAIL_SUBJECT
The step/service property "Task Email Subject"static String
PROPERTY_TASK_EXPIRY
The step/service property "Task Expiry"static String
PROPERTY_TASK_FORM_CODE
The step/service property "Task Form Code"static String
PROPERTY_TASK_FORM_VERSION
The step/service property "Task Form Version"static String
PROPERTY_TASK_FORM_XML_DATA
The step/service property "Task Form XML Data"static String
PROPERTY_TASK_INPUT_XML_PREFILL
The step/service property "Task Input XML Prefill"static String
PROPERTY_TASK_LATITUDE
The step/service property "Task Latitude"static String
PROPERTY_TASK_LONGITUDE
The step/service property "Task Longitude"static String
PROPERTY_TASK_MENU_CATEGORY
The step/service property "Task Menu Category"static String
PROPERTY_TASK_MENU_LABEL
The step/service property "Task Menu Label"static String
PROPERTY_TASK_MESSAGE
The step/service property "Task Message"static String
PROPERTY_TASK_REVIEW_PREVIOUS_STEP
The step/service property "Task Review Previous Step"static String
PROPERTY_TASK_REVIEW_SUBMISSION_STEP
The step/service property "Task Review Submission Step"static String
PROPERTY_TASK_SEND_EMAIL
The step/service property "Task Send Email"static String
PROPERTY_TASK_SEQUENCE
The step/service property "Task Sequence"static String
PROPERTY_TASK_SUBJECT
The step/service property "Task Subject"static String
PROPERTY_TASK_TYPE
The step/service property "Task Type"-
Fields inherited from class com.avoka.fc.core.service.job.impl.AbstractJobActionService
jobEventLogService, maxErrorRetryAttempts, retryDelayMins, serviceDefinition
-
-
Constructor Summary
Constructors Constructor Description JobTaskAssignService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ActionResult
execute(ActionContext actionContext)
Execute the action and return the result.String
validateProperties(ActionStepProperties actionStepProperties, Client client)
Validate the action service using the given action step service properties, returning null if valid or an error string otherwise.-
Methods inherited from class com.avoka.fc.core.service.job.impl.AbstractJobActionService
getJobEventLogService, getMaxErrorRetryAttempts, getRetryDelayMins, getServiceDefinition, setMaxErrorRetryAttempts, setRetryDelayMins, setServiceDefinition
-
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
-
-
-
-
Field Detail
-
PROPERTY_TASK_FORM_CODE
public static final String PROPERTY_TASK_FORM_CODE
The step/service property "Task Form Code"- See Also:
- Constant Field Values
-
PROPERTY_TASK_FORM_VERSION
public static final String PROPERTY_TASK_FORM_VERSION
The step/service property "Task Form Version"- See Also:
- Constant Field Values
-
PROPERTY_TASK_EXPIRY
public static final String PROPERTY_TASK_EXPIRY
The step/service property "Task Expiry"- See Also:
- Constant Field Values
-
PROPERTY_TASK_SEND_EMAIL
public static final String PROPERTY_TASK_SEND_EMAIL
The step/service property "Task Send Email"- See Also:
- Constant Field Values
-
PROPERTY_TASK_EMAIL_SUBJECT
public static final String PROPERTY_TASK_EMAIL_SUBJECT
The step/service property "Task Email Subject"- See Also:
- Constant Field Values
-
PROPERTY_TASK_EMAIL_MESSAGE
public static final String PROPERTY_TASK_EMAIL_MESSAGE
The step/service property "Task Email Message"- See Also:
- Constant Field Values
-
PROPERTY_TASK_SUBJECT
public static final String PROPERTY_TASK_SUBJECT
The step/service property "Task Subject"- See Also:
- Constant Field Values
-
PROPERTY_TASK_MESSAGE
public static final String PROPERTY_TASK_MESSAGE
The step/service property "Task Message"- See Also:
- Constant Field Values
-
PROPERTY_TASK_SEQUENCE
public static final String PROPERTY_TASK_SEQUENCE
The step/service property "Task Sequence"- See Also:
- Constant Field Values
-
PROPERTY_TASK_ADDRESS
public static final String PROPERTY_TASK_ADDRESS
The step/service property "Task Address"- See Also:
- Constant Field Values
-
PROPERTY_TASK_LATITUDE
public static final String PROPERTY_TASK_LATITUDE
The step/service property "Task Latitude"- See Also:
- Constant Field Values
-
PROPERTY_TASK_LONGITUDE
public static final String PROPERTY_TASK_LONGITUDE
The step/service property "Task Longitude"- See Also:
- Constant Field Values
-
PROPERTY_TASK_FORM_XML_DATA
public static final String PROPERTY_TASK_FORM_XML_DATA
The step/service property "Task Form XML Data"- See Also:
- Constant Field Values
-
PROPERTY_TASK_INPUT_XML_PREFILL
public static final String PROPERTY_TASK_INPUT_XML_PREFILL
The step/service property "Task Input XML Prefill"- See Also:
- Constant Field Values
-
PROPERTY_TASK_ATTACHMENTS_PREVIOUS_STEP
public static final String PROPERTY_TASK_ATTACHMENTS_PREVIOUS_STEP
The step/service property "Task Attachments Previous Step"- See Also:
- Constant Field Values
-
PROPERTY_TASK_ATTACHMENTS_SUBMISSION_STEP
public static final String PROPERTY_TASK_ATTACHMENTS_SUBMISSION_STEP
The step/service property "Task Attachments Submission Step"- See Also:
- Constant Field Values
-
PROPERTY_TASK_MENU_LABEL
public static final String PROPERTY_TASK_MENU_LABEL
The step/service property "Task Menu Label"- See Also:
- Constant Field Values
-
PROPERTY_TASK_MENU_CATEGORY
public static final String PROPERTY_TASK_MENU_CATEGORY
The step/service property "Task Menu Category"- See Also:
- Constant Field Values
-
PROPERTY_TASK_TYPE
public static final String PROPERTY_TASK_TYPE
The step/service property "Task Type"- See Also:
- Constant Field Values
-
PROPERTY_TASK_ASSIGN_PORTAL
public static final String PROPERTY_TASK_ASSIGN_PORTAL
The step/service property "Task Assign Portal"- See Also:
- Constant Field Values
-
PROPERTY_TASK_REVIEW_PREVIOUS_STEP
public static final String PROPERTY_TASK_REVIEW_PREVIOUS_STEP
The step/service property "Task Review Previous Step"- See Also:
- Constant Field Values
-
PROPERTY_TASK_REVIEW_SUBMISSION_STEP
public static final String PROPERTY_TASK_REVIEW_SUBMISSION_STEP
The step/service property "Task Review Submission Step"- See Also:
- Constant Field Values
-
PROPERTY_TASK_ASSIGN_REPEATING
public static final String PROPERTY_TASK_ASSIGN_REPEATING
The step/service property "Task Assign Repeating"- See Also:
- Constant Field Values
-
-
Method Detail
-
execute
public ActionResult execute(ActionContext actionContext)
Description copied from interface:IJobActionService
Execute the action and return the result.- Parameters:
actionContext
- the job action execution context (required)- Returns:
- the action result
- See Also:
IJobActionService.execute(ActionContext)
-
validateProperties
public String validateProperties(ActionStepProperties actionStepProperties, Client client)
Validate the action service using the given action step service properties, returning null if valid or an error string otherwise.- Specified by:
validateProperties
in interfaceIJobActionService
- Overrides:
validateProperties
in classAbstractJobActionService
- Parameters:
actionStepProperties
- the action step properties (required)client
- the Job Controller client (required)- Returns:
- null if the properties are valid or null otherwise
- See Also:
IJobActionService.validateProperties(ActionStepProperties, Client)
-
-