Skip to Main Content
InterSystems Ideas

Have an idea, suggestion, or something that doesn’t work as expected in InterSystems products or services? Share it here on the InterSystems Ideas Portal.

The Ideas Portal is where community members can propose improvements, report bugs, and help influence the product roadmap across InterSystems products and the overall developer experience. 22% of submitted ideas are implemented by InterSystems or members of the Developer Community.

💡 Ideas and bugs are both welcome, no matter how big or small. You can submit feature requests, usability improvements, workflow suggestions, and bug reports. Whether you’re an experienced expert or just getting started, your fresh perspective is valuable.

🛠️ About bugs and fixes. If you have access to InterSystems WRC, please submit bugs there for immediate action. Bug reports submitted through the Ideas Portal are reviewed and tracked, but do not guarantee immediate resolution.

Start by sharing what could be better - the community and our teams will help take it from there.

Status Future consideration
Created by Stefan Cronje
Created on Feb 13, 2023

Automatic XML Formatting of XData in DTL, BPL and Rulesets

The basic idea is that when a DTL, BPL or ruleset is edited on the SMP, that is formats the XML in the XData block.

With large DTL, Rulesets and BPL, it is sometimes easier to open the class, collapse some sections of the XML and check the flow. Proper formatting will assist in this.

  • ADMIN RESPONSE
    Nov 20, 2024

    Thank you for submitting the idea. The status has been changed to "Future consideration".

    Stay tuned!

  • Robert Barbiaux
    Oct 5, 2025

    A real treat for vscode users editing classes that rely on XData blocks for code generation such as interop productions, business rules etc.

    Support for text media types other than xml would be great (e.g. : application/json, think Open API specifications) 😃

  • Admin
    Vadim Aniskin
    Jun 3, 2024

    Stefan, thanks for the clarification. I returned the status as "Needs review". I hope the product managers will provide feedback on your idea soon.

  • Stefan Cronje
    Jun 3, 2024

    When a DTL, Ruleset or BPL is saved, the XML lines are all at the same level.
    We have DTLs that are 2000 lines long and it is easier to edit as XML than using the DTL editor. If the XML was formatted, it will be easier. We reformet these, but if the DTL editor is used at any point, it changes all the formatting again. The same applies to rulesets and BPL.

    Example of requirement:
    Currently the XML looks like this after saving on the DTL editor.

    XData DTL [ XMLNamespace = "http://www.intersystems.com/dtl" ]
    
    {
    <transform sourceClass='CMSLibrary.ExtSP.Hyphen.File.SOCS.RETURN.CRM.Batch.Batch' targetClass='CMSLibrary.Messages.EnsReq.Transformation.Generic.GenericStagedChannelRspFile' create='new' language='objectscript'>
    <assign value='source.Trailer.NoOfTransactions' property='target.Trailer.RecordCount' action='set'/>
    <assign value='source.Trailer.Value/100' property='target.Trailer.CheckTotal' action='set'/>
    <foreach property='source.TransactionRecord()' key='k1'>
    <if condition='..In(source.TransactionRecord.(k1).TRTP,"Q2HDR,Q2TRL")'>
    <false>
    <assign value='$Increment(RecIndex)' property='RecIndex' action='set'/>
    <assign value='1' property='target.DetailRecords.(RecIndex).CollectionMethod' action='set'/>
    <assign value='source.TransactionRecord.(k1).USRF2' property='target.DetailRecords.(RecIndex).ReferenceNumber' action='set'/>
    <assign value='source.TransactionRecord.(k1).%ClassName(1)' property='target.DetailRecords.(RecIndex).DetailClassName' action='set'/>
    <assign value='source.TransactionRecord.(k1).%Id()' property='target.DetailRecords.(RecIndex).DetailId' action='set'/>
    <assign value='source.TransactionRecord.(k1).ERRC' property='target.DetailRecords.(RecIndex).ChannelReplyCode' action='set'/>
    <assign value='$select(source.TransactionRecord.(k1).CNPAYD="":"",1:$zdh(source.TransactionRecord.(k1).CNPAYD,3))' property='target.DetailRecords.(RecIndex).EffectiveDate' action='set'/>
    <assign value='$select(source.TransactionRecord.(k1).DDTE="":"",1:$zdh(source.TransactionRecord.(k1).DDTE,3))' property='target.DetailRecords.(RecIndex).ExpectedDate' action='set'/>
    <assign value='"000085000"' property='target.DetailRecords.(RecIndex).ChannelConfirmedService' action='set'/>
    <if condition='..In(source.TransactionRecord.(k1).DOCT,"S1,S3,,S5,S7")'>
    <true>
    <assign value='source.TransactionRecord.(k1).AMTR/100' property='target.DetailRecords.(RecIndex).Amount' action='set'/>
    </true>
    <false>
    <if condition='source.TransactionRecord.(k1).DOCT = "SN"'>
    <true>
    <assign value='0000000000' property='target.DetailRecords.(RecIndex).ReferenceNumber' action='set'/>
    </true>
    <false>
    <if condition='source.TransactionRecord.(k1).DOCT = "S8"'>
    <true>
    <assign value='0000000000' property='target.DetailRecords.(RecIndex).ReferenceNumber' action='set'/>
    <assign value='-target.DetailRecords.(RecIndex).Amount' property='target.DetailRecords.(RecIndex).Amount' action='set'/>
    </true>
    <false>
    <assign value='0000000000' property='target.DetailRecords.(RecIndex).ReferenceNumber' action='set'/>
    <assign value='-target.DetailRecords.(RecIndex).Amount' property='target.DetailRecords.(RecIndex).Amount' action='set'/>
    </false>
    </if>
    </false>
    </if>
    </false>
    </if>
    </false>
    </if>
    </foreach>
    </transform>
    }

    What I would like it to look like:

    XData DTL [ XMLNamespace = "http://www.intersystems.com/dtl" ]
    
    {
    <transform sourceClass='CMSLibrary.ExtSP.Hyphen.File.SOCS.RETURN.CRM.Batch.Batch' targetClass='CMSLibrary.Messages.EnsReq.Transformation.Generic.GenericStagedChannelRspFile' create='new' language='objectscript'>
    <assign value='source.Trailer.NoOfTransactions' property='target.Trailer.RecordCount' action='set'/>
    <assign value='source.Trailer.Value/100' property='target.Trailer.CheckTotal' action='set'/>
    <foreach property='source.TransactionRecord()' key='k1'>
    <if condition='..In(source.TransactionRecord.(k1).TRTP,"Q2HDR,Q2TRL")'>
    <false>
    <assign value='$Increment(RecIndex)' property='RecIndex' action='set'/>
    <assign value='1' property='target.DetailRecords.(RecIndex).CollectionMethod' action='set'/>
    <assign value='source.TransactionRecord.(k1).USRF2' property='target.DetailRecords.(RecIndex).ReferenceNumber' action='set'/>
    <assign value='source.TransactionRecord.(k1).%ClassName(1)' property='target.DetailRecords.(RecIndex).DetailClassName' action='set'/>
    <assign value='source.TransactionRecord.(k1).%Id()' property='target.DetailRecords.(RecIndex).DetailId' action='set'/>
    <assign value='source.TransactionRecord.(k1).ERRC' property='target.DetailRecords.(RecIndex).ChannelReplyCode' action='set'/>
    <assign value='$select(source.TransactionRecord.(k1).CNPAYD="":"",1:$zdh(source.TransactionRecord.(k1).CNPAYD,3))' property='target.DetailRecords.(RecIndex).EffectiveDate' action='set'/>
    <assign value='$select(source.TransactionRecord.(k1).DDTE="":"",1:$zdh(source.TransactionRecord.(k1).DDTE,3))' property='target.DetailRecords.(RecIndex).ExpectedDate' action='set'/>
    <assign value='"000085000"' property='target.DetailRecords.(RecIndex).ChannelConfirmedService' action='set'/>
    <if condition='..In(source.TransactionRecord.(k1).DOCT,"S1,S3,,S5,S7")'>
    <true>
    <assign value='source.TransactionRecord.(k1).AMTR/100' property='target.DetailRecords.(RecIndex).Amount' action='set'/>
    </true>
    <false>
    <if condition='source.TransactionRecord.(k1).DOCT = "SN"'>
    <true>
    <assign value='0000000000' property='target.DetailRecords.(RecIndex).ReferenceNumber' action='set'/>
    </true>
    <false>
    <if condition='source.TransactionRecord.(k1).DOCT = "S8"'>
    <true>
    <assign value='0000000000' property='target.DetailRecords.(RecIndex).ReferenceNumber' action='set'/>
    <assign value='-target.DetailRecords.(RecIndex).Amount' property='target.DetailRecords.(RecIndex).Amount' action='set'/>
    </true>
    <false>
    <assign value='0000000000' property='target.DetailRecords.(RecIndex).ReferenceNumber' action='set'/>
    <assign value='-target.DetailRecords.(RecIndex).Amount' property='target.DetailRecords.(RecIndex).Amount' action='set'/>
    </false>
    </if>
    </false>
    </if>
    </false>
    </if>
    </false>
    </if>
    </foreach>
    </transform>
    }
  • Admin
    Vadim Aniskin
    May 24, 2024

    Stefan, thank you so much for your idea. Could you please answer the questions from Product Manager to clarify this idea:

    • Visual Studio supports XML formatting, is that still insufficient? If so, how?

    • The interoperability editors are currently being reworked and the goal is to remove the need to drop back into the code for certain activities (like moving actions around)