When to use Write to Data Store Entity Smart Service and expression function a!writeToDataStoreEntity()

Hello everyone, my team and I are currently exploring writing our data into the database however, we are unsure if we should make use of the process model to write to db or the expression rule function a!writeToDataStoreEntity() provided by Appian. We read up the documentation but it doesnt really highlight the major differences or the preferred scenario to use either one of the methods. One major difference that we thought of is that if we make use of the smart service in the process model, a process instance will be created upon runtime which will essentially help us to track and debug in case any error occur. Does anyone know what are the differences and when is preferred use one over the other? 

  Discussion posts and replies are publicly visible

Parents
  • +1
    Certified Lead Developer

    Hi  

     If the use case is something where an external system calls an API exposed by Appian and the API needs to return a primary key or generated database key in response, using a!writeToDataStoreEntity() will be a good choice. 

    I assume you have an use case where there is a UI and the data input needs to be written into DB. The process instance will consume memory until the time of archival/deletion where as using a!writeToDataStoreEntity(), the consumed memory might be released as soon as the database write operation is completed. So in this aspect a!writeToDataStoreEntity() seems to be a preferable choice,  But if the use case has multiple data modification/manipulation after input data collected from UI, it is best to go with process model in order to track and debug the changes, however with a limited archival settings for the process. But if this is a simple DB write operation where we don't expect lot of data manipulation or any other simultaneous operation or where we know there are least chances things might go wrong, a!writeToDataStoreEntity is a good option.

     

     

  • Hello Arjun. Thanks for the lengthy response! now tht you have laid out certain scenarios to which use is more ideal, its clearer to me now. It makes sense that data monitoring and tracking will be more ideal when the data is going to be manipulated down the process of a certain case. for now, the fucntion seems like the better option as we dont need data manipulation. hwoever another concern is, it states in Appian documentation that the function is an asycn process as compared to the smart servcie. in the event when the db writing operation is lagging and the interface refreshes, how would user know if the saving is being done correctly/the data reflected is the new changes?

Reply
  • Hello Arjun. Thanks for the lengthy response! now tht you have laid out certain scenarios to which use is more ideal, its clearer to me now. It makes sense that data monitoring and tracking will be more ideal when the data is going to be manipulated down the process of a certain case. for now, the fucntion seems like the better option as we dont need data manipulation. hwoever another concern is, it states in Appian documentation that the function is an asycn process as compared to the smart servcie. in the event when the db writing operation is lagging and the interface refreshes, how would user know if the saving is being done correctly/the data reflected is the new changes?

Children
No Data