<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<body link="#355491" alink="#4262a1" vlink="#355491" style="background: #e2e2e2; margin: 0; padding: 20px;">

<div>
        <table cellpadding="0" bgcolor="#FFFFFF" border="0" cellspacing="0" style="border: 1px solid #dadada; margin-bottom: 30px; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                <tbody>
                        <tr>

                                <td>

                                        <table border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" style="border: solid 2px #ccc; background: #dadada; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                                                <tbody>
                                                        <tr>
                                                                <td bgcolor="#000000" valign="middle" height="58px" style="border-bottom: 1px solid #ccc; padding: 20px; -moz-border-radius-topleft: 3px; -moz-border-radius-topright: 3px; -webkit-border-top-right-radius: 5px; -webkit-border-top-left-radius: 5px;">
                                                                        <h1 style="color: #333333; font: bold 22px Arial, Helvetica, sans-serif; margin: 0; display: block !important;">
                                                                        <!-- To have a header image/logo replace the name below with your img tag -->
                                                                        <!-- Email clients will render the images when the message is read so any image -->
                                                                        <!-- must be made available on a public server, so that all recipients can load the image. -->
                                                                        <a href="http://community.jboss.org/index.jspa" style="text-decoration: none; color: #E1E1E1">JBoss Community</a></h1>
                                                                </td>

                                                        </tr>
                                                        <tr>
                                                                <td bgcolor="#FFFFFF" style="font: normal 12px Arial, Helvetica, sans-serif; color:#333333; padding: 20px;  -moz-border-radius-bottomleft: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 5px; -webkit-border-bottom-left-radius: 5px;"><h3 style="margin: 10px 0 5px; font-size: 17px; font-weight: normal;">
    Re: Defining users for TaskServer - jbpm5
</h3>
<span style="margin-bottom: 10px;">
    created by <a href="http://community.jboss.org/people/rushproject">Alex Pavlov</a> in <i>jBPM</i> - <a href="http://community.jboss.org/message/589627#589627">View the full discussion</a>
</span>
<hr style="margin: 20px 0; border: none; background-color: #dadada; height: 1px;">

<div class="jive-rendered-content"><blockquote class="jive-quote"><p>Cristiano Nicolai wrote:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>I'm wondering if there is a better way to deal with users and groups. My point is, and probably is a very common use case, to have users and groups in a external source, like DB or LDAP, forcing a replication of this data to TaskServer DB.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Any thought?</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p></blockquote><blockquote class="jive-quote"><p>Mauricio Salatino wrote:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p><span>Yes of course, that's why all the classes inside: </span><a class="jive-link-external-small" href="https://github.com/krisv/jbpm/tree/master/jbpm-human-task/src/main/java/org/jbpm/userprofile" target="_blank">https://github.com/krisv/jbpm/tree/master/jbpm-human-task/src/main/java/org/jbpm/userprofile</a></p><p>exist. They abstract the model of users and these classes can be extended to wrap your user/group models. Please take a look at the comments in the classes, those probably are the answer to your question.</p><p>Greetings!</p></blockquote><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Mauricio, could you please elaborate a bit further? I do not see the UserProfileManager class (the one, the custom implementation of UserProfileRepository interface is supposed to be plugged in) to be used at all. Furthermore, the org.jbpm.task.User object is hardcoded to be an entity in a local database and since Task entity has a reference to the User object, the very moment TaskServiceSession.addTask() tries to persist the Task object for user, which is not in the local database, exception inevitably fires:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>java.sql.BatchUpdateException: Cannot add or update a child row: a foreign key constraint fails (`taskserver`.`task`, CONSTRAINT `FK27A9A59E619A0` FOREIGN KEY (`createdBy_id`) REFERENCES `organizationalentity` (`id`))</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>The bottom line: all users must be replicated in the task server database. Definitely not the way to go, and this is probably why all the classes in the org.jbpm.userprofile exist. But I do not see how one could make any use of the org.jbpm.userprofile package at all.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>So, could you please describe, what is the recommended way to integrate the task server with an external user repository?</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Thank you,</p><p>Alex</p></div>

<div style="background-color: #f4f4f4; padding: 10px; margin-top: 20px;">
    <p style="margin: 0;">Reply to this message by <a href="http://community.jboss.org/message/589627#589627">going to Community</a></p>
        <p style="margin: 0;">Start a new discussion in jBPM at <a href="http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034">Community</a></p>
</div></td>
                        </tr>
                    </tbody>
                </table>


                </td>
            </tr>
        </tbody>
    </table>

</div>

</body>
</html>