[jboss-user] [jBPM] - jbpm4.4, how to get property from custom activity in jPDL(xml)

Mead Lai do-not-reply at jboss.com
Mon Sep 5 04:16:15 EDT 2011

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>

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;

but, I need to get it in another way, just with taskName.

EnvironmentImpl environment = ((ProcessEngineImpl) processEngine).openEnvironment();
    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){


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

Start a new discussion in jBPM at Community

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20110905/95de9a57/attachment-0001.html 

More information about the jboss-user mailing list