Accessing data in another incomplete task

Let's say you have 2 tasks running in parallel and you wanted each person to see each other's work while they are completing it. It seems like the only way to achieve this is to put a "Save" button inside that task that writes to a CDT and returns the user to the task. Any simpler ways you can think of that doesn't involve putting a bunch of loop back in the process?

OriginalPostID-237517

  Discussion posts and replies are publicly visible

  • 0
    Certified Lead Developer
    What's the use case exactly? This sort of thing isn't standard usage in Appian, though I'm guessing if a designer is crafty, they could make use of the new a!writeToDataStore functionality combined with some sort of live update on the form. But if two users are going to be simultaneously editing let's say the same data field, it seems to me that this is setting up for big data conflict issues as one user's refreshed data overwrites the other user's changes, etc.
  • @mathieud It might sound bit weird and awkward and in fact I personally wouldn't prefer to so - But how about running a write to datastore smart service function under the editable components so that their values will be saved straight into database and querying the database in the other task? Ideally the values should be saved to ACPs and then PVs and finally into database, but as your usecase demands the data of an active task, the only solution might be to update the database as soon as the user fills in the fields in the Task. In this case you won't need a Save functionality you have described in your question as we are doing it at the field level and further we can make the user stay unaware about this(as he/she might be confused with Save vs Save Changes).
  • They are not editing the same field. They are two different tasks with separate forms. But they need to see each other's work as they complete their task.
  • @sikhivahans We are trying to avoid storing this type of data to the database.
  • Have you given a thought to using a!writeToMultipleDataStoreEntities() function? This function allows you to write data to database on saveInto of a SAIL component. This will avoid any form submission and looping back. You can choose to place a Save button on the form that invokes above function and writes data to database table without submitting a form.
  • 0
    Certified Lead Developer
    I'm not sure there's really any way to do this without storing the info to the database on some sort of realtime basis. Maybe this calls for some sort of temp data table? The only other thing I can think of is you have your SAIL forms refer directly to PV values, i.e. when one user stores a value into a field, it gets stored directly into the PV - though A) i'm not sure this will actually work as I haven't tried it (and it is certainly not best practices), and B) both user tasks would be required to be within the same process instance.
  • @mathieud I do have a fancy idea in my mind and it might be worth giving it a try:

    1. Create a process model which takes a process id and set of values (for those variables that needs to in the target process)as input parameters. Make use of the Set PV/Get PV smart services and update the desired PVs (with the values that you get from parameterised variables) in the target process which will be identified using the process id that we get as input.
    2. In the User Input Task, which you are working on, under the editable SAIL components, trigger the process created in the above step with the current process id and the values of those variables that you want to update. The output of this step is that whatever the user fills in will be updated in the process variables of the current process.
    3. Create a report on the process(from which you want to read the Task details). Use a!queryProcessAnalytics() in the other Task(parallel task as per your question) and query the required data and you should get the latest data all the time as the process created in Step - 1 keeps the PVs updated. (Note: Even if you are in the same process context for either task, don't pass PVs as arguments to Form of parallel Task. Instead, depend on a!queryProcessAnalytics to get the latest information always.)

    The above might be of use just in case if you want to strictly avoid Database and 'Save' approach(which you have described in your post) as well.
  • In case if the two tasks sit in different processes, make sure that process id of each task is available to other and on top of this, the user should be holding the minimum security privileges to see the data as the query to analytics will be made under his context.