Re: [rules-users] Debuggin in Eclipse
Is your project a Drools project? You can convert existing projects to a Drools projects by right-clicking the project and selecting Convert to Drools Project. This will add the Drools library (which you can remove if you don't need it) and adds a Drools Builder. This builder is crucial as it generates the necessary meta-data used for breakpoints. You should be able to see the drools builder in the .project file. Also make sure that you have not turned off caching in the Drools preferences. The structure of your process should not matter, as long as your rules are on the classpath. You can easily check whether the drools builder is working, as it should show errors for incorrect syntax in your rule files. Kris Citeren chris richmond richmond...@gmail.com: Ok, I have a project working with Eclipse Galileo 3.5.1 and it works fine. I can create new drools projects and they debug fine with the DroolsTest example. However I have a very larege existing project that does not use the src/main/java and src/main/rules src folder structure and the project runs fine, and I can Debug as Drools Application no problem, however it will never stop on any breakpoints in the rules file. Does this have anything to do with the fact that I am not using the default src/rules direcories structure? Or, is it dependent on loading the DRL file in a particular method. I am loading the file usin this method: java.io.FileInputStream fis = *new* java.io.FileInputStream( *new* java.io.File(*C:\\Path\\To\\Some\\Dir\\rules.drl*)); builder.add(ResourceFactory.*newInputStreamResource*(fis), ResourceType.*DRL*); Should I be loading the fule file using the DroolsTest sample code method like below? KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.*newKnowledgeBuilder*(); kbuilder.add(ResourceFactory.*newClassPathResource*(Sample.drl), ResourceType.*DRL*); Does these even make a difference? Or any ideas why I can't get any debug breakpoints in my rule file in my custom project to go into break-time? Thanks, Chris Disclaimer: http://www.kuleuven.be/cwis/email_disclaimer.htm ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] Human Task Work Item
What info does the work item contain that the task itself does not? Basically, the idea would be to put all data that the task needs (directly) as the content of the task (Content parameter), so the client can access it. Kris Citeren Todd Pagni todd.pa...@datacert.com: Thanks for the info. I was hoping there was a way to get the work item via mina. We have a client application that is communicating with the TaskServer via mina and it would be nice if you could easily get a work item that is associated with a task instead of creating a separate knowledgesession. From: rules-users-boun...@lists.jboss.org [mailto:rules-users-boun...@lists.jboss.org] On Behalf Of Vijay K Pandey Sent: Tuesday, December 08, 2009 11:47 AM To: Rules Users List Subject: Re: [rules-users] Human Task Work Item I guess first you have to get hold of the workitemid from the task data i.e. task.getTaskData().getWorkItemId(). a) Create a Command class which implements GenericCommandWorkItem b)Implement the method public WorkItem execute(Context context) c) Based on the workitem id ( set this value in your command object - constructor/setter) - get hold of the WorkItemInfo object through the entity manager and then its workItem - something like this StatefulKnowledgeSession ksession = ((KnowledgeCommandContext) context).getStatefulKnowledgesession(); if (workItemId==null) { return null; } EntityManager em = (EntityManager) ksession.getEnvironment().get(EnvironmentName.ENTITY_MANAGER); WorkItemInfo workItemInfo = em.find(WorkItemInfo.class, workItemId); if(workItemInfo==null){ return null; }else{ return workItemInfo.getWorkItem(); } d) Then call the execute method on the StatefulKnowledgeSession - which should execute the above Command object and that returns you the WorkItem object. Vijay From: rules-users-boun...@lists.jboss.org [mailto:rules-users-boun...@lists.jboss.org] On Behalf Of Todd Pagni Sent: Tuesday, December 08, 2009 11:16 AM To: Rules Users List Subject: [rules-users] Human Task Work Item From the Mina client, how do you get a work item associated with a human task? I see the Task.getTaskData(), but I don't see any easy way to get the work item as I need the work item inparameters from the mina client side. Thanks, Todd Disclaimer: http://www.kuleuven.be/cwis/email_disclaimer.htm ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] Debuggin in Eclipse
Yes, I converted it to a Drools project and I do have errors being flagged in my drools file if I have them. Still nothing. I am very frustrated I am still able to stop at breakpoints in rules files by creating a drools project from scratch and Debug As - Drools application, but something about converting an existing project and debugging it. On Wed, Dec 9, 2009 at 6:52 AM, Kris Verlaenen kris.verlae...@cs.kuleuven.be wrote: Is your project a Drools project? You can convert existing projects to a Drools projects by right-clicking the project and selecting Convert to Drools Project. This will add the Drools library (which you can remove if you don't need it) and adds a Drools Builder. This builder is crucial as it generates the necessary meta-data used for breakpoints. You should be able to see the drools builder in the .project file. Also make sure that you have not turned off caching in the Drools preferences. The structure of your process should not matter, as long as your rules are on the classpath. You can easily check whether the drools builder is working, as it should show errors for incorrect syntax in your rule files. Kris Citeren chris richmond richmond...@gmail.com: Ok, I have a project working with Eclipse Galileo 3.5.1 and it works fine. I can create new drools projects and they debug fine with the DroolsTest example. However I have a very larege existing project that does not use the src/main/java and src/main/rules src folder structure and the project runs fine, and I can Debug as Drools Application no problem, however it will never stop on any breakpoints in the rules file. Does this have anything to do with the fact that I am not using the default src/rules direcories structure? Or, is it dependent on loading the DRL file in a particular method. I am loading the file usin this method: java.io.FileInputStream fis = *new* java.io.FileInputStream( *new* java.io.File(*C:\\Path\\To\\Some\\Dir\\rules.drl*)); builder.add(ResourceFactory.*newInputStreamResource*(fis), ResourceType.*DRL*); Should I be loading the fule file using the DroolsTest sample code method like below? KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.*newKnowledgeBuilder*(); kbuilder.add(ResourceFactory.*newClassPathResource*(Sample.drl), ResourceType.*DRL*); Does these even make a difference? Or any ideas why I can't get any debug breakpoints in my rule file in my custom project to go into break-time? Thanks, Chris Disclaimer: http://www.kuleuven.be/cwis/email_disclaimer.htm ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] Drools Guvnor and jboss single sign on
It's very easy to create a custom authentication module for Seam. In my organization, we've created a simple module which will check the session for an existing user object. Just have to put it on your classpath and edit the components.xml to use your class as its authenticator. Perhaps something like this will work for you? Cheers, Paul import org.jboss.seam.security.Identity; import org.jboss.seam.annotations.Name; import org.jboss.seam.contexts.Contexts; @Name(customAuthenticator) public class CustomAuthenticator { public boolean authenticate() { User userBean = (User) Contexts.getSessionContext() .get(SESSIONID); if (userBean == null || userBean.getUsername() == null) { log.info( No Session ); return false; } else { log.info( Setting username to + userBean.getUsername() ); Identity.instance().getCredentials().setUsername( userBean.getUsername() ); return true; } } } 2009/12/9 Sahid Khan (সাহিদ) sahid...@gmail.com Hello, I have couple of web applications other than Guvnor deployed in JBoss. I use jboss single sign on [1] for authentication. But guvnor does not seem to be working. I believe there are some issues with JBoss Seam and JBoss SSO. But is there any work around to integrate JBoss SSO with Guvnor? Please help. 1. http://www.jboss.org/community/wiki/JBossWebSingleSignOn Thanks in advance, -- Sahid. Argue with idiots, and you become an idiot. - PG ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] Debuggin in Eclipse
Have you tried creating a new empty project (but similar to the one you're using, not sure which type of project you have created, like a normal Java project or a J2EE project or whatever), convert that to a Drools project, add a simple hello world rule and try to debug that? Being able to reproduce this on a rather simple project would probably allow me to take a deeper look into this. Kris Quoting chris richmond richmond...@gmail.com: Yes, I converted it to a Drools project and I do have errors being flagged in my drools file if I have them. Still nothing. I am very frustrated I am still able to stop at breakpoints in rules files by creating a drools project from scratch and Debug As - Drools application, but something about converting an existing project and debugging it. On Wed, Dec 9, 2009 at 6:52 AM, Kris Verlaenen kris.verlae...@cs.kuleuven.be wrote: Is your project a Drools project? You can convert existing projects to a Drools projects by right-clicking the project and selecting Convert to Drools Project. This will add the Drools library (which you can remove if you don't need it) and adds a Drools Builder. This builder is crucial as it generates the necessary meta-data used for breakpoints. You should be able to see the drools builder in the .project file. Also make sure that you have not turned off caching in the Drools preferences. The structure of your process should not matter, as long as your rules are on the classpath. You can easily check whether the drools builder is working, as it should show errors for incorrect syntax in your rule files. Kris Citeren chris richmond richmond...@gmail.com: Ok, I have a project working with Eclipse Galileo 3.5.1 and it works fine. I can create new drools projects and they debug fine with the DroolsTest example. However I have a very larege existing project that does not use the src/main/java and src/main/rules src folder structure and the project runs fine, and I can Debug as Drools Application no problem, however it will never stop on any breakpoints in the rules file. Does this have anything to do with the fact that I am not using the default src/rules direcories structure? Or, is it dependent on loading the DRL file in a particular method. I am loading the file usin this method: java.io.FileInputStream fis = *new* java.io.FileInputStream( *new* java.io.File(*C:\\Path\\To\\Some\\Dir\\rules.drl*)); builder.add(ResourceFactory.*newInputStreamResource*(fis), ResourceType.*DRL*); Should I be loading the fule file using the DroolsTest sample code method like below? KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.*newKnowledgeBuilder*(); kbuilder.add(ResourceFactory.*newClassPathResource*(Sample.drl), ResourceType.*DRL*); Does these even make a difference? Or any ideas why I can't get any debug breakpoints in my rule file in my custom project to go into break-time? Thanks, Chris Disclaimer: http://www.kuleuven.be/cwis/email_disclaimer.htm ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users Disclaimer: http://www.kuleuven.be/cwis/email_disclaimer.htm ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users