[jboss-user] [JBoss jBPM] - Custom instantiator specified with 'config-type' on a Delega

pirx do-not-reply at jboss.com
Thu Aug 2 11:47:53 EDT 2007


I'm using a custom instantiator for action delegation by specifying the fully qualified class name like in 



  | <action config-type="com.consol.cmas.workflow.jbpm.exe.SpringInstantiator"
  |               class="com.consol.cmas.projects.it.workflow.development.AssignCallToReviewerActionHandler"/>
  | 

According to the relevant code in the Delegation class this should work (and indeed worked in some pre 3.2 versions):


  | Instantiator instantiator = null;
  |     try {
  |       // find the instantiator
  |       instantiator = (Instantiator) instantiatorCache.get(configType);
  |       if (instantiator == null) {
  |         // load the instantiator class
  |         Class instantiatorClass = classLoader.loadClass(configType);
  |         // instantiate the instantiator with the default constructor
  |         instantiator = (Instantiator) instantiatorClass.newInstance();
  |         instantiatorCache.put(configType, instantiator);
  |       }
  |     } catch (Exception e) {
  |       log.error(e);
  |       throw new JbpmException("couldn't instantiate custom instantiator '" + configType + "'", e);
  |     }
  | 

However, now I get an validation error on the xml stating:


  | org.jbpm.jpdl.JpdlException: [[ERROR] line 39: cvc-enumeration-valid: Value 'com.consol.cmas.workflow.jbpm.exe.SpringInstantiator' is not facet-valid with respect to enumeration '[field, bean, constructor, configuration-property]'. It must be a value from the enumeration.,  

and indeed, the schema declaration looks like:


  |  <xs:attribute name="config-type" default="field">
  |         <xs:simpleType>
  |           <xs:restriction base="xs:string">
  |             <xs:enumeration value="field"/>
  |             <xs:enumeration value="bean"/>
  |             <xs:enumeration value="constructor"/>
  |             <xs:enumeration value="configuration-property"/>
  |           </xs:restriction>
  |         </xs:simpleType>
  |       </xs:attribute>
  | 

My question is, whether it is possible to relax the schema restriction in order to use a custom instantiator again ? Or is there now another possibility for custom instantiation of action handler ?

I'm using jbpm-jpdl 3.2.1

thanx ...

...roland huss




View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4070165#4070165

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4070165



More information about the jboss-user mailing list