Hi All,
Firstly, sorry if this is duplicate question. I could not able find from discussion tab.
There is a scenario where we need to store UserName who accepts the task . So, the user who accepts the task needs to be captured after completion of task. The user who accepts the task (i.e tp!owner) needs to be stored in a db field. i have tried many times but in process variable i could see 'Null' value and not storing in DB column.
PFA. code snippet. kindly help me
one of the process model.
below script task i have configured like this and storing into CDT entity checkerid field.
after success process model run status.
before task assigned to user the process variable properties showing like this status is = Assigned and CheckerId= null values.
from below screen print i have accepted task and approved. now status got updated to Approved.
the next flow is to update task owner property to CheckerId field. but noting showing here. but i could see my name is reflecting under process nodes properties
could you please help where to change code to get updated username post accpet task.
Discussion posts and replies are publicly visible
Probably the statusUpdate PV is getting overwritten may be during the status update script task or write to DSE if you are saving stored value back to the statusUpdate PV. I never faced any issue storing tp!owner to a PV.
Hi,
As per suggetion, i have removed script task and i given "tp!owner" in User Input task output tab to store the checkerid value. still same issue gettig
Can you check that you are storing in text field or not.
Yes, i am storing text field only.
Strange it's working for me. Can you try with process report and pass the taskId. This method might help
I did a minimal test. Works like a charm. Version 23.4
Thanks for detailed explanation. however still it is not working even i am using 23.4 platform version.
i used below highlighted code in interface Form and passing value when user submitted the form. it is working fine and value is storing into DB.
But, this is not actually my requirement i need to pass the value from the user input task tab using process variables.
primaryButtons: { a!buttonWidget( label: "Approve", submit: true, value: true, saveInto: { ri!submit, a!save(ri!requestStatus.status, "Approved"), a!save(ri!requestStatus.checkerid, {user(username: loggedInUser(), property: "firstName")&" "& user(username: loggedInUser(), property: "lastName")}) } )
The person submitting the form and the owner of the task will always be the same. You so you can rely on this. Also, instead of firstName and lastName, use the username. That is unique to every user in the system.
And try using this from next time for better readability.
I want you to create a separate minimal process. Just a single UIT, no interface. Only store tp!owner to a PV in data outputs. Verify that this works.
Then we can continue with our investigations.
Yes, i tested this. i could see task owner name is storing PV in process history tab.
Now, what's the difference? Could it be that you just overwrite your data modifications as the UIT completes? Please share all the configurations for data inputs/outputs of that UIT.
Keep in mind, that any output data operation at node completion time is performed in a non-deterministic order. Storing tp!owner to a individual field might be overwritten by the "save into" configuration on data inputs.
Yes, i think it could be overwriting in Data input tab.
here is the full process model configuration.
Step 1: I have created one main process flow like below and calling "KT Approval Process" in End node as shown in below screen shot
Approval process call configuration.
Step 2: KT Approval Process flow and process variables.
Step 3: UIT input tab
Step 4: UIT Output data tab
Actually, before calling KT Approval Process model already data is getting into(pv-statusIpdate) from existing process model variable(pv- requestData) and same status field is getting updated after UIT task is performed.
Yeah, that's the issue. The "save into" config in data inputs conflicts with the custom output in data outputs.
In such a case, I suggest to just store the output of loggedinuser() to that field in the saveInto config of the submit button.
yup. already i did this in form while submitting user form it's working as expected.
Anyway, i really thanks to you investigating on this. And, also thanks to all who are provided your solution.