elsa-workflows / elsa-core

A .NET workflows library
https://v3.elsaworkflows.io/
MIT License
6.41k stars 1.19k forks source link

Consume interface type by ReceiveMassTransitMessage #520

Closed rezabashiri closed 3 years ago

rezabashiri commented 3 years ago

It seems elsa wont be trigger after masstransit consumed by an interface type .

I mean when elsa configured to be aware of interface message type it wont trigger ReceiveMassTransitMessage activity while im pretty sure message have been consumed but ReceiveMassTransitMessage wont trigger

rezabashiri commented 3 years ago

After a hard work day i found the reason "why ReceiveMasstransitMessage activity wont be triggered if type is interface ?" and its because of await workflowInvoker.TriggerAsync( activityType, input, correlationId?.ToString(), x => ReceiveMassTransitMessage.GetMessageType(x) == message.GetType(), context.CancellationToken); }

at ReceiveMassTransitMessage.GetMessageType(x) return type with prefix of GreenPipes.DynamicInternal that make it not equal to message.GetType() so returning false cause not triggering halted workflow

sfmskywalker commented 3 years ago

Nice find! It looks like with the way the MessageType property is serialized it loses information upon deserialization. Odds are this won’t be an issue in Elsa 2, which has a different implementation where type information is maintained. Let’s leave this issue open so we can confirm once the MassTransit activities are ported to Elsa 2 as well.

rezabashiri commented 3 years ago

when will be final release of Elsa 2 ?

sfmskywalker commented 3 years ago

I'm hoping before the end of Q1 2021. Most of the parts are already there, except for the designer + dashboard (which is under development as we speak).

sfmskywalker commented 3 years ago

This now works as of Elsa 2.