[JBoss jBPM] - Is this a bug/weird coding/am I reading this wrong?
by pjodev
I am looking at the code for JbpmConfiguration.java, specifically the getInstance(String resource) method. It appears that even if you pass in a specific resource (filename) it will STILL attempt to use the defaults at first.
public static JbpmConfiguration getInstance(String resource) {
|
| JbpmConfiguration instance = null;
|
| synchronized(instances) {
| if (resource==null) {
| resource = "jbpm.cfg.xml";
| }
|
| instance = (JbpmConfiguration) instances.get(resource);
| if (instance==null) {
|
| if (defaultObjectFactory!=null) {
| log.debug("creating jbpm configuration from given default object factory '"+defaultObjectFactory+"'");
| instance = new JbpmConfiguration(defaultObjectFactory);
|
| } else {
|
| try {
| log.info("using jbpm configuration resource '"+resource+"'");
| InputStream jbpmCfgXmlStream = ClassLoaderUtil.getStream(resource);
|
| ObjectFactory objectFactory = parseObjectFactory(jbpmCfgXmlStream);
| instance = createJbpmConfiguration(objectFactory);
|
| } catch (RuntimeException e) {
| throw new JbpmException("couldn't parse jbpm configuration from resource '"+resource+"'", e);
| }
| }
|
| instances.put(resource, instance);
| }
| }
|
| return instance;
| }
this line
ObjectFactory objectFactory = parseObjectFactory(jbpmCfgXmlStream);
Goes to the method
| protected static ObjectFactory parseObjectFactory(InputStream inputStream) {
| log.debug("loading defaults in jbpm configuration");
| ObjectFactoryParser objectFactoryParser = new ObjectFactoryParser();
| ObjectFactoryImpl objectFactoryImpl = new ObjectFactoryImpl();
| objectFactoryParser.parseElementsFromResource("org/jbpm/default.jbpm.cfg.xml", objectFactoryImpl);
|
| if (inputStream!=null) {
| log.debug("loading specific configuration...");
| objectFactoryParser.parseElementsStream(inputStream, objectFactoryImpl);
| }
|
| return objectFactoryImpl;
| }
Now it looks like it attempts to build the entire configuration from the default.jbpm.cfg.xml file which is giving me that Message.hbm.xml error What the hell is Message.hbm.xml? WHERE DO I USE IT? (see my other post!!!)
Wouldn't it be better form to try the inputStream first, then if that fails, try to load the default?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4037339#4037339
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4037339
19 years
[JBoss Seam] - Form submit using javascript and how to send to a handler?
by tony.herstell@gmail.com
Given:
| <h:selectOneRadio id="advertType" required="true"
| value="#{advertisingCampaignController.campaign.advert.type}" onchange="doSubmit()">
| <s:selectItems value="#{advertisingCampaignController.campaign.advert.advertTypes}"
| var="advertType" label="#{messages[advertType.label]}" />
| <s:convertEnum />
| </h:selectOneRadio>
|
I want to do a form sumbit on the change event to a handler (advertisingCampaignController.handleAdvertChoiceChange) so that I can re-display a page which will contain the updated model...
This allows me to hide components I don't want displayed
| <s:fragment rendered="#{advertisingCampaignController.campaign.advert.type == advertisingCampaignController.campaign.advert.advertTypes[0]}">
|
[0] maps to the first choice from the selectOneRadio as it maps to an enum.
Anyon know who I can do this?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4037337#4037337
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4037337
19 years