Re: [rules-users] Working in the GWT console

2009-11-18 Thread ramram8

Hi Kris

  I managed to get all the user tasks working fine in the GWT console 
  I just have a problem on having a workitem to be executed in the GWT.

  If i have the following scenario USER Task - WorkITEM
  the user task is being executed but the workitem is never ?
  what should I add to the java file inorder to execute a work item? is
there any help document? or can you please help me in this issue?

thanks
ram
-- 
View this message in context: 
http://old.nabble.com/Working-in-the-GWT-console-tp26387553p26405215.html
Sent from the drools - user mailing list archive at Nabble.com.

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


[rules-users] Working in the GWT console

2009-11-17 Thread ramram8

Hi I am having the following problem:
I am able to start the web cosole successfully and see all the process List
that I want to execute.
My scenario is the following: User Task1 - User Task2 - Send Mail

What I did is:
1- upload the jar file into Guvnor
2- upload the rf file into Guvnor
3- Build the package and restart the server
4- After logining into GWT console I can run the process and see in the User
Task1 and I can complete the task with no errors but the problem is that I
am not being able to reach to USER TASK2 

any suggestions?? 
is there problem in the upload in the Guvnor??
is there anything additional that I can do??

Please if anyone have any suggestions on this topic???
-- 
View this message in context: 
http://old.nabble.com/Working-in-the-GWT-console-tp26387553p26387553.html
Sent from the drools - user mailing list archive at Nabble.com.

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Working in the GWT console

2009-11-17 Thread Kris Verlaenen
Does your test case work if you run it from Eclipse directly (for
example using a knowledge agent to load them from guvnor or simply
loading from file system) and using the Eclipse task client (to
eliminate the possibility that there is something wrong with the
process)?  Might be useful if you could show us the process itself as well.

Kris

Quoting ramram8 ramram...@gmail.com:

 
 Hi I am having the following problem:
 I am able to start the web cosole successfully and see all the
 process List
 that I want to execute.
 My scenario is the following: User Task1 - User Task2 - Send Mail
 
 What I did is:
 1- upload the jar file into Guvnor
 2- upload the rf file into Guvnor
 3- Build the package and restart the server
 4- After logining into GWT console I can run the process and see in
 the User
 Task1 and I can complete the task with no errors but the problem is
 that I
 am not being able to reach to USER TASK2 
 
 any suggestions?? 
 is there problem in the upload in the Guvnor??
 is there anything additional that I can do??
 
 Please if anyone have any suggestions on this topic???
 -- 
 View this message in context:
 http://old.nabble.com/Working-in-the-GWT-console-tp26387553p26387553.html
 Sent from the drools - user mailing list archive at Nabble.com.
 
 ___
 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


Re: [rules-users] Working in the GWT console

2009-11-17 Thread ramram8

Hi Kris
I am new to Drools. I didn't perform a test case from eclipse by using a
knowledge agent to load them from guvnor. Well I have a question after I
build the application on Guvnor should I do something like copythe .pkg to a
specific location or just restart the server and Launch the GWT console.
What I did is the following:

1- I uploaded a jar file of my process into Guvnor below is the sample java
file that i am using:

package com.fp;
import org.drools.KnowledgeBase;
import org.drools.KnowledgeBaseFactory;
import org.drools.builder.KnowledgeBuilder;
import org.drools.builder.KnowledgeBuilderError;
import org.drools.builder.KnowledgeBuilderErrors;
import org.drools.builder.KnowledgeBuilderFactory;
import org.drools.builder.ResourceType;
import org.drools.io.ResourceFactory;
import org.drools.logger.KnowledgeRuntimeLogger;
import org.drools.logger.KnowledgeRuntimeLoggerFactory;
import org.drools.process.instance.impl.demo.SystemOutWorkItemHandler;
import org.drools.process.workitem.wsht.WSHumanTaskHandler;
import org.drools.runtime.StatefulKnowledgeSession;


