Text File Utilities

Overview

Reads data from a text file (any extension encoded as text) into a string, with an option to preserve line breaks.

 

Anonymous
  • The Smart Service "Append Text to File" still does not work and does not append the text provided to the document. Reverting to version to 2.0.0 resolves this issue. 

  • v3.0.2 Release Notes
    • Fixing issue with readtextfromfile reading from oldest version of document instead of current version
  • Hello,

    We've found the following  bug in the ReadTextFileExpression function in version 3.0.1 of the plugin  related to the new file system api management.   

    Indeed, instead of using  cs.getDocumentInputStream(txtFile), you should 

    use cs.getDocumentInputStream(cs.getVersionId(txtFileId, ContentConstants.VERSION_CURRENT)) otherwise the behaviour is very strange (mix of version and documentid content)

    Regards 

     

  • yes, I am also experiencing issues with the new version of the plugin. Nothing has changed in our implementation and this functionality was working for us with the old version of the plugin. Now it is throwing error in the logs.


    2024-10-23 10:17:25,298 [Appian Work Item - 794645 - WorkID 292 - execution02 - process 2775155 - model 12462 : UnattendedJavaActivityRequest] ERROR com.appiancorp.ps.plugins.textutilities.AppendTextToFile - java.lang.NullPointerException: Cannot invoke "com.appiancorp.suiteapi.content.ContentService.download(java.lang.Long, java.lang.Integer, java.lang.Boolean)" because "cs" is null
    java.lang.NullPointerException: Cannot invoke "com.appiancorp.suiteapi.content.ContentService.download(java.lang.Long, java.lang.Integer, java.lang.Boolean)" because "cs" is null
    	at com.appiancorp.ps.plugins.textutilities.AppianUtils.getDocumentFromAppian(AppianUtils.java:15)
    	at com.appiancorp.ps.plugins.textutilities.AppendTextToFile.run(AppendTextToFile.java:48)
    	at com.appiancorp.process.runtime.framework.DefaultActivityExecutor$1.lambda$call$0(DefaultActivityExecutor.java:138)
    	at com.appiancorp.plugins.PluginUsageLogger.runWithPluginInformation(PluginUsageLogger.java:54)
    	at com.appiancorp.process.runtime.framework.DefaultActivityExecutor$1.call(DefaultActivityExecutor.java:138)
    	at com.appiancorp.process.runtime.framework.DefaultActivityExecutor$1.call(DefaultActivityExecutor.java:132)
    	at com.appiancorp.common.ContextClassLoaderSwitcher.runInContext(ContextClassLoaderSwitcher.java:30)
    	at com.appiancorp.process.runtime.framework.DefaultActivityExecutor.execute(DefaultActivityExecutor.java:132)
    	at com.appiancorp.process.engine.UnattendedJavaActivityRequest.execute(UnattendedJavaActivityRequest.java:101)
    	at com.appiancorp.process.engine.UnattendedJavaActivityRequestResponseCreator.getJavaActivityResultResponse(UnattendedJavaActivityRequestResponseCreator.java:23)
    	at com.appiancorp.process.engine.UnattendedJavaActivityRequest.getJavaActivityResultResponse(UnattendedJavaActivityRequest.java:80)
    	at com.appiancorp.process.engine.UnattendedJavaActivityRequest.execute0(UnattendedJavaActivityRequest.java:67)
    	at com.appiancorp.common.persistence.data.AppianDataUserContextProvider.executeWithConsistentDataReads(AppianDataUserContextProvider.java:143)
    	at com.appiancorp.process.engine.ProcessContinuationRequest.executeOuter(ProcessContinuationRequest.java:68)
    	at com.appiancorp.process.engine.ActivityRequest.executeOuter(ActivityRequest.java:41)
    	at com.appiancorp.process.engine.ContinuationRequest.execute(ContinuationRequest.java:136)
    	at com.appiancorp.process.engine.AsyncEnabledActivityRequest.execute(AsyncEnabledActivityRequest.java:22)
    	at com.appiancorp.process.workpoller.UnattendedRequestHandlerBean.onMessage(UnattendedRequestHandlerBean.java:36)
    	at com.appiancorp.process.workpoller.WorkItem.run(WorkItem.java:110)
    	at org.springframework.jca.work.SimpleTaskWorkManager$DelegatingWorkAdapter.run(SimpleTaskWorkManager.java:241)
    	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
    	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
    	at java.base/java.lang.Thread.run(Thread.java:840)

  • v3.0.1 Release Notes
    • Adding in logging for errors in AppendTextToFile
  • Are you able to share the document and what you are appending? My tests of this smart service have completed successfully so it's probably related to your particular use case.

  • The Smart Service "Append Text to File" has stopped working with release 3.0.0 !!

  • v3.0.0 Release Notes
    • Updating deprecated ContentService apis
  • Now that Appian 24.1 is out, is updating this plugin still on the roadmap?

  • In the 23.2 release, Appian introduced modernized file management APIs that offer a cleaner abstraction layer for easier file handling within Appian. We simultaneously announced that we are deprecating some older APIs. We are aware of the utilization of deprecated APIs within some AppMarket plug-ins that work with documents. As part of our commitment to ensuring compatibility, we anticipate all Appian-authored plug-ins currently using deprecated APIs to be updated for API compatibility by the 24.1 General Availability (GA) release. We also proactively work with Partner plug-in authors to ensure all AppMarket plug-ins have optimal performance and functionality. 

    If you have any questions or require AppMarket assistance, please don't hesitate to reach out by sending an email to appmarket@appian.com.