[jBPM] - Group assignment and action on tasks
by Sasi R
Sasi R [http://community.jboss.org/people/sasir] created the discussion
"Group assignment and action on tasks"
To view the discussion, visit: http://community.jboss.org/message/595376#595376
--------------------------------------------------------------
Am able to define and assign the groupid tohuman task and able to pull the list of tasks using TaskClient. Howwever am unable to action further(like release/claim/start/complete) on the items assigned to the group using the member of group as userid.
How does TaskServer behave in this scenario? Am i missing something here??
Code Snippet
*******
*For Group Assignment*
MinaTaskServer server;
EntityManagerFactory emf = Persistence.createEntityManagerFactory("org.jbpm.task");
TaskService taskService = new TaskService(emf, SystemEventListenerFactory.getSystemEventListener());
TaskServiceSession taskSession= taskService.createSession();
server = new MinaTaskServer(taskService);
Thread thread = new Thread(server);
List<OrganizationalEntity> usersList=new ArrayList<OrganizationalEntity>();
usersList.add(**new** User("sasi"));
usersList.add(**new** User("venkat"));
usersList.add(**new** User("krisv"));
usersList.add(**new** User("mary"));
BPMTaskUserInfo userInfo = **new**BPMTaskUserInfo();
taskService.setUserinfo(userInfo);
userInfo.getGroups().put(**new** Group("Group1"), usersList);
userInfo.getGroups().put(**new** Group("Group2"), usersList);
userInfo.getGroups().put(**new** Group("Group3"), usersList);
#####
###
####
#
*For retrieving tasks*
**
public static void getTasks(StatefulKnowledgeSession ksession){
WorkItemHandler htHandler = new WSHumanTaskHandler();
ksession.getWorkItemManager().registerWorkItemHandler("Human Task", htHandler);
TaskClient client = new TaskClient(new MinaTaskClientConnector("client 1",new MinaTaskClientHandler(SystemEventListenerFactory.getSystemEventListener())));
boolean isConnected = client.connect("127.0.0.1", 9123);
System.out.println("client conencted :"+isConnected);
BlockingTaskSummaryResponseHandler summaryHandler = new BlockingTaskSummaryResponseHandler();
int timeoutCounter = 0;
List<TaskSummary> tasks;
List<String> groups= new ArrayList<String>();
groups.add("Group1");
do {
client.getTasksAssignedAsPotentialOwner("sasi",groups, "en-UK", summaryHandler);
tasks = summaryHandler.getResults();
TaskSummary task = null;
for (TaskSummary taskSummary : tasks)
{
System.out.println(taskSummary.getId() + " : " + taskSummary.getName());
}
//wait until the task is registered with the server or timeout expires
if (timeoutCounter != 0) {
try {
Thread.sleep(10);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
} while (tasks.isEmpty() && timeoutCounter++ < 10);
System.out.println("Tasks size is"+tasks.size());
TaskSummary task = tasks.get(0);
System.out.println("Task details are "+task.getId());
BlockingTaskOperationResponseHandler operationHandler =
new BlockingTaskOperationResponseHandler();
client.release(task.getId(), "Administrator", operationHandler);
operationHandler.waitTillDone(5000);
operationHandler =
new BlockingTaskOperationResponseHandler();
client.claim(task.getId(), "sasi", operationHandler);
operationHandler.waitTillDone(5000);
operationHandler =
new BlockingTaskOperationResponseHandler();
client.start(task.getId(), "sasi", operationHandler);
operationHandler.waitTillDone(5000);
operationHandler =
new BlockingTaskOperationResponseHandler();
client.complete(task.getId(), "sasi", null,
operationHandler);
operationHandler.waitTillDone(5000);
}
*Error:*
[2011:03:83 11:03:898:debug] Arguments : [[org.jbpm.task.query.TaskSummary@3585d013, http://community.jboss.org/mailto:org.jbpm.task.query.TaskSummary@7fc4f753 org.jbpm.task.query.TaskSummary@7fc4f753, http://community.jboss.org/mailto:org.jbpm.task.query.TaskSummary@c2579d8d org.jbpm.task.query.TaskSummary@c2579d8d, http://community.jboss.org/mailto:org.jbpm.task.query.TaskSummary@73ef06e5 org.jbpm.task.query.TaskSummary@73ef06e5, http://community.jboss.org/mailto:org.jbpm.task.query.TaskSummary@2d60e703 org.jbpm.task.query.TaskSummary@2d60e703, http://community.jboss.org/mailto:org.jbpm.task.query.TaskSummary@aa5cc20b org.jbpm.task.query.TaskSummary@aa5cc20b, http://community.jboss.org/mailto:org.jbpm.task.query.TaskSummary@33aad8e3 org.jbpm.task.query.TaskSummary@33aad8e3, http://community.jboss.org/mailto:org.jbpm.task.query.TaskSummary@105b609b org.jbpm.task.query.TaskSummary@105b609b, http://community.jboss.org/mailto:org.jbpm.task.query.TaskSummary@9a153a13 org.jbpm.task.query.TaskSummary@9a153a13, http://community.jboss.org/mailto:org.jbpm.task.query.TaskSummary@2398c26b org.jbpm.task.query.TaskSummary@2398c26b, http://community.jboss.org/mailto:org.jbpm.task.query.TaskSummary@63ece17b org.jbpm.task.query.TaskSummary@63ece17b]]
5105 : Event-Ready-Task
9905 : Event-Ready-Task
3755 : Event-Ready-Task
4355 : Event-Ready-Task
8705 : Event-Ready-Task
5705 : Event-Ready-Task
6305 : Event-Ready-Task
6905 : Event-Ready-Task
7505 : Event-Ready-Task
8105 : Event-Ready-Task
9305 : Event-Ready-Task
Tasks size is11
Task details are 5105
org.jbpm.task.service.PermissionDeniedException: Server-side Exception: User '[User:'Administrator']' was unable to execution operation 'Release' on task id 5105 due to no 'current status' matchines
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at org.jbpm.task.service.responsehandlers.AbstractBaseResponseHandler.createSideException(AbstractBaseResponseHandler.java:74)
at org.jbpm.task.service.responsehandlers.AbstractBlockingResponseHandler.waitTillDone(AbstractBlockingResponseHandler.java:48)
at com.sample.CorporateActionsNewTest.getTasks(CorporateActionsNewTest.java:132)
at com.sample.CorporateActionsNewTest.main(CorporateActionsNewTest.java:60)
[2011:03:83 11:03:37:debug] Message receieved on client : OperationResponse
[2011:03:83 11:03:38:debug] Arguments : [org.jbpm.task.service.PermissionDeniedException: User '[User:'Administrator']' was unable to execution operation 'Release' on task id 5105 due to no 'current status' matchines]
If i try with Sasi for release
org.jbpm.task.service.PermissionDeniedException: Server-side Exception: User '[User:'sasi']' was unable to execution operation 'Release' on task id 5105 due to no 'current status' matchines
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at org.jbpm.task.service.responsehandlers.AbstractBaseResponseHandler.createSideException(AbstractBaseResponseHandler.java:74)
at org.jbpm.task.service.responsehandlers.AbstractBlockingResponseHandler.waitTillDone(AbstractBlockingResponseHandler.java:48)[2011:03:83 11:03:626:debug] Message receieved on client : OperationResponse
[2011:03:83 11:03:627:debug] Arguments : [org.jbpm.task.service.PermissionDeniedException: User '[User:'sasi']' was unable to execution operation 'Release' on task id 5105 due to no 'current status' matchines]
at com.sample.CorporateActionsNewTest.getTasks(CorporateActionsNewTest.java:132)
at com.sample.CorporateActionsNewTest.main(CorporateActionsNewTest.java:60)
5105 task is with 'Ready' status in datasbase
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/595376#595376]
Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
13 years, 6 months
[JBoss Web Services] - Upgrading from AS 5.1 to AS 6 WS error
by Chris Laprun
Chris Laprun [http://community.jboss.org/people/claprun] created the discussion
"Upgrading from AS 5.1 to AS 6 WS error"
To view the discussion, visit: http://community.jboss.org/message/602718#602718
--------------------------------------------------------------
My web service that was properly working on AS 5.1 is now broken on AS 6 with seemingly a problem matching generated stub methods and WSDL definition. I get the following error and based on some googling, it would seem that re-generating the stubs using CXF instead of JBoss WS would solve the issue. I would like to avoid re-generating the stubs if at all possible so I'm wondering if I might be missing something.
I first get a warning:
14:47:29,105 WARN [org.apache.cxf.service.factory.ReflectionServiceFactoryBean] Could not unwrap Operation {urn:oasis:names:tc:wsrp:v2:intf}register to match method "public abstract void org.oasis.wsrp.v2.WSRPV2RegistrationPortType.register(org.oasis.wsrp.v2.RegistrationData,org.oasis.wsrp.v2.Lifetime,org.oasis.wsrp.v2.UserContext,javax.xml.ws.Holder,javax.xml.ws.Holder,javax.xml.ws.Holder,javax.xml.ws.Holder) throws org.oasis.wsrp.v2.MissingParameters,org.oasis.wsrp.v2.OperationFailed,org.oasis.wsrp.v2.OperationNotSupported"
then an error:
14:47:29,175 ERROR [org.jboss.wsf.common.invocation.InvocationHandlerJAXWS] Method invocation failed with exception: wrong number of arguments: java.lang.IllegalArgumentException: wrong number of arguments
[...]
14:47:29,189 WARN [org.apache.cxf.phase.PhaseInterceptorChain] Application {urn:oasis:names:tc:wsrp:v2:wsdl}WSRPService#{urn:oasis:names:tc:wsrp:v2:intf}register has thrown exception, unwinding now: org.apache.cxf.interceptor.Fault: wrong number of arguments
[...]
Caused by: java.lang.IllegalArgumentException: wrong number of arguments
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [:1.6.0_24]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [:1.6.0_24]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [:1.6.0_24]
at java.lang.reflect.Method.invoke(Method.java:597) [:1.6.0_24]
at org.jboss.wsf.common.invocation.AbstractInvocationHandlerJSE.invoke(AbstractInvocationHandlerJSE.java:102) [:1.4.1.GA]
at org.jboss.wsf.stack.cxf.AbstractInvoker._invokeInternal(AbstractInvoker.java:164) [:3.4.1.GA]
What gives?
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/602718#602718]
Start a new discussion in JBoss Web Services at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
13 years, 6 months
[JBoss Web Services] - Problems using WS-Security encryption...
by mauro.brasil
mauro.brasil [http://community.jboss.org/people/mauro.brasil] created the discussion
"Problems using WS-Security encryption..."
To view the discussion, visit: http://community.jboss.org/message/590162#590162
--------------------------------------------------------------
Hello there!
We have an application environment here working with JBossWS and WS-Security enabled on server side and Axis2c (with rampartc for security) on client side.
For start, we developed all the solution using just UserNameToken security and all was fine.
We decided to enable wsse encryption in order to improve communication security and, since then, I'm stucked on the same problem.
The server throwns an exception on the moment it receives the first message, like below:
Caused by: java.security.cert.CertificateParsingException: signed overrun, bytes = 67
at sun.security.x509.X509CertImpl.parse(Unknown Source)
at sun.security.x509.X509CertImpl.<init>(Unknown Source)
at sun.security.provider.X509Factory.engineGenerateCertificate(Unknown Source)
at java.security.cert.CertificateFactory.generateCertificate(Unknown Source)
at sun.security.provider.JavaKeyStore.engineLoad(Unknown Source)
at sun.security.provider.JavaKeyStore$JKS.engineLoad(Unknown Source)
at java.security.KeyStore.load(Unknown Source)
at org.jboss.ws.extensions.security.SecurityStore.loadStore(SecurityStore.java:158)
After two days of constant searching trying/validating almost everything I've found about this issue, I decided to post a message here so someone can maybe give me just a hint to were to start digging.
I followed the chapter 9 of "JBoss In Action" to create the keystores/truststores/certificates and to configure my environment ("jboss-wsse-server.xml", because other files were already defined to WS-Security) without any success.
I've found sugestions about missing parameters on keytool usage, orientation regarding some sort of update of java encryption (adding JCE and BouncyCastle provider implementation), but nothing seems to work or make sense.
If someone have any idea of solution I'll be very thankfull.
Best regards,
Mauro.
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/590162#590162]
Start a new discussion in JBoss Web Services at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
13 years, 6 months