Error while passing external variable in an if condition in workflow - workflow

I have a workflow containing 3 activities. The external variable that is used throughout the workflow is of type Dictionary which contains only two fields: EmailAddress and PhoneNumber(all strings). This is the screenshot of the workflow
So the scenario is that the activity GetParticipant has an outargument of type Dictionary which I am assigning to an external variable called pax. Using the if condition I am checking if the EmailAddress is provided or not.
My problem is that I am getting an error at the if condition:
Reference required to assembly 'Microsoft.WindowsAzure.Storage, Version=4.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' containing the base class 'Microsoft.WindowsAzure.Storage.Table.TableEntity'. Add one to your project.
The mentioned reference is already added to the project and the workflow also imports it. But the error remains. However giving only True as the condition works. What am I doing wrong?

Its seems some reference issue as i can see one bubble near if condition.
Check for dependency of mentioned Dll, can use nugget manager.
You can do below steps.
Delete reference of dll and import.
Clean solution and add reference and set property copy local true and import the namespace in workflow.
Rebuild the solution.

Related

How to control the WebTau report

When I first used WebTau it would produce a report file in the project directory where the WebTau tests were being run. Tests that use WebTau are no longer generating a report.
Is there a way to (manually) conrol when the report is produced?
Can I specify an output directory for this report?
Also, there is another question as to how I managed to change things and the report is no longer being generated automatically? I have moved some common code patterns into a TestingSupport project, because I found a bunch of tests were almost cut-n-paste at this ealry stage. There's no report file appearing in another directory though.
Another potential explaination is that I commented-out the #WebTau annotation on my test Class. I did that when I moved REST calling patterns to a library class. Everything works fine, of course there's no report. I'm guessing that is going to be a clue.
#WebTau annotation is essential for JUnit5 to generate the report. You need to annotate any class that you want to participate in the report.
Alternatively you can try to register global WebTau extension org.testingisdocumenting.webtau.junit5.WebTauJunitExtension following this JUnit5 guide: https://www.baeldung.com/junit-5-extensions#1-automatic-extension-registration
Use reportPath config value to change the report location
It can be specified using config file or system property override or using environment variable

Modifying an existing ecore file?

I try to do a model-to-model transformation using Epsilon. The target model is UML.
If I validate the output model in Eclipse I get the following error message:
"Element 'Activity test' must be owned, but it has no owner."
So I tried to add a statement to my ETL file that adds owners for my activities.
But:
"Internal error: java.lang.IllegalArgumentException: The feature 'owner' is not a valid changeable feature"
Do I have to modify the UML ecore file in order to make 'owner' changeable? If so, how would I do that?
What exactly should be the owner of an activity? Another model element?
Best regards.
The feature Element.owner (which Activity inherits) is a container reference. In order to set it, you have to set the opposite, which is the containment reference Element.ownedElement. The activity should be contained in your root Package or Model in the feature packagedElements.

LinqPad error with Rx.NET Observable

I'm trying to run Rx.NET inside LinqPad. I added the Rx.NET DLLs as you see in the picture.
The error that I'm seeing is
CS0103 The name 'Observable' does not exist in the current context.
How can I fix this error?
Ensure you have added the required namespaces in the "Additional Namespace Imports" tab (accessible via Ctrl-Shift-M).
For Observable you need System.Reactive.Linq.

NuGet: Possibility of adding a line of code via Powershell?

I have a few NuGet packages that I've put together, with one of them being a common project referenced by all the others.
This common project inserts a configuration class into the App_Start folder, and a method on this class is then invoked by WebActivator.
For one of the other packages I wish to add one more line of code to this method but I'm struggling to find a way to do this.
I know that I could very simply add an additional class which contains just this one line of code but I'd prefer, if possible, to use an Install.ps1 powershell script to add the line of code to the existing configuration class.
Using a pro-processed *.cs.pp file will overwrite the existing file (or add a new one), and *.cs.transform doesn't work on such a file.
I know where the class is and what it's called, and I know what the method is called, so does Powershell offer a means of adding a line to the end of said method?
This is possible but not trivial to do. You also have to be very careful since deleting someone's code from a NuGet package is not going to make them very happy.
When installing a NuGet package you have access to the Visual Studio object model (EnvDTE). The $project variable can be used to access the specific project item you need. From that you can use the FileCodeModel which represents the code in the file. You would then need to find the class and its method. Then create an edit point and insert the text.
The following will find a class called Class1 and insert a line of code into its Foo method. Note that the line of code inserted will not be correctly indented, you would need to find that out by looking at the document.
$project.ProjectItems.Item("Class1.cs")
$namespace = $item.FileCodeModel.CodeElements | ? {$_.Kind -eq 5}
$namespace.Members.Item("Class1")
$method = $class.Members.Item("Foo")
$endPoint = $method.GetEndpoint([EnvDTE.vsCMPart]::vsCMPartBody)
$editPoint = $endpoint.CreateEditPoint()
$editPoint.Insert("int a = 0;")
Also the above code does not do any error handling.

Long running workflow versioning: where and how to use OnActivityExecutionContextLoad?

We have a long running workflow which uses SQL tracking service (.Net WF 4.0). In the next update, we would like to introuduce a public property in one of the arguments of the workflow. Since this is breaking change, the persisted workflow inatances throw the following error on re-loading:
System.Runtime.DurableInstancing.InstancePersistenceCommandException: The execution of the InstancePersistenceCommand named .. LoadWorkflow was interrupted by an error.
InnerException: System.Runtime.Serialization.SerializationException: 'Element' '_x003C_BookmarkName_x003E_k__BackingField' from namespace '...' is not expected. Expecting element '....'
I understand this is a typical versioning issue and one of the recommendations I noticed on some of the sites is to override OnActivityExecutionContextLoad method and fill in the missing values. But I am not sure where and how to do this! OnActivityExecutionContextLoad is declared in System.Workflow.ComponentModel.Activity (.Net 3.5?) whereas what we have is a code-based top-level custom activity derived from System.Activities.NativeActivity (which receives the argument in question). Can something be done in this class to initialize the missing property of the argument?
All suggestions are welcome :)