2 Replies Latest reply on Feb 16, 2006 2:36 PM by brianmb99

    problem with field configuration with assignment and decisio

    brianmb99

      Hello,

      I use the field configuration feature for many of my action handlers (example:

      <event type="node-enter">
       <action name="do my action" class="com.mycompany.MyActionHandler">
       <myactionclassfieldname>value</myactionclassfieldname>
       </action>
      </event>
      )

      which works great, but I want to do the same thing with AssignmentHandlers and DecisionHandlers. I'm using graphical editor 3.0.5, which lets me configure fields for assignment handlers, generating:

      <task name="my task name">
       <assignment class="com.mycompany.MyAssignmentHandler" config-type="bean">
       <myassignmentclassfieldname>test</myassignmentclassfieldname>
       </assignment>
      </task>


      but when I try to deploy this processdef (using v 3.0.2 - I'm not ready to upgrade yet) I'm confronted with:

      [deploypar] 17:23:17,337 DEBUG JpdlXmlReader : process definition line 27: cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'myassignmentclassfieldname'.


      and the following stack trace:

      [deploypar] at org.jbpm.jpdl.xml.JpdlXmlReader.readProcessDefinition(JpdlXmlReader.java:119)
      [deploypar] at org.jbpm.jpdl.par.JpdlArchiveParser.readFromArchive(JpdlArchiveParser.java:27)
      [deploypar] at org.jbpm.jpdl.par.ProcessArchive.parseProcessDefinition(ProcessArchive.java:46)
      [deploypar] at org.jbpm.graph.def.ProcessDefinition.parseParZipInputStream(ProcessDefinition.java:154)
      [deploypar] at org.jbpm.jpdl.par.ProcessArchiveDeployer.deployZipInputStream(ProcessArchiveDeployer.java:46)
      [deploypar] at org.jbpm.ant.DeployParTask.deploy(DeployParTask.java:69)
      [deploypar] at org.jbpm.ant.DeployParTask.execute(DeployParTask.java:38)
      [deploypar] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
      [deploypar] at org.apache.tools.ant.Task.perform(Task.java:364)
      [deploypar] at org.apache.tools.ant.Target.execute(Target.java:341)
      [deploypar] at org.apache.tools.ant.Target.performTasks(Target.java:369)
      [deploypar] at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216)
      [deploypar] at org.apache.tools.ant.Project.executeTarget(Project.java:1185)
      [deploypar] at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:40)
      [deploypar] at org.apache.tools.ant.Project.executeTargets(Project.java:1068)
      [deploypar] at org.apache.tools.ant.Main.runBuild(Main.java:668)
      [deploypar] at org.apache.tools.ant.Main.startAnt(Main.java:187)
      [deploypar] at org.apache.tools.ant.launch.Launcher.run(Launcher.java:246)
      [deploypar] at org.apache.tools.ant.launch.Launcher.main(Launcher.java:67)
      .

      I've also tried configuring decisionhandlers this way by hand-editing the jpdl with the same result. I've tried using bean config instead of field config with the same result.

      Is this just not supported by the schema despite the graphical editor's willingness to write the xml this way? Or is there something I'm missing?

      Thanks!

      -Brian

        • 1. Re: problem with field configuration with assignment and dec
          brianmb99

          The second code example should be config-type field by default instead of explicitly config-type bean, like:

          <task name="my task name">
           <assignment class="com.mycompany.MyAssignmentHandler">
           <myassignmentclassfieldname>test</myassignmentclassfieldname>
           </assignment>
          </task>


          • 2. Re: problem with field configuration with assignment and dec
            brianmb99

            Ok, I figured out my problem. Apparently there are at least two versions of the jpdl-3.0.xsd distributed. The version that I was using to deploy my processes did not have

            processContents="lax"
            specified for the assignment element sequence. I added processContents="lax" and things worked fine, then I noticed that that jpdl-3.0.xsd distributed with the 3.1 jbpm (I'm still using 3.0.2) had processContents="lax" for the sequence in the assignment element and others.

            So:

            <xs:element name="assignment">
             <xs:annotation>
             <xs:documentation>Controls the behavior of assigning a task to an identity.</xs:documentation>
             </xs:annotation>
             <xs:complexType>
             <xs:sequence>
             <xs:any processContents="lax" minOccurs="0" maxOccurs="unbounded">


            instead of

            <xs:element name="assignment">
             <xs:annotation>
             <xs:documentation>Controls the behavior of assigning a task to an identity.</xs:documentation>
             </xs:annotation>
             <xs:complexType>
             <xs:sequence>
             <xs:any minOccurs="0" maxOccurs="unbounded">


            solves this problem.

            I'm fine now, just posting this in case anyone else runs across the same thing.

            -Brian