public class TestDrools
{

public static final void main(String[] args) 
{
try 
{
System.out.println(\n\n\n   i am here );

KnowledgeBase kbase = readKnowledgeBase();

//  // create the entity manager factory and register it in 
the environment
//  EntityManagerFactory emf =
//  Persistence.createEntityManagerFactory(
org.drools.persistence.jpa );
//  Environment env = KnowledgeBaseFactory.newEnvironment();
//  env.set( EnvironmentName.ENTITY_MANAGER_FACTORY, emf );
//  env.set( EnvironmentName.TRANSACTION_MANAGER,
//   
TransactionManagerServices.getTransactionManager() );
//
//  // create a new knowledge session that uses JPA to 
store the runtime
state
//  StatefulKnowledgeSession ksession =
//  JPAKnowledgeService.newStatefulKnowledgeSession( 
kbase, null, env
);

final StatefulKnowledgeSession ksession =
kbase.newStatefulKnowledgeSession();

// start the transaction
//  UserTransaction ut =
//(UserTransaction) new InitialContext().lookup(
java:comp/UserTransaction );
//  ut.begin();

KnowledgeRuntimeLogger logger =
KnowledgeRuntimeLoggerFactory.newFileLogger(ksession, test);

ksession.getWorkItemManager().registerWorkItemHandler(Human Task, new
WSHumanTaskHandler());

ksession.getWorkItemManager().registerWorkItemHandler(Log, new
SystemOutWorkItemHandler());

// perform multiple commands inside one transaction
ksession.startProcess(testDroolsFlow);
//ksession.fireAllRules();

// commit the transaction
//  ut.commit();



} catch (Throwable t) 
{
t.printStackTrace();
}
}

private static KnowledgeBase readKnowledgeBase() throws Exception 
{
KnowledgeBuilder kbuilder = 
KnowledgeBuilderFactory.newKnowledgeBuilder();

kbuilder.add(ResourceFactory.newClassPathResource(testDroolsFlow.rf),
ResourceType.DRF);
KnowledgeBuilderErrors errors = kbuilder.getErrors();
if (errors.size()  0) 
{
for (KnowledgeBuilderError error: errors) 
{
System.err.println(error);
}
throw new IllegalArgumentException(Could not parse 
knowledge.);
}
KnowledgeBase kbase = KnowledgeBaseFactory.newKnowledgeBase();
kbase.addKnowledgePackages(kbuilder.getKnowledgePackages());
return kbase;
}

}

2- uploading the process rule flow below is the .rf file that i am using:

?xml version=1.0 encoding=UTF-8? 
process xmlns=http://drools.org/drools-5.0/process;
 xmlns:xs=http://www.w3.org/2001/XMLSchema-instance;
 xs:schemaLocation=http://drools.org/drools-5.0/process
drools-processes-5.0.xsd
 type=RuleFlow name=testDroolsFlow id=testDroolsFlow
package-name=default 

  header
  /header

  nodes
start id=1 name=Start x=16 y=181 width=80 height=40 /
end id=3 name=End x=527 y=173 width=80 height=40 /
humanTask id=4 name=Task1 x=95 y=184 width=100 height=48 
  work name=Human Task 

Re: [rules-users] Working in the GWT console

2009-11-17 Thread ramram8

Kris I also found the following issue if the USER TASK 1 and USER TASK 2 are
assigned to the same user I can see both tasks and execute them but if for
example Task 1 is assigned to admin and Task 2 is assigned to admin1 after
logging out and logging in as admin1 I cant see that the tasks that are
assigned to him in order to complete the process. Another issue if I have
another scenario a User Task Followed by LOG for example The User task is
executed but the process that is following it which is a LOG in our example
is never reached or executed.

PS. for the LOG process I defined a special handler for it which only
contanins System,out,

public class MyLogHandlerCall implements WorkItemHandler
{

public void executeWorkItem(WorkItem workItem, WorkItemManager manager)
{
try
{
System.out.println(R TEST);
}
catch(Exception e)
{
e.printStackTrace();
}
 }

public void abortWorkItem(WorkItem workItem, WorkItemManager manager)
{
 System.out.println((new StringBuilder()).append(Aborting work item
).append(workItem).toString());
 manager.abortWorkItem(workItem.getId());
}
}


Please advise!
-- 
View this message in context: 
http://old.nabble.com/Working-in-the-GWT-console-tp26387553p26389372.html
Sent from the drools - user mailing list archive at Nabble.com.

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users