Closed HasanBsone closed 3 weeks ago
I need more details to reproduce the issue. You are running multiple parallel workflow instances from rest api and sometimes you get an error and sometimes it works? right?
Can you describe what your workflow does? is it a long running workflow so multiple instances are runninng in parallel? You can simulate this with Wait task.
basically what we are doing is we are calling same workflow again and again through restapi so multiple instances are running of workflow but those restvariables keys are same but with different values. our workflow is just simply saving a data in database and finished so it's not long running workflow.We are actually doing is that we are saving data in our database and on our saving method which is devexpress builtin method we are running your wexflow. and wexflow task is saving the data in other table.
For Example if 10 objects is going to save in database so for each object on save method will call restapi for running wexflow
Unhandled exception. System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
---> System.ArgumentException: An item with the same key has already been added. Key: 3
at System.Collections.Generic.Dictionary2.TryInsert(TKey key, TValue value, InsertionBehavior behavior) at System.Collections.Generic.Dictionary
2.Add(TKey key, TValue value)
at Wexflow.Core.Task..ctor(XElement xe, Workflow wf) in /_/src/netcore/Wexflow.Core/Task.cs:line 87
at Wexflow.Tasks.CreateTaskCommissionIssue.CreateTaskCommissionIssue..ctor(XElement xe, Workflow wf)
at InvokeStubCreateTaskCommissionIssue..ctor(Object, Span`1)
at System.Reflection.MethodBaseInvoker.InvokeWithFewArgs(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
--- End of inner exception stack trace ---
at System.Reflection.MethodBaseInvoker.InvokeWithFewArgs(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture)
at System.Activator.CreateInstance(Type type, Object[] args)
at Wexflow.Core.Workflow.Load(String xml) in //src/netcore/Wexflow.Core/Workflow.cs:line 584
at Wexflow.Core.Workflow.StartSync(String startedBy, Guid instanceId, Boolean& resultWarning) in /_/src/netcore/Wexflow.Core/Workflow.cs:line 1018
at Wexflow.Core.Workflow.<>c__DisplayClass204_0.
i am using 6.0.0 nuget package wexflow and i am hitting same workflow again and again with restapi call
I have done some testing on the latest version (7.9) and couldn't reproduce your issue.
Can you show me your workflow in XML format?
Task Ids must be unique, Make sure you have unique integer values for your task id in your workflow.
I have shared the xml format the there is only one task in my workflow when two thread accessing same workflow then this thing is happen.i am saving data in database in my task on every restapi call when i put thread.sleep in between restapi calls so error chances are totally less.
if you want me to show this issue on my PC so we can also do this..
@HasanBsone I reproduced and fixed the issue. I released a patch: v8.0
Test it and let me know if the issue is resolved on your side as well.
Thank's alot i will try then let you know.. will it be working on .net 6.0? because we are using .Net 6.0
I released a new patch for this issue: v8.1
You should test with this one.
Hello Aelassas this nuget package is not fully compatiable with .net6.0 will it work for me in testing? i am starting testing
No you need .net 8.0 or above.
The Bug is fixed i am not getting taskitem library error. i am using wexflow 6.0 nuget with your given wexflow server new patch.But some times when we continuously hit restapi i am not getting RestVariables in some api call.please assist
But some times when we continuously hit restapi i am not getting RestVariables in some api call.please assist
Open a new issue for that.
We are trying to Run workflow instances from restapi so we are getting error like this the item 1 is already added in The Dictionary and Some time's my values are not present in rest variables and sometime's it's running fine can you please guide