7 Replies Latest reply on Aug 10, 2007 12:33 PM by Ronald van Kuijk

    Custom instantiator specified with 'config-type' on a Delega

    Roland Huss Newbie

      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