1
votes

I have a expression component that creates a object of type string array for processing a delete request to salesforce. But the flow fails every time it goes beyond the expression.

The error I see on console is:

Could not find a transformer to transform "SimpleDataType{type=[Ljava.lang.String;, mimeType='/'}" to "CollectionDataType{type=java.util.List, itemType=java.lang.Object, mimeType='/'}".

 <sub-flow name="DeleteAspenOrderInfo" doc:name="DeleteAspenOrderInfo">
    <expression-component doc:name="Expression">    ArrayList queryresponse =flowVars['DeleteOidList'];
int size=queryresponse.size();
String[] idArray=new String[size];
int i=0;
for(HashMap map  : queryresponse) 
{
String aValue = map.get("Id");
idArray[i]=aValue;
i++;
}

payload= idArray;</expression-component>
    <sfdc:delete config-ref="SalesforceConnector" doc:name="Salesforce">
        <sfdc:ids ref="#[payload]"/>
    </sfdc:delete>
    <custom-transformer class="com.aspen.transformer.AOIDeleteTransformer" doc:name="Java"/>
</sub-flow>

Kindly advise if there is an alternate way to undertake this.

1
Add the mule config as well to help understand the issue better.user1760178
Edited to include config information.SanSharma

1 Answers

1
votes

According to the connector's JavaDoc, the delete method has this signature:

public List<DeleteResult> delete (List<String> ids)

Therefore, change your expression component to output a List<String> instead of a String[].