Hi Sarris,

well I ended up creating an additional REST method in the
usercontroller (/activate/{userId}) with the token as query parameter.

I'm not sure this is the way to go but Francesco will shed some light
on it when he has the time.

My code:

 @PreAuthorize("hasRole('USER_UPDATE')")
    @RequestMapping(method = RequestMethod.GET, value = "/activate/{userId}")
    @Transactional(readOnly = true, rollbackFor = {Throwable.class})
    public UserTO activate(@PathVariable("userId") final Long userId,
            @RequestParam("token") final String token)
            throws WorkflowException, NotFoundException,
UnauthorizedRoleException, PropagationException {

        LOG.debug("About to activate " + userId +" with token "+token);

        SyncopeUser user = userDAO.find(userId);
        if (user == null) {
            throw new NotFoundException("User " + userId);
        }

        wfAdapter.activate(userId, token);
        return userDataBinder.getUserTO(userId);
    }

On 31 May 2012 12:56, Sarris T.L. Overbosch | Everett
<[email protected]> wrote:
> Hi Bob
>
> I am at the same point you are and haven't found the solution (but that's
> also because I didn't do any work on this case because
> of other obligations) So when you find something I would make me happy when
> you would tell me about the solution.
>
> Br,
>
> Sarris
>
>
>
>
> From: "Bob Lannoy" <[email protected]>
> To: [email protected]
> Sent: Tuesday, May 29, 2012 3:39:40 PM
> Subject: Re: Notifications
>
>
> Thanks, that does the trick.
> It seems that it also results in the token being persisted to the
> database. Maybe something for JIRA?
>
> Now that I have in the email, I'm not sure how to proceed using that token.
> I see that there's an activate method in the usercontroller, but it
> doesn't take the token as input.
>
> How do I give the external token to the workflow and make it
> transition from the usertask "created" into the createdGw with the
> token variable?
>
> best regards
>
> Bob
>
> On 29 May 2012 14:08, Sarris T.L. Overbosch | Everett
> <[email protected]> wrote:
>>
>> I had the same problem, solved it by placing the object back on the
>> workflow
>> otherwise the information is not available.
>>
>> From: "Bob Lannoy" <[email protected]>
>> To: [email protected]
>> Sent: Tuesday, May 29, 2012 1:10:17 PM
>> Subject: Re: Notifications
>>
>>
>> Hi,
>>
>> I started my own workflow based on the example workflow from the
>> latest incubating version.
>> Now I get a mail when the user is in the "created" state just after
>> the token generation. However, I'm unable to send the generated token
>> to the user. The token is generated (saw this through debugging) but
>> it seems that it's not persisted in the database.
>> In the email template I put "Your token is $user.getToken()." but it
>> shows up like that in the email, not resolved to a value. Probably
>> because of the token not being in the DB.
>>
>> I've attached my WF definition.
>>
>> regards
>>
>> Bob

Reply via email to