How to run dependant tasks even after independent tasks failing? - dependency-management

I want to know if there is a way to run dependant task even if the other tasks have failed. I had found a way to do it using:
Default = new ExitOptions
{
DependencyAction = DependencyAction.Satisfy
}
The problem arose when the class ExitOptions did not have the property in Azure Batch dll version 5.0.0.0. Could someone suggest an alternative or the version which has the property?

The problem arose when the class ExitOptions did not have the property in Azure Batch dll version 5.0.0.0.
You could try to update the version of Azure.Batch to greater than or equal to 6.0.0.0. Then yo could get the DependencyAction property you want.

Related

How can I invoke a task module on handleTeamsMessagingExtensionSelectItem(...)?

I am building a messaging extension app for MS Teams using the Teams-Toolkit in Visual Studio Code. I have been able to launch task modules from the message context without a problem but is there a way to launch a task module from handleTeamsMessagingExtensionSelectItem(context, obj)? The goal is for the user to select an item from the query list which triggers a new task module where they can fill out and submit a form (adaptive card).
For more visibility, adding the answer from the comment section:
Task module can be opened using TaskModuleResponse return type.
Only TeamsTaskModuleFetchAsync() method supports TaskModuleResponse return type.
TeamsMessagingExtensionSelectItemAsync() method return type can be MessagingExtensionResponse only. As this response type can't be changed.
So, overall not feasible.

Custom Module is being used by batch classes and cannot be removed

I would like to remove my custom module from the Kofax administration module but I can't because I get the following error
Using the module multiple times increases the amount of batch classes listed there. But there is only one batch class so this can't be.
I removed the module from the batch class queue, stopped all background services and have no forms app running. The only way to remove this module is to export the batch class, delete it in the administration module, delete the custom module and reimport the batch class.
Maybe I don't exit the application properly?
My session management:
public void LoginToRuntimeSession()
{
login = new Login();
login.EnableSecurityBoost = true;
login.Login();
login.ApplicationName = Resources.CUSTOM_MODULE_ID;
login.Version = "1.0";
login.ValidateUser($"{Resources.CUSTOM_MODULE_ID}.exe", false);
session = login.RuntimeSession;
}
public void Logout()
{
session.Dispose();
login.Logout();
}
I get a new active batch with this code
public IBatch GetNextBatch()
{
return session.NextBatchGet(login.ProcessID);
}
and this is how I process the batch after polling for new ones
public void ProcessBatch(IBatch batch)
{
// ... IACDataElement stuff
batch.BatchClose(KfxDbState.KfxDbBatchReady, KfxDbQueue.KfxDbQueueNext, 0, "");
}
Any ideas how to fix this "bug"? Please let me know if you need more information!
The message you are seeing is only referring to the configuration in the Administration module. Therefore it is not related to what your module actually does when it is running or closing (no problem in your code can cause this).
If you are using Kofax Capture 11, previous published versions of the batch class remain in the system, so these probably still count as references to the module. If you go to the Publish dialog window, you can click the "Versions..." button to see and delete older versions. Try to remove your module again after you have deleted all the older versions that were still using it.
Additionally, you can look through the batch class properties to make sure that this module isn't set in one of the other settings, such as the module to start foldering on the Foldering tab, or the module to start Partial Batch Export on the Advanced tab.
If neither of those suggestions work, then you may want to open a case with Kofax Technical Support. One thing that either they or you can do is open the admin.xml file in the exported batch class cab file and see where your module ID is found. That will give context for finding out what is still referencing the module.

