Deleting the source files from a ftp server

Question: Is there a way to delete a file from the ftp server with a plugin? I’m going to assume that a plugin won’t execute when the flow is in abort mode and skipping activities

Answer: Use the below specified script in “Service Exception Dialog” option available at right click on Target activity in Process Designer

import com.adeptia.indigo.transaction.*;
import com.adeptia.indigo.utils.*;
import com.adeptia.indigo.system.*;

try{
ObjectAddress transactionAddress = service.getTransactionAddress();
Transaction transaction = (Transaction) RemoteMBeanProxy.create(Transaction.class, transactionAddress);
transaction.setJtaRollback();
}catch(Exception e){
e.printStackTrace();
throw e;
}

Please note that the Target activity should be within JTA block, and Delete On Success option is enabled for the source activity.

Have more questions? Submit a request

0 Comments

Article is closed for comments.