On 07/03/2013 01:41, Edward Siewick wrote:
[...]

Sorry. I'm still banging my head on the wall over this DbTable synchronization configuration. I've picked through the wiki and the listserv discussions, worked through Francesco's post carefully. There's probably something I'm just not understanding.

Anyway, the "Dry Run" seems OK:

[...]

However, actually executing the MySQL synchronization yields [updated/failures]: 0/6, so it's still tripping over something. Just guessing at the meaning of that "trying to sync its status anyway", I'm thinking it either can't set the ChangeLogColumn field, or it can't set some status variable in the schema.

There's also one:

Caused by: org.activiti.engine.ActivitiException:
No outgoing sequence flow of the exclusive gateway 'activeGw' could be selected for continuing the process.

What's this mean? It's trying to tell me something's awry in my mapping? If it means the openLDAP connector, that's in the user template / resource / "Selected" bucket for the DbTables resource.

Take a look at [1]: in the default workflow definition [2] - I guess you haven't change this yet - not every state transition is allowed.


The core.log for the run is:

16:36:43.521 DEBUG org.apache.syncope.core.scheduling.AbstractTaskJob - Execute synchronization with token null

16:36:43.541 DEBUG org.apache.syncope.core.scheduling.AbstractTaskJob - Process 'CREATE_OR_UPDATE' for '8' 16:36:43.544 DEBUG org.apache.syncope.core.scheduling.AbstractTaskJob - About to update [166] 16:36:43.545 DEBUG org.apache.syncope.core.scheduling.AbstractTaskJob - About to update user 166 16:36:44.699 ERROR org.apache.syncope.core.scheduling.AbstractTaskJob - Update of user 166 failed, trying to sync its status anyway (if configured)
java.lang.NullPointerException: null

Take a look at the message "Execute synchronization with token null": this suggests that the DBTable connector is sending null values as tokens.
The rest of this stacktrace might be very interesting (about the NPE).

...
[...]

The one improvement I have with the "user template" is that I can delete a user and have all the "derived" fields auto-populate. This also had the side effect of causing the results to shift slightly. I deleted one Username from Syncope, re-synched. Since then, I now have:

Sync result: Users [created/failures]: 0/1 [updated/failures]: 0/5 [deleted/ failures]: 0/0
vice
Sync result: Users [created/failures]: 0/0 [updated/failures]: 0/6 [deleted/ failures]: 0/0


However, afterward, neither "Attributes" nor "Derived attributes" refresh with a re-sync even for the one that was synch'd to Syncope new and clean.

I did try experimenting with different MySQL data types for the ChangeLogColumn. For MySQL only the TIMESTAMP data type is available as an internal increment-on-update feature, frankly. I did try a trigger for incrementing an integer. It made the OrangeHRM webapp really unhappy.

For sanity-checking, here's what the ChangeLogColumn was set to use.

mysql> use orangehrm;
mysql> ALTER TABLE `hs_hr_employee` ADD `ts_changelog` TIMESTAMP ON UPDATE CURRENT_TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ;

# set emp_work_telephone for the first user, and MySQL sets the ts_changelog:

mysql> select emp_number , employee_id , emp_lastname , emp_firstname , emp_work_telephone , emp_work_email, ts_changelog from hs_hr_employee;
+------------+-------------+--------------+---------------+--------------------+----------------------------+---------------------+
| emp_number | employee_id | emp_lastname | emp_firstname | emp_work_telephone | emp_work_email | ts_changelog |
+------------+-------------+--------------+---------------+--------------------+----------------------------+---------------------+
| 8 | 0008 | Doe | Jane | 800-555-1212 | [email protected] | 2013-03-06 14:24:33 | | 9 | 0009 | Doe | John | | [email protected] | 0000-00-00 00:00:00 | | 11 | 0011 | Pare | Karen | | [email protected] | 0000-00-00 00:00:00 | | 12 | 0012 | Robbins | Baskin | | [email protected] | 0000-00-00 00:00:00 | | 13 | 0013 | Dempsey | Jack | | [email protected] | 0000-00-00 00:00:00 | | 14 | 0014 | Hill | Jill | | [email protected] | 0000-00-00 00:00:00 |
+------------+-------------+--------------+---------------+--------------------+----------------------------+---------------------+

Set the rest of the emp_work_telephone via the OrangeHRM interface. ts_changelog picks these up:

mysql> select emp_number , employee_id , emp_lastname , emp_firstname , emp_work_telephone , emp_work_email, ts_changelog from hs_hr_employee;
+------------+-------------+--------------+---------------+--------------------+----------------------------+---------------------+
| emp_number | employee_id | emp_lastname | emp_firstname | emp_work_telephone | emp_work_email | ts_changelog |
+------------+-------------+--------------+---------------+--------------------+----------------------------+---------------------+
| 8 | 0008 | Doe | Jane | 800-555-1212 | [email protected] | 2013-03-06 14:24:33 | | 9 | 0009 | Doe | John | 123-456-7890 | [email protected] | 2013-03-06 15:54:27 | | 11 | 0011 | Pare | Karen | 789-654-3423 | [email protected] | 2013-03-06 15:56:19 | | 12 | 0012 | Robbins | Baskin | 676-878-9898 | [email protected] | 2013-03-06 15:56:50 | | 13 | 0013 | Dempsey | Jack | 444-666-7777 | [email protected] | 2013-03-06 15:54:56 | | 14 | 0014 | Hill | Jill | 546-864-5656 | [email protected] | 2013-03-06 15:55:51 |
+------------+-------------+--------------+---------------+--------------------+----------------------------+---------------------+

However, these doesn't seem to have an effect on the results of the DbTable / MySQL synchronization task. Whatever my error here, the ChangeLogColumn stuff isn't part of it. (Leaving the parameter out of the connector altogether gives the same log result.)

I think you'd better start this Syncope exploration from scratch and go on step-by-step:

1. clean up your Syncope persistence storage (PostgreSQL?) and restart Syncope
2. define a DbTable Connector for your MySQL database, flag all capabilities
3. create a Resource, associate it with the Connector (2), define a reasonable mapping for the columns in the MySQL table (*not* including the ts_changelog column) 4. define a Synchronization Task for the Resource created at (3) and flag everything (including "Full reconciliation") in its Profile tab 5. execute once the Synchronization Task from (4), check that all users from the MySQL table were created in Syncope 6. change some value (for example 'emp_lastname') in the MySQL table, re-execute the Synchronization Task from (4) and check that the matching Syncope users were updated accordingly

If (5) and (6) are fine now you can go on with the following:

7. change the Connector (2) by configuring the ChangeLog column (even though I haven't never had to deal with it directly, I guess that the 'ts_changelog' defined above with the increment-on-update MySQL feature is just fine)
8. Unflag "Full reconciliation" from the Synchronization Task (4)
9. remove all users from Syncope via the admin console

At this point try again to execute (5) and (6): these should work in the same way as before.

Once all this is working, you can start thinking about propagating these data to another external resource (OpenLDAP in your case).

My Apologies about the long post.

You're welcome.

Regards.

[1] https://cwiki.apache.org/confluence/display/SYNCOPE/FAQ#FAQ-Igettheerror%22WorkflowException%3A...Nooutgoingsequenceflow...%22whenupdatinganuser
[2] https://cwiki.apache.org/confluence/display/SYNCOPE/Default+Workflow

--
Francesco Chicchiriccò

ASF Member, Apache Syncope PMC chair, Apache Cocoon PMC Member
http://people.apache.org/~ilgrosso/

Reply via email to