SearchDomainFactory.Instance is obsolete: 'Inject me!' ( Can't find out how to create instance)

I'm in the process of trying to migrate a R# extension project from R# 6 to R# 8. (I've taken over a project that someone wrote, and I'm new to writing extensions.)
In the existing v6 project there is a class that derives from RenameWorkflow, and the constructor used to look like this;
public class RenameStepWorkflow : RenameWorkflow
{
public RenameStepWorkflow(ISolution Solution, string ActionId)
: base(Solution, ActionId)
{
}
This used to work in R# SDK v 6, but now in V8, RenameWorkflow no longer has a constructor that takes Solution and actionId. The new constructor signature now looks like this;
public RenameWorkflow(
IShellLocks locks,
SearchDomainFactory searchDomainFactory,
RenameRefactoringService renameRefactoringService,
ISolution solution,
string actionId);
now heres my problem that I need help with (I think)
I've copied the constructor, and now the constructor of this class has to satisfy these new dependancies. Through some digging I've managed to find a way to satisfy all the dependencies, except for 'SearchDomainFactory'. The closest I can come to instantiating via the updated constructor is as follows;
new RenameStepWorkflow(Solution.Locks, JetBrains.ReSharper.Psi.Search.SearchDomainFactory.Instance, RenameRefactoringService.Instance, this.Solution, null)
All looks good, except that JetBrains.ReSharper.Psi.Search.SearchDomainFactory.Instance is marked as Obsolete, and gives me a compile error that I cannot work around, even using #pragma does not allow me to compile the code. The exact error message I get when I compile is Error 16 'JetBrains.ReSharper.Psi.Search.SearchDomainFactory.Instance' is obsolete: 'Inject me!'
Obvious next question..ok, how? How do I 'inject you'? I cannot find any documentation over this new breaking change, in fact, I cannot find any documentation (or sample projects) that even mentions DrivenRefactoringWorkflow or RenameWorkflow, (the classes that now require the new SearchDomainFactory), or any information on SearchDomainFactory.Instance suddenly now obsolete and how to satisfy the need to 'inject' it.
Any help would be most appreciated! Thank you,
regards
Alan
ReSharper has its own IoC container, which is responsible for creating instances of classes, and "injecting" dependencies as constructor parameters. Classes marked with attributes such as [ShellComponent] or [SolutionComponent] are handled by the container, created when the application starts or a solution is loaded, respectively.
Dependencies should be injected as constructor parameters, rather than using methods like GetComponent<TDependency> or static Instance properties, as this allows the container to control dependency lifetime, and ensure you're depending on appropriate components, and not creating leaks - a shell component cannot depend on a solution component for instance, it won't exist when the shell component is being created.
ReSharper introduced the IoC container a few releases ago, and a large proportion of the codebase has been updated to use it correctly, but there are a few hold-outs, where things are still done in a less than ideal manner - static Instance properties and calls to GetComponent. This is what you've encountered. You should be able to get an instance of SearchDomainFactory by putting it as a constructor parameter in your component.
You can find out more about the Component Model (the IoC container and related functionality) in the devguide: https://www.jetbrains.com/resharper/devguide/Platform/ComponentModel.html

coded ui waitforcontrolready not working on VSTT2013 but worked on VSTT2010

I meet the following issues after migration from VSTT2010 to 2013:
all my ....WaitForControlReady(3000); throw exception object reference not defined to object reference
e.g:
UIMap.UIIdentificationWindowWindow.UIIdentificationDocument4.WaitForControlReady(3000);
Is waiting for a popup to be displayed
MonNavigateur.WaitForControlReady();
with:
public static BrowserWindow MonNavigateur; declared in the class
and: MonNavigateur = BrowserWindow.Launch(new Uri(sAppConfigExtranetUri)); in MyTestInitialize() method
I worked like a charm in VSTT2010 ;(
The temporary workaround used is to replace all my WaitForControlReady(); with a not satisfying Playback.Wait(x000);
Anyone has an idea to solve this problem please?
Make sure you upgrade your reference assemblies to the latest version. WaitForControlReady() should be a part of the Microsoft.VisualStudio.TestTools.UITesting assembly. Version 12.0 would be required to run in VS2013.

The specified target migration '201201230637551_Migration' does not exist?

I'm using EntityFramework 4.3 beta version and its Data Migration facility. I wrote following code for generating a custom Migration and apply it to the DB.
MigrationScaffolder ms=new MigrationScaffolder(configuration);
ScaffoldedMigration scaffoldedMigration= ms.Scaffold("Migration");
DbMigrator dbMigrator = new DbMigrator(configuration);
dbMigrator.Update(scaffoldedMigration.MigrationId);
Scaffolding function worked fine and generated a Migration correctly.
But an exception comes up and says
"The specified target migration '201201230637551_Migration' does not
exist. Ensure that target migration refers to an existing migration
id."
Does this happen since still this is a beta version? Can someone help me to solve this.
Thank you.
This is not because you were using a beta version. MigrationScaffolder class is only to generate a configuration class. That generated file is not being added to the solution automatically. If we want to pass it into DbMigrator.Update() method, we should add the generated file into the solution first. Then we should make an instance of that class, and pass it into the update() method like this.
{
DbMigrationsConfiguration myConfiguration=new MyConfiguration();
DbMigrator dbMigrator = new DbMigrator(configuration);
dbMigrator.Update(myConfiguration);
}
Here MyConfiguration is the generated class.
Additionally, you do not need to apply migrations into your project this way. Instead you can use:
{
DbMigrationsConfiguration myConfiguration=new DbMigrationsConfiguration(){
AutomaticMigrationsEnabled = true;
AutomaticMigrationDataLossAllowed = true;
}
DbMigrator dbMigrator = new DbMigrator(configuration);
dbMigrator.Update(myConfiguration);
}

Resources