public class GenerateToken extends AbstractActivitiDelegate { 

@Override 
protected void doExecute(final DelegateExecution execution) 
throws Exception { 

SyncopeUser user = (SyncopeUser) execution.getVariable( 
ActivitiUserWorkflowAdapter.SYNCOPE_USER); 

LOG.debug("Generating token for user with id {}", user.getId()); 

user.generateToken(Integer.parseInt( 
confDAO.find("token.length", "256").getValue()), 
Integer.parseInt( 
confDAO.find("token.expireTime", "60").getValue())); 

execution.setVariable( 
ActivitiUserWorkflowAdapter.SYNCOPE_USER, user); 
} 
} 

----- Original Message -----
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