Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Workflow Instances #81

Closed
HasanBsone opened this issue Aug 9, 2024 · 14 comments
Closed

Workflow Instances #81

HasanBsone opened this issue Aug 9, 2024 · 14 comments
Assignees

Comments

@HasanBsone
Copy link

HasanBsone commented Aug 9, 2024

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

@HasanBsone HasanBsone changed the title Parallel Workflow Instances Workflow Instances Aug 9, 2024
@aelassas aelassas self-assigned this Aug 9, 2024
@aelassas
Copy link
Owner

aelassas commented Aug 9, 2024

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.

@HasanBsone
Copy link
Author

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

@HasanBsone
Copy link
Author

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.Dictionary2.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 InvokeStub_CreateTaskCommissionIssue..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.b__0() in /
/src/netcore/Wexflow.Core/Workflow.cs:line 992
2024-08-14 12:29:17,395 INFO [16] - [WorkflowComissionIssue / 1] Workflow started - Instance Id: cf89f49c-ab83-45d1-b9d8-1dd0b0f7fc10

@HasanBsone
Copy link
Author

HasanBsone commented Aug 14, 2024

i am using 6.0.0 nuget package wexflow and i am hitting same workflow again and again with restapi call

@aelassas
Copy link
Owner

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.

@HasanBsone
Copy link
Author

HasanBsone commented Aug 17, 2024

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.

@HasanBsone
Copy link
Author

if you want me to show this issue on my PC so we can also do this..

aelassas added a commit that referenced this issue Aug 17, 2024
@aelassas
Copy link
Owner

@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.

@HasanBsone
Copy link
Author

HasanBsone commented Aug 18, 2024

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

aelassas added a commit that referenced this issue Aug 18, 2024
@aelassas
Copy link
Owner

I released a new patch for this issue: v8.1

You should test with this one.

@HasanBsone
Copy link
Author

HasanBsone commented Aug 29, 2024

Hello Aelassas this nuget package is not fully compatiable with .net6.0 will it work for me in testing? i am starting testing

@aelassas
Copy link
Owner

No you need .net 8.0 or above.

@HasanBsone
Copy link
Author

HasanBsone commented Aug 30, 2024

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

@aelassas
Copy link
Owner

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants