[jBPM] - jbpm4.4, how to get property from custom activity in jPDL(xml)
by Mead Lai
Mead Lai [http://community.jboss.org/people/meadlai] created the discussion
"jbpm4.4,how to get property from custom activity in jPDL(xml)"
To view the discussion, visit: http://community.jboss.org/message/624702#624702
--------------------------------------------------------------
jbpm4.4,how to get property from custom activity in jPDL(xml)
================
<custom id="Act_2" name="myCustomTask" class="com.meadlai.CustomActivity" point="309,70" memo="">
<property name="form"><string value="99801"/></property>
<property name="mark"><string value=""/></property>
<property name="model"><string value="2"/></property>
</custom>
===============
I know I can get property "model" in the class:"com.meadlai.CustomActivity" by coding:
public class CustomActivity{
private String model; //getter & setter to get the property
private String mark;
...
execute(){...}
...
}
===============
but, I need to get it in another way, just with taskName.
EnvironmentImpl environment = ((ProcessEngineImpl) processEngine).openEnvironment();
try{
ProcessDefinitionImpl pdf = execution.getProcessDefinition();
ActivityImpl activity = pdf.getActivity(taskName);
if ("custom".equals(activity.getType())) {
Object model= activity.getProperty("model");
System.out.println("model = "+ model);
}
}catch(Exception ex){
}finally{
environment.close();
}
==============
sadly, I got "null" with this manner.
Could you please give me some clue? I am a newer.
Thanks very mcuh.
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/624702#624702]
Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
13 years, 3 months
[JNDI and Naming] - Problems with JBoss 7 and remote-interface lookup with context
by Hauke Gulich
Hauke Gulich [http://community.jboss.org/people/haukegulich] created the discussion
"Problems with JBoss 7 and remote-interface lookup with context"
To view the discussion, visit: http://community.jboss.org/message/624649#624649
--------------------------------------------------------------
Hello everyone,
|
I used to work with jboss 4.2.3 GA and there everything worked fine (at least calling the remote interface from the client side). Now I try to deploy that with Jboss 7.0.1 FINAL
I have (on the server project) this class:
@Remote(ConfigurationHelperRemote.class)
@Local(ConfigurationHelperLocal.class)
@Stateless
public class ConfigurationHelper implements ConfigurationHelperRemote, ConfigurationHelperLocal {
...
}
and I have the remote Interface
@Remote
public interface ConfigurationHelperRemote {
...
}
Now I used to call the remote interface from the client side with the help of context like this:
configurationHelper = (ConfigurationHelperRemote) ctx.lookup("ear-1.0.0/ConfigurationHelper/remote");
But this isn't working anymore. Now I get this error message
javax.naming.NameNotFoundException: Name 'ear-1.0.0' not found in context ''
My ear file is called *ear-1.0.0.ear* and the client inside is called *client-1.0.0.war* and the server is called *server-1.0.0.jar*.
This is the content of the application.xml inside the ear file
<?xml version="1.0" encoding="UTF-8"?>
<application xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/application_6.xsd" version="6">
<display-name>ear</display-name>
<module>
<web>
<web-uri>client-1.0.0.war</web-uri>
<context-root>/client</context-root>
</web>
</module>
<module>
<ejb>server-1.0.0.jar</ejb>
</module>
</application>
Where do I need to configure the context name? Or what I am doing wrong?
I just printed out all JNDI Context Information, and there is only the datasource from the database. I did this:
public static void showJndiContext( Context ctx, String name, String space )
{
if( null == name ) name = "";
if( null == space ) space = "";
try {
NamingEnumeration<NameClassPair> en = ctx.list( name );
while( en != null && en.hasMoreElements() ) {
String delim = ( name.length() > 0 ) ? "/" : "";
NameClassPair ncp = en.next();
System.out.println( space + name + delim + ncp );
if( space.length() < 40 )
showJndiContext( ctx, ncp.getName(), " " + space );
}
} catch( javax.naming.NamingException ex ) {
}
}
Thanks a lot and many greetings,
Hauke | |
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/624649#624649]
Start a new discussion in JNDI and Naming at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
13 years, 3 months
[JBoss Tools] - Timeout problem with JBoss 7.0.1.Final
by Tobias Koltsch
Tobias Koltsch [http://community.jboss.org/people/tobias81] created the discussion
"Timeout problem with JBoss 7.0.1.Final"
To view the discussion, visit: http://community.jboss.org/message/622018#622018
--------------------------------------------------------------
Hi,
when I start my JBoss with JBossAS tools inside of my eclipse, the server start correctly and prints out the message “JBoss AS 7.0.1.Final "Zap" started in 2073ms - Started 98 of 153 services (55 services are passive or on-demand)“. The start timeout is configured with 10 seconds. It seems eclipse didn't notice the server is started, and after 10 seconds I got the error message: „Starting JBoss 7.0.1.Final has encountered a problem. Server JBoss 7.0.1.Final Server failed to start“.
With JBoss 7.0.0.Final the timeout work correctly and I got the error only when I use JBoss 7.0.1.Final.
Cheers,
Tobias
My system setup:
Ubuntu 11.04 (x86_64)
JDK 1.7.0 (64 Bit)
Eclipse 3.7 with WTP 3.3
JBossAS Tools 2.3.0.v20110624-0505-H8-M2
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/622018#622018]
Start a new discussion in JBoss Tools at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
13 years, 3 months
[jBPM] - How to Send Signal Out from a WorkItemHandler?
by Bruce Cui
Bruce Cui [http://community.jboss.org/people/brucecui] created the discussion
"How to Send Signal Out from a WorkItemHandler?"
To view the discussion, visit: http://community.jboss.org/message/612163#612163
--------------------------------------------------------------
I have been trying to implement multi-threading processes with jBPM, as well as time consuming batch tasks. I found the console was executing the processes in one same main thread, at least so appeared to me, so I tried to put the task logic in a Thread instance and started it in the WorkItemHandler. For single thread but time consuming tasks, which I need to wait for the return, I also passed the ProcessInstance as a parameter, so that when the thread finished its job, it could send out a signal togher with a return Object to notify the process to move forward. And while it was running, it would't occupy the main thread for long time.
Local testing seems fine, only the job wouldn't exit after all things done. Then I put all stuf on web, but this time I met several exceptions, saying like: "java.lang.IllegalArgumentException: IOException while storing workItem 1: org.jbpm.workflow.instance.impl.WorkflowProcessInstanceImpl$1"
and "Could not commit session or rollback"
So I guess I should not pass the instance reference out, otherwise session may not be able to close or something. But is there a way to signal out from the WorkItemHandler or the Thread it starts, so that I can notify the process instance?
I see there are external signals, but it requires reference to ksession. But I didn't find a clue from either the docs or the API about acquire the ksession reference properly. Could you be so kind to help me out here? Or else I'll have to give up, since time consuming tasks running in the same main thread together will surely be a nightmare.
Thanks,
Bruce
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/612163#612163]
Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
13 years, 3 months