Uploaded image for project: 'Kuali Rice Development'
  1. Kuali Rice Development
  2. KULRICE-833

Implement a Split Node which operates using XPath

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.2
    • Fix Version/s: 2.6
    • Component/s: Development
    • Labels:
    • Rice Module:
      KEW
    • Sprint:
      Rice Sprint 2015-03-18, Rice Sprint 2015-04-15, Rice Sprint 2015-05-13
    • Story Points:
      2

      Description

      Currently, split nodes must be programmed by hand in Java. It would be ideal if we could allow for these to be "scripted" in the XML using XPath expressions or something along those lines.

      UC Irvine has shown interest in this and declarative branching seems like a good feature to have at any rate.

        Attachments

          Issue Links

            Activity

            Hide
            ewestfal Eric Westfall added a comment -

            There is an IU contribution somewhere for this (not sure if it has been integrated or not). If it hasn't been integrated yet, we should work with them to make it so. It's a handy feature.

            Show
            ewestfal Eric Westfall added a comment - There is an IU contribution somewhere for this (not sure if it has been integrated or not). If it hasn't been integrated yet, we should work with them to make it so. It's a handy feature.
            Hide
            ewestfal Eric Westfall added a comment -

            Need to get the code from IU for this contribution.

            Show
            ewestfal Eric Westfall added a comment - Need to get the code from IU for this contribution.
            Hide
            ewestfal Eric Westfall added a comment -

            Test this manually after integration pull request using one of our eDocLites

            Show
            ewestfal Eric Westfall added a comment - Test this manually after integration pull request using one of our eDocLites
            Hide
            cniesen Claus Niesen added a comment -

            From James Bennett:

            Attached is a copy of the class we have in IU Rice. It is fairly general purpose so I don’t think it would require a lot of modification to bring into the foundation code. Here’s a snippet of a document type which uses it as an example:

                    <split name="CampusSplit">
                      <activationType>P</activationType>
                      <mandatoryRoute>false</mandatoryRoute>
                      <finalApproval>false</finalApproval>
                      <type>edu.iu.es.esi.rice.kew.node.XPathSplitNode</type>
                      <branchDecisions>
                        <xpath branchName="BloomingtonBranch" expression="boolean(//data/version[@current='true']/field[@name='campus']/value='BL')" />
                        <xpath branchName="IndianapolisBranch" expression="boolean(//data/version[@current='true']/field[@name='campus']/value='IN')" />
                        <default branchName="OtherCampusBranch" />
                      </branchDecisions>
                    </split>
            

            Essentially it expects 0 or more <xpath> nodes which specify a branch name and an XPath expression which should resolve to a boolean value. It checks each xpath node independently and if it resolves to true the document will route down that branch in the workflow and if it is false the branch will be skipped. This would allow you to route to multiple branches if the xpath expressions allow it. If none of the xpath nodes are matched then it routes to one or more “default” branches specified in the configuration. The example above is from an eDocLite and essentially has the following rules:

            • If the campus value input on the form was BL (Bloomington) then follow the Bloomington branch
            • If the campus value input on the form was IN (Indianapolis) then follow the Indianapolis branch
            • If no other branches are matched then follow the OtherCampusBranch

            Let me know if you have any questions about the functionality.

            Attachment: XPathSplitNode.java

            Show
            cniesen Claus Niesen added a comment - From James Bennett: Attached is a copy of the class we have in IU Rice. It is fairly general purpose so I don’t think it would require a lot of modification to bring into the foundation code. Here’s a snippet of a document type which uses it as an example: <split name= "CampusSplit" > <activationType>P</activationType> <mandatoryRoute> false </mandatoryRoute> <finalApproval> false </finalApproval> <type>edu.iu.es.esi.rice.kew.node.XPathSplitNode</type> <branchDecisions> <xpath branchName= "BloomingtonBranch" expression= " boolean ( //data/version[@current=' true ']/field[@name='campus']/value='BL')" /> <xpath branchName= "IndianapolisBranch" expression= " boolean ( //data/version[@current=' true ']/field[@name='campus']/value='IN')" /> < default branchName= "OtherCampusBranch" /> </branchDecisions> </split> Essentially it expects 0 or more <xpath> nodes which specify a branch name and an XPath expression which should resolve to a boolean value. It checks each xpath node independently and if it resolves to true the document will route down that branch in the workflow and if it is false the branch will be skipped. This would allow you to route to multiple branches if the xpath expressions allow it. If none of the xpath nodes are matched then it routes to one or more “default” branches specified in the configuration. The example above is from an eDocLite and essentially has the following rules: • If the campus value input on the form was BL (Bloomington) then follow the Bloomington branch • If the campus value input on the form was IN (Indianapolis) then follow the Indianapolis branch • If no other branches are matched then follow the OtherCampusBranch Let me know if you have any questions about the functionality. Attachment: XPathSplitNode.java
            Hide
            shahess Shannon Hess added a comment -

            Pull request - https://github.com/kuali/rice/pull/147

            I created a simple eDocLite to use for manual testing and wanted to include the files as an example so I added them to C:\idea\rice\rice-middleware\sampleapp\src\it\resources\XPathSplitNodeEDLExample\

            If these should be removed just let me know and I can do so. I will also add them to this JIRA in case they are removed.

            Show
            shahess Shannon Hess added a comment - Pull request - https://github.com/kuali/rice/pull/147 I created a simple eDocLite to use for manual testing and wanted to include the files as an example so I added them to C:\idea\rice\rice-middleware\sampleapp\src\it\resources\XPathSplitNodeEDLExample\ If these should be removed just let me know and I can do so. I will also add them to this JIRA in case they are removed.
            Hide
            shahess Shannon Hess added a comment -

            Attaching files used to create the eDocLite examle

            Show
            shahess Shannon Hess added a comment - Attaching files used to create the eDocLite examle
            Hide
            shahess Shannon Hess added a comment -

            Re-opening to add example eDocLite to the sample application

            Show
            shahess Shannon Hess added a comment - Re-opening to add example eDocLite to the sample application
            Hide
            shahess Shannon Hess added a comment -

            Pull request has been created - https://github.com/kuali/rice/pull/163

            Show
            shahess Shannon Hess added a comment - Pull request has been created - https://github.com/kuali/rice/pull/163

              People

              • Assignee:
                shahess Shannon Hess
                Reporter:
                ewestfal Eric Westfall
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: