Creating Accounts

1 view
Skip to first unread message

coocooche

unread,
Feb 5, 2010, 4:48:28 AM2/5/10
to Velo
Hello,
After the reconciliation process, i want to do the inverse: i have
users on Velo and i want to add/insert this users on my jdbc resource.
I followed the procedure on Velo's wiki:
- i used “Add_Account” action at “PRE” phase
- the Groovy script is:
def attrs = cntx.get("attrs");
def queryManager = cntx.get("queryManager");

String accountName = attrs["username"].values[0].asString;
String firstName = attrs["name"].values[0].asString;
String lastName = attrs["surname"].values[0].asString;
String email = attrs["email"].values[0].asString;

String query = "insert into accounts values(?,?,?,?)";

queryManager.add(query, accountName, firstName, lastName,
email);
cntx.set("queryManager", queryManager);

After executing the task, my accounts aren't created on my resource.
Anyone could tell me please what i'm doing wrong?

Thanks,
Gentjan

Trouby

unread,
Feb 5, 2010, 10:00:47 AM2/5/10
to Velo
When you assign a role to a user that is associated to the resource
the account should be created within,
Velo will go through the attributes and calculate the attributes
values,

Please make sure that per resource attribute, you have a source value
defined (in the edit resource attribute page)
You have two options:

A resource attribute can be mapped to an IdentityAttribute as its
source
A rule can be attached to the resource attribute to calculate the
value,


After attributes calculations, a task should be created with all the
calculated attributes,
When you execute your task, the query you build will be invoked on the
resource,


Please display here the SPML that generated, you can find it within
the task,
Examine yourself whether all attributes were calculated correctly,


It seems like the action that should invoke the insert is right,

Is the task fails? do you see an error message when clicking on the
task?


Thanks,
Asaf.

coocooche

unread,
Feb 11, 2010, 3:51:48 PM2/11/10
to Velo
Hi,
I solved. The problem was calculating the attribute's values. They
weren't exact in the script!

Thanks a lot!
Gentjan

Reply all
Reply to author
Forward
0 new messages