Cannot deploy DataWeave scripts

Issue #2319 resolved
Matej Mercina created an issue

I’ve just started playing around with Apex Dataweave, and I’ve stumbled upon two issues.

a) In a Developer Release Preview org (hosted on GS0 instance), the IC2 menu option to create a new Dataweave Script is available, and works as expected - a new dw folder is added with the script and xml file.

However, when trying to deploy via Save, nothing happens. When trying to deploy via Deploy All, the file is not detected as a candidate.

b) In any other, non-prerelease Developer org I’ve tried, the menu option appears but is greyed out.

I’ve also tried to deploy the script using SFDX force:mdapi:deploy command which executed successfully, and I was able to run the script in Apex.

Official response

  • Scott Wells repo owner

    Okay, the latest provided information helped. Evidently the metadata describe information returned for this type by the Metadata API is incomplete and doesn’t include the dw metadata file suffix. That prevented it from deploying properly in a metadata format project, though it’s fine in a source format project because evidently the Salesforce CLI already included a workaround for this.

    I’m implemented a fix for this malformed API response to be included in tomorrow’s build of IC2. In the interim, it should work properly in a source format project. I’ll also let the person responsible for this feature at Salesforce know about the issue so that it can be resolved properly in the API response.

Comments (7)

  1. Scott Wells repo owner

    Hi. First, please make sure that you’re on the latest build of IC2. Note that in pre-Spring '23 orgs, the DataWeaveInApex feature must be explicitly enabled resulting in the DataWeave namespace and DataWeave.Result/Script types in the OST. If those are not present, you’ll see the New > DataWeave Script option as disabled. In Spring '23 orgs, that explicit feature enablement is no longer necessary. If necessary, regenerate your OST and confirm that you see that namespace and the associated classes in the OST:

    Also make sure that IC2 has the latest list of metadata from the org using the Refresh toolbar button or the Update now link as DataWeaveResource is a new metadata type with this feature:

    With those steps, I’m able to work with DataWeave scripts in both Winter ‘23 and Spring '23 orgs. Please let me know if you don’t see the same.

  2. Matej Mercina reporter

    @Scott Wells I’ve done the following:

    1. Regenerated Full OST
    2. Pulled down all the source in the manifest, which includes DataWeaveResource
    3. This appears to have fixed the greyed-out issue, but the changes are not getting deployed upon save, nor can I deploy it using Deploy Modified or Deploy All (as it simply does not appear in the list)

    I’m using v2.2.5.6

    I’ve also tried completely deleting the project and starting from scratch and there’s no difference.

  3. Scott Wells repo owner

    Okay, the latest provided information helped. Evidently the metadata describe information returned for this type by the Metadata API is incomplete and doesn’t include the dw metadata file suffix. That prevented it from deploying properly in a metadata format project, though it’s fine in a source format project because evidently the Salesforce CLI already included a workaround for this.

    I’m implemented a fix for this malformed API response to be included in tomorrow’s build of IC2. In the interim, it should work properly in a source format project. I’ll also let the person responsible for this feature at Salesforce know about the issue so that it can be resolved properly in the API response.

  4. Log in to comment