Please help. How to handle multiple requests by different users which one is which
See original GitHub issueHello @sfmskywalker,
I do not want to use signal activity.
I have implemented Employee leave workflow. Where multiple employee can submit leave request to their managers.
Let me explain through example. when employee1 generate request which is now waiting for approval. The 2nd employee2 generate request. Every thing is fine but when any manager perform action on leave request all other requests are moved to Fault State. I am setting correlation Id and also checking for correct correlate Id. I can’t handle multiple requests. I have attached workflow with this post.
I will make your life easy. Just import attached workflow and perform below employee actions using Postman.
Employee 1 Leave Request Post Below Json data using Postman Post URI: http://localhost:5683/leaverequest
{
"WorkflowId":"Leave_1",
"RecordId": "1",
"EntityName":"EmployeeLeave",
"Applicant": {"Name": "Employee1", "Email": "qamar@abc.com"},
"Sender": {" Name": "Employee1", "Email": "qamar@abc.com"},
"Recipient": {"Name":"manager", "Email":"manager@abc.com"},
"Action": "Initiated",
"WorkflowStatus": "Start",
"WorkflowDescription": "Leave Application submitted by ${Request.Sender.Name}",
"Remarks": "Urgent work at home"
}
WorkflowId: is used to set correlation id RecordId: Employee leave record id Action: user action performed possible actions (Initiated, Rejected, Forwarded, Withdrawn, Deleted, Approved etc.) WorkflowStatus: the state of workflow which is used by our application possible states (Start, InProgress, Correction, Denied, Canceled, Complete etc.) Employee 2 Leave Request
Post URI: http://localhost:5683/leaverequest
{
"WorkflowId":"Leave_2",
"RecordId": "2",
"EntityName":"EmployeeLeave",
"Applicant": {"Name": "Employee2", "Email": "employee2@abc.com"},
"Sender": {" Name": "Employee2", "Email": "employee2@abc.com"},
"Recipient": {"Name":"manager", "Email":"manager@abc.com"},
"Action": "Initiated",
"WorkflowStatus": "Start",
"WorkflowDescription": "Leave Application submitted by Employee2",
"Remarks": "Urgent work at home"
}
No issues till now but when manager perform action all other requests are moved to Fault state. Lets do it
Manager Action When manager perform action on any request Post action request on the following Uri Note action URL is change Post URI: http://localhost:5683/leaveaction
{
"WorkflowId":"Leave_2",
"RecordId": "2",
"EntityName":"EmployeeLeave",
"Applicant": {"Name": "Employee2", "Email": "employee2@abc.com"},
"Sender": {" Name": "manager", "Email": "manager@abc.com"},
"Recipient": {"Name":"Employee2", "Email":"employee2@abc.com"},
"Action": "Approved",
"WorkflowStatus": "Complete",
"WorkflowDescription": "Leave Application submitted by Employee2",
"Remarks": "Urgent work at home"
}
Due to manager action all other requests are moved to Fault state. Only one request that is performed by Manager is fulfilled others are in Fault State.
I do not know how to use UserTask activity. I tried to use Trigger activity but without any luck.
Please help how to use Httprequest with user actions with multiple employee requests.
I highly appreciate your help
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (3 by maintainers)
Top GitHub Comments
Hi @sfmskywalker,
Yes you are right it will not work on all cases. Also it is not efficient way because it loops through all instances. A correlationId or workflow instance Id would be ideal with HTTP request which will execute only instance based on workflow instance id or correlation id.
@sniperwolfpk5 I’m closing this issue because I think we’ve come to a good conclusion and created a separate issue to track development of it. Feel free to reopen this one if there’s anything we need to follow up on. Thanks!