* @return true on success.
*/
@Override
public Serializable execute(final TaskHandlerActionContext<ActionContext> inActionContext)
{
CreatePersonRequest createRequest = (CreatePersonRequest) inActionContext.getActionContext().getParams();
Person inPerson = createRequest.getPerson();
PersistResourceExecution<Person> persistResourceExecution = createPersonActionFactory.getCreatePersonAction(
personMapper, new ReflectiveUpdater());
log.debug("Adding to database: " + inPerson.getAccountId());
Person person = (Person) new InlineExecutionStrategyExecutor().execute(persistResourceExecution,
inPerson.getProperties(), inActionContext);
log.info("Added to database: " + inPerson.getAccountId());
// Send email notification if necessary
if (createRequest.getSendEmail() && sendWelcomeEmailAction != null && !sendWelcomeEmailAction.isEmpty())
{
inActionContext.getUserActionRequests().add(
new UserActionRequest(sendWelcomeEmailAction, null, new SendWelcomeEmailRequest(
inPerson.getEmail(), inPerson.getAccountId())));
}