Fetching data via event

Hi All,

I have a query. I am saving some details to the data store in one process and a task is assigned to someone. In other process  the person is supposed to see that saved information in read only format. I have created both the PM but not able to figure out ,how to connect them . So that when assignee click the task ,the other process should start and he is able to see the information in read only and takes his decision. Please reply

  Discussion posts and replies are publicly visible

  • 0
    Certified Lead Developer

    Can you help me understand your case better as in why wait to save the data until user clicks on task? You can simply write the required data to db as and when you have data. Then query that and display on the task UI.

  • 0
    A Score Level 1
    in reply to Harsha Sharma

    I am saving information for the request leave in DB with status field pending. So when user see in record he can see status pending.  when supervisor log-in and see the task for approval or reject along with request info.When he approves/rejects it ,it's again saved with status approved. It is done to separate a single process in two different processes as single process might not end if supervisor delays his action.

  • 0
    Certified Lead Developer
    in reply to rahulm

    In that case, say process A is the process that saves leave request data to DB and status as Pending. Then Process B be the process where task is generated for supervisor to accept/reject the task. 

    If I understood your scenario correctly,in order to achieve the expected functionality you need to have the primary key (that you get after saving the data in process A) or the entire cdt containing data of the request passed in to the process B. Using this requestId you can query the db data in process B and pass that data to the UI node. On click of approve or reject button by the supervisor, save appropriate data in the status field of the request cdt. After the node, add write to db node with same primary key value, so that it updates the existing record with correct status.

    Hope this helps.