You  can manually add users via the OrganziationalEntity table:

 

User, Administrator

User, myuser

Etc.

 

I am doing the following to start the task server:

 

        Environment env = KnowledgeBaseFactory.newEnvironment();

        taskServerEntityManagerFactory = 
Persistence.createEntityManagerFactory("org.drools.task");

        env.set(EnvironmentName.ENTITY_MANAGER_FACTORY, 
taskServerEntityManagerFactory);

        

        taskService = new TaskService(taskServerEntityManagerFactory, 
SystemEventListenerFactory

                .getSystemEventListener());

        

        server = new MinaTaskServer(taskService);

        Thread thread = new Thread(server);

        thread.start();

 

From: [email protected] 
[mailto:[email protected]] On Behalf Of Chuck.KS
Sent: Monday, January 25, 2010 1:26 PM
To: [email protected]
Subject: Re: [rules-users] Human Task Example

 

I did see that I need to populate users, but I didn't at first seen any 
instructions on how to do so. Reading more carefully, I think I see how to do 
it now, i.e. by calling "addUser()". I'll give that a try a little later today. 
Another thing that may give me a problem is that I didn't know what the second 
argument should be to the TaskService() constructor below. The documentation 
shows only one argument, but it seems that there is no one argument constructor 
anymore. Any help with that? Really appreciate your help and time! -Chuck

private static void startTaskService()

        {

               EntityManagerFactory emf = 
Persistence.createEntityManagerFactory("org.drools.task");

               TaskService taskService = new TaskService(emf,null);

               MinaTaskServer server = new MinaTaskServer( taskService );




               Thread thread = new Thread( server );

               thread.start();

        }

 

On Mon, Jan 25, 2010 at 1:05 PM, salaboy [via Drools - Java Rules Engine] 
<[hidden email] 
<http://n3.nabble.com/user/SendEmail.jtp?type=node&node=138369&i=0> > wrote:

I see that problem before. It means that you need to populate some users first. 
Insert in the database an administrator user before running the process.

On Mon, Jan 25, 2010 at 3:28 PM, Chuck.KS <[hidden email] 
<http://n3.nabble.com/user/SendEmail.jtp?type=node&node=138346&i=0> > wrote:

        
        
        ramram wrote:
        >
        > Hi What do u have as a problem running the human task?
        > did u run the taskservice?
        > u cant start a humantask flow as long as u dont have a TaskService?
        >

        I did manage to put some code together but I didn't feel from reading 
the
        documentation that I knew exactly what I was doing. I think it would be 
very
        helpful and many questions would be avoided if a worked out example 
could
        be provided with the drools distribution. Anyway, I really appreciate 
your
        help. The error I got is indicated below.
        
        Jan 25, 2010 12:16:39 PM org.hibernate.util.JDBCExceptionReporter
        logExceptions
        WARNING: SQL Error: 23002, SQLState: 23002
        Jan 25, 2010 12:16:39 PM org.hibernate.util.JDBCExceptionReporter
        logExceptions
        SEVERE: Referential integrity constraint violation: FK27A9A59B680AE0:
        PUBLIC.TASK FOREIGN KEY(CREATEDBY_ID) REFERENCES
        PUBLIC.ORGANIZATIONALENTITY(ID) [23002-77]
        Jan 25, 2010 12:16:39 PM org.hibernate.util.JDBCExceptionReporter
        logExceptions
        WARNING: SQL Error: 23002, SQLState: 23002
        Jan 25, 2010 12:16:39 PM org.hibernate.util.JDBCExceptionReporter
        logExceptions
        SEVERE: Referential integrity constraint violation: FK27A9A59B680AE0:
        PUBLIC.TASK FOREIGN KEY(CREATEDBY_ID) REFERENCES
        PUBLIC.ORGANIZATIONALENTITY(ID) [23002-77]
        Jan 25, 2010 12:16:39 PM
        org.hibernate.event.def.AbstractFlushingEventListener performExecutions
        SEVERE: Could not synchronize database state with session
        org.hibernate.exception.ConstraintViolationException: Could not execute 
JDBC
        batch update
        Â  Â  Â  Â at
        
org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:94)
        Â  Â  Â  Â at
        
org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)
        Â  Â  Â  Â at
        
org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:275)
        Â  Â  Â  Â at 
org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:266)
        
        Also, I'm attaching my test file and persistence.xml file:
        http://n3.nabble.com/file/n138317/RuleFlowTest.java RuleFlowTest.java ,
        http://n3.nabble.com/file/n138317/persistence.xml persistence.xml
        --
        View this message in context: 
http://n3.nabble.com/Human-Task-Example-tp131011p138317.html

        Sent from the Drools - User mailing list archive at Nabble.com.
        _______________________________________________
        rules-users mailing list

        [hidden email] 
<http://n3.nabble.com/user/SendEmail.jtp?type=node&node=138346&i=1> 

        
        https://lists.jboss.org/mailman/listinfo/rules-users






-- 
- http://salaboy.wordpress.com
- http://www.jbug.com.ar
- Salatino "Salaboy" Mauricio -

_______________________________________________ 
rules-users mailing list 
[hidden email] 
<http://n3.nabble.com/user/SendEmail.jtp?type=node&node=138346&i=2>  

https://lists.jboss.org/mailman/listinfo/rules-users

 

________________________________

View this message in context: Re: [rules-users] Human Task Example 
<http://n3.nabble.com/Human-Task-Example-tp131011p138369.html> 
Sent from the Drools - User mailing list archive 
<http://n3.nabble.com/Drools-User-f47000.html>  at Nabble.com.

_______________________________________________
rules-users mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/rules-users

Reply via email to