[jBPM] - JBPM5 Task completion through API
by npereira
npereira [http://community.jboss.org/people/npereira] created the discussion
"JBPM5 Task completion through API"
To view the discussion, visit: http://community.jboss.org/message/604788#604788
--------------------------------------------------------------
Hi forum,
I have an piece of java code that is completing the Tasks through the API.
But I have facing an issue, the ideia is that on completion of a task I complete it with a new set of parameteres.
For that matter I have to put the HashMap into the Content Object, and only then, complete the task.
Here is the problem, whenever I do this, either being throuh client.SetDocumentContent or client.complete, this new data never gets persisted to the following activity.
This is my code,
//Creates a new Content to Fit in the Task
HashMap newMap = new HashMap();
newMap.put("TFirst", 1234);
newMap.put("TSecond", "blabla");
Object newObj = (Object)newMap;
ByteArrayOutputStream bos = new ByteArrayOutputStream();
ObjectOutputStream oos = new ObjectOutputStream(bos);
oos.writeObject(newObj);
oos.flush();
oos.close();
bos.close();
byte[] newByteContent = bos.toByteArray ();
Content neWContent = new Content();
neWContent.setContent(newByteContent);
//Sets content on Task
client.setDocumentContent(task.getId(), neWContent, sresponseHandler);
//Completes the task
BlockingTaskOperationResponseHandler qweresponseHandler = new BlockingTaskOperationResponseHandler();
ContentData cd = new ContentData();
cd.setContent(newByteContent);
client.complete(task.getId(), userID, cd, qweresponseHandler);
Am I missing something?
Best regards,
Nelson
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/604788#604788]
Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
13 years, 1 month
[JBoss AOP] - Inconsistencies between two environments
by Earnest Dyke
Earnest Dyke [http://community.jboss.org/people/earnest.dyke] created the discussion
"Inconsistencies between two environments"
To view the discussion, visit: http://community.jboss.org/message/604742#604742
--------------------------------------------------------------
Greetings all,
I have create a simple aspect (see below) which is deployed as a .jar file and the associated *-aop.xml file (also below). If I deploy these on my local EAP 5.0 32-bit server with JDK 1.6.0 I get all of the logged methods executions I expect. If I deploy the same .jar and *-aop.xml to my EAP 5.0 64-bit server I only get some of the method executions logged. I have set verbose=true in conf/bootstrap/aop.xml but see nothing that would indicate why this is happening.
Any one have any ideas? I am stuck at this point.
Thanks in advance for any and all pertinent responses.
Earnie!
TimingAspect.java
package com.ferguson.performance;
import java.lang.reflect.Method;
import org.jboss.aop.joinpoint.MethodInvocation;
import org.jboss.logging.Logger;
public class TimingAspect {
private static Logger log = Logger.getLogger(TimingAspect.class);
private static Long cnt = 01l;
public Object timeExection(MethodInvocation invocation) throws Throwable {
long id = 0l;
String method = null;
if (invocation.getTargetObject() == null) { // static method call
Method m = invocation.getActualMethod();
String[] classParts = m.getDeclaringClass().getName().split("\\.");
String[] methodParts = m.getName().split("\\$");
method = m.getDeclaringClass().getName() + "."
+ methodParts[classParts.length];
} else {
method = invocation.getTargetObject().getClass().getName() + "."
+ invocation.getMethod().getName();
}
synchronized (cnt) {
cnt++;
id = cnt;
}
long startTime = System.currentTimeMillis();
log.info("Start: " + id + " " + method);
try {
return invocation.invokeNext();
} catch (Exception e) {
log.error("Timing error",e);
return null;
} finally {
long endTime = System.currentTimeMillis();
log.info("End: " + id + " " + (endTime - startTime));
}
}
}
*-aop.xml deployed separately.
<?xml version="1.0" encoding="UTF-8"?>
<aop xmlns="urn:jboss:aop-beans:1.0">
<aspect class="com.ferguson.performance.TimingAspect" />
<bind pointcut="execution(* com.ferguson.gateway.business.*->*(..)) OR execution(* com.ferguson.gateway.dao.*->*(..))">
<around aspect="com.ferguson.performance.TimingAspect" name="timeExection" />
</bind>
</aop>
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/604742#604742]
Start a new discussion in JBoss AOP at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
13 years, 1 month
[JNDI and Naming] - Bind external ejbs to jndi
by Anita Albert
Anita Albert [http://community.jboss.org/people/anitaalbert] created the discussion
"Bind external ejbs to jndi"
To view the discussion, visit: http://community.jboss.org/message/605037#605037
--------------------------------------------------------------
We have two jboss servers (say A and B) running. Is it possible to have ejbs deployed on server A to bind to the naming service on server B? The goal is that clients on server A should not have to do a remote look up to call interfaces on this ejb. I initially tried using ExternalContext and defining an MBean but realized I have to change the way I do the look up to actually call any interface on the ejb. Is there anyway I can specify either -
1. On server A - to configure ejbs to also bind to the naming service on B while getting deployed.
or
2. On server B - to configure jndi so that the jndi name indirectly points to jnp://serverB:1099/jndi name
Any pointers to any documentation will be really appreciated. Thanks.
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/605037#605037]
Start a new discussion in JNDI and Naming at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
13 years, 1 month