[jBPM] - How to define result mapping or exit action that saves task owner
by jemmerling
jemmerling [https://community.jboss.org/people/jemmerling] created the discussion
"How to define result mapping or exit action that saves task owner"
To view the discussion, visit: https://community.jboss.org/message/648536#648536
--------------------------------------------------------------
Hi,
This should be simple for any non-novice, it was suggested before however without an example.
So I have a process variable and I want a particular task to store its owner into that variable (say its name is "task2owner"). Is there an expression for that, for example:
task2owner=#{taskOwner}
So if there is a standard expression for the task owner (the above is just a guess at what it might be) then this result mapping would allow subsequent tasks to determine who owned (and completed) task2.
Failing that, I could try defining an on exit action, using kcontext I can get the node instance which I think has a one-to-one correspondence to the task, however the node instance does not seem to have an attribute that explicitly identifies the owner. Perhaps the owner is a variable?
Any suggestion would be greatly appreciated.
Thanks!
--JE
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/648536#648536]
Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
13 years, 6 months
[JBoss Messaging] - How to list or monitor messages in a Queue which is already under use
by Aneesh Sebastian
Aneesh Sebastian [https://community.jboss.org/people/aneeshsebastian] created the discussion
"How to list or monitor messages in a Queue which is already under use"
To view the discussion, visit: https://community.jboss.org/message/720125#720125
--------------------------------------------------------------
I have a requirement to monitor a JBoss messaging queue, where users should be able to delete posted messages dynamically. The application has a MDPOJO registered and is up and running at server start up.
My requirement is, users should be able to delete a posted message any time he wishes. I tried below proto codes :
*Option1*
public void listAllJMS_Messages()
{
try {
ObjectName objectName=new ObjectName("jboss.messaging.destination:name=XXX,service=Queue");
List ls = (List) server.invoke(objectName, "listMessages" , null, null);
List<javax.jms.Message> messages=(List<javax.jms.Message>)server.invoke(objectName, "listAllMessages" , null, null);
int count=0;
for(javax.jms.Message msg : messages) {
System.out.println((++count)+"t"+msg.getJMSMessageID());
if(msg.getJMSType() != null && msg.getJMSType().equalsIgnoreCase("Text")) {
TextMessage text = (TextMessage)msg;
System.out.println(text.getText());
}
}
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
// System.out.println((++count)+"t"+msg.getText());
}
*Option2*
public void listMsg() {
String destinationName = "queue/XXX";
Context ic = null;
ConnectionFactory cf = null;
Connection connection = null;
try {
ic = getInitialContext();
cf = (ConnectionFactory)ic.lookup("/ConnectionFactory");
Queue queue = (Queue)ic.lookup(destinationName);
connection = cf.createConnection();
Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
QueueBrowser qbrowser = session.createBrowser(queue);
Enumeration<?> qamsgs = qbrowser.getEnumeration();
while (qamsgs.hasMoreElements()){
Message msg = (Message)qamsgs.nextElement();
}
connection.start();
}
catch(Exception e)
{
System.out.println(e);
}
finally
{
if(ic != null)
{
try
{
ic.close();
}
catch(Exception e1)
{
System.out.println(e1);
}
}
}
}
In both the options,messages are getting listed in case of no message consumers at present.If have a live message consumer MDB, then list is returned as null.
I defintely need MDB consumer up and running.But still need to monitor messages.I should be able to do below :
1. List messages]
2. Delete a particular message
3. Change priority
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/720125#720125]
Start a new discussion in JBoss Messaging at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
13 years, 7 months
[jBPM] - Commit transaction after each service task?
by Richard Evans
Richard Evans [https://community.jboss.org/people/r3vans] created the discussion
"Commit transaction after each service task?"
To view the discussion, visit: https://community.jboss.org/message/742450#742450
--------------------------------------------------------------
Hello there,
JBPM 5.1 on Tomcat, persistence configured in Spring
I have a number of processes, each with a series of service tasks punctuated by timers.
I would like to persist process data after every service task to be confident that it is recoverable on catastrophic failure. I find, though, that data is committed only at timers and end of process. Is it possible to take control of transactions at a more granular level to get jbpm to commit more regularly?
My config..
<bean class="org.springframework.orm.jpa.JpaTransactionManager"
id="transactionManager">
<property name="entityManagerFactory" ref="entityManagerFactory" />
</bean>
<tx:annotation-driven mode="aspectj"
transaction-manager="transactionManager" />
<bean class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean"
id="entityManagerFactory">
<property name="persistenceUnitName" value="persistenceUnit" />
<property name="dataSource" ref="dataSource" />
</bean>
<bean class="org.springframework.orm.jpa.JpaTransactionManager"
id="transactionManager">
<property name="entityManagerFactory" ref="entityManagerFactory" />
</bean>
<drools:jpa-persistence>
<drools:transaction-manager ref="transactionManager" />
<drools:entity-manager-factory ref="entityManagerFactory" />
</drools:jpa-persistence>
Thanks,
Richard
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/742450#742450]
Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
13 years, 7 months
[JBoss Web Services] - java.lang.Error: Undefined operation name <x>, when <x> was removed from interface (wsdl)
by Barry Schader
Barry Schader [https://community.jboss.org/people/barryaz1] created the discussion
"java.lang.Error: Undefined operation name <x>, when <x> was removed from interface (wsdl)"
To view the discussion, visit: https://community.jboss.org/message/742537#742537
--------------------------------------------------------------
What I did:
* Removed two completely unused methods from a class that represents a web service interface (we had a sloppy contractor who left his trash in the interface code...)
* Updated the WSDL file to remove the methods
* Committed those changes into our local SVN
* Ran a complete regression test (using Hudson, JUnit) -> PASSED
But when I attempt to run any of the *same JUnit tests* within the JBoss Dev Studio environment, I get a stack trace that begins with:
junit.framework.AssertionFailedError: Exception in constructor: testFetchProduct_PRE001_01 (java.lang.Error: Undefined operation name checkDMAS
at com.sun.xml.ws.model.JavaMethodImpl.freeze(JavaMethodImpl.java:305)
at com.sun.xml.ws.model.AbstractSEIModelImpl.freeze(AbstractSEIModelImpl.java:73)
at com.sun.xml.ws.model.RuntimeModeler.buildRuntimeModel(RuntimeModeler.java:230)
at com.sun.xml.ws.client.WSServiceDelegate.addSEI(WSServiceDelegate.java:588)
at com.sun.xml.ws.client.WSServiceDelegate.getPort(WSServiceDelegate.java:291)
at com.sun.xml.ws.client.WSServiceDelegate.getPort(WSServiceDelegate.java:274)
at com.sun.xml.ws.client.WSServiceDelegate.getPort(WSServiceDelegate.java:267)
at javax.xml.ws.Service.getPort(Service.java:92)
at com.medtronic.mes.FacadeService_Service.getFacadeServicePort(FacadeService_Service.java:50)
I seem to be unable to make eclipse (or JBDS?) *forget* about the "checkDMAS" method. There are no references to it anywhere that I can find within the JUnit code, yet *every* JUnit test case causes the same stack trace. I have 'cleaned' the project in every way that I know how -- but I will admit that my experience with eclipse (and JBDS) is weak.
Thanks in advance for any help you can provide.
Barry Schader
Phoenix, AZ
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/742537#742537]
Start a new discussion in JBoss Web Services at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
13 years, 7 months