Would it be possible to create a UiPath Custom Activity using Powershell? - c#

In UiPath you can create Custom Activities using C# code as seen here. I dont know much about C# and I was wondering if anyone has any clue how or if its even possible to create a custom activity with Powershell and how I would do that.
Finally, any insight on how I could wrap up the code (and Im assuming corresponding dlls) into a nuGet package would be immensely helpful. Thank you in advance!
I've tried with C#. I got it to work, but as I try to do more complex things, Id like to know if I could leverage powershell as I am much more familiar with it.

The page you linked contains a step-by-step guide. You can't use PowerShell to create custom activities, you will need Visual Studio and C#. There is the free Community Edition available that you can use, but check whether the terms apply.
With VS installed, you would go ahead an create a new class library - just follow their guide.
When your activity is done you would need to deploy it as a NuGet Package, and you can use the Package Explorer to do so. This is were you would "wrap up" all binaries created - they become part of said package.
However, since you mentioned PowerShell - not knowing your precise requirements, of course - there is an activity dedicated to executing PowerShell commands in UiPath: the Invoke PowerShell activity. If you're already familiar with PS, if you have plenty of scripts lying around, just use this activity.

Related

Existing code on github, principal functions never called

I am trying to work on an addon developed by Microsoft Azure for his old Cloud Service. The aim is to render Blender scenes using the Azure environment.
Here it is : https://github.com/Azure/azure-batch-apps-blender
As Microsoft doesn't support this addon anymore, and as it was originally created to work with the old Azure, I want to update it and make it work with the new Azure. Basically, here is what I understood :
The python part is the Blender part, it defines the Blender UI, authentify the user and register the assets (Blender models ?) into Azure. Then it should start the process.
The C# part is the Azure part, aims to be executed on Azure and has a reference to an executable of Blender. It has a class to split the calculus and an other class to process the calculus.
I'm using Visual Studio 2015 and Blender 2.77a.
What I don't understand is that the code seems to be short, especially the C# one. I don't understand how the split part is done (there is no logic around the blender model) and I don't understand why the principal functions of the principal classes (like Split in JobSplitter.cs) are never called ? Did I miss some code ?
I spent some days on various general documentation around Azure, but it didn't helped me that much with this specific application. I also asked Microsoft but this product isn't supported anymore.
Thanks for your interest in the Blender plugin!
The "missing code" that you mention here is actually part of the old Batch Apps C# SDK, which exposed an interface, allowing us to override select functions with Blender specific functionality.
While I'm afraid I can't find any old documentation for it, this project should no longer be necessary, as using the Batch API, the tasks can be constructed in Python from the Blender plugin.
I've actually started porting this plugin to support the Batch API. You can find my code in the dev branch of my fork here:
https://github.com/annatisch/azure-batch-apps-blender/tree/dev
There's still a lot of things that I have yet to clean up, including the dependency checking - but I've put some instructions in the issue filed here:
https://github.com/Azure/azure-batch-apps-blender/issues/7
I'm hoping to make some progress on this project in August after Siggraph. Though I would be happy to accept any PRs!
Regarding the cloud-side code, as I mentioned above, this is now no longer necessary (though I may re-introduce something similar later for richer feature support) - as the entire cloud-side task is constructed within the plugin. The downside to this is that at present I haven't implemented the persisting of rendered frames to Azure Storage, but you can download them using the Azure Portal before the VM pool is deleted.
This plugin currently runs only Linux nodes for rendering (Ubuntu) and installs Blender dynamically with apt-get.
Please post to the Github issues board if you have any trouble using the updated plugin and I'll be happy to help. :)
Cheers

Easy update assistance

We are writing simple architectured software in C# 3.5.
What I was searching for is for easy updating framework/application...
We don't have COM components, Servicdes to install or whatever, so basically what we need is xcopy stuff form one Server side directory to the client. So what the program should do is like a workflow:
Check some location \Server\Updates for manifest.xml
Check the local setup verison
Download all available DLLs (doesn't necessary all need for complete application, so kind of patch stuff) and substitude them with "old" ones.
I'm aware of ClickOnce, of App publishing, also our setup generator supports autoamtic updates (even if noone yet used it, and I don't want to use to not strongly couple ourselfs with that technology).
Do you know some app or technology, that I'm not aware (actually listed in question) which could better fit our needs. ?
Thank you in advance.
So, after the comment, the answer:
I would look at this SO post.
I looked wyWuild and the AutomaticUpdater controler some time ago. It really looked great.
EDIT
I just remembered that I chose to use AppLife Update in the end. It's more expensive but the features are extremely good

Open an NDepend Project With An Automated Team Build?

I am trying to automatically open an NDepend Project when the Solution builds in an automated build in TFS2010.
This stems from this previous question. The aforementioned post is where I tried (and failed) to integrate NDepend's code metrics software with an automated Team Build via messing with the XML of my solution.
I decided since I wasn't getting anywhere in messing with the XML, that I would try a different route. In another program I have developed, I used
System.Diagnostics.Process.Start("blah.txt");
to trigger Notepad to run and open the text file "blah.txt."
I figured I could use the same concept to possibly help me with this NDepend integration. So I researched MSDN to see if I can find out more about the Process.Start method. And using this example
Process.Start("IExplore.exe", "C:\\myPath\\myFile.htm");
I substituted in my own paths to what I believe should open the project file "myProj.ndproj" inside the VisualNDepend application like this
System.Diagnostics.Process.Start("C:\\tools\\NDepend\\VisualNDepend","C:\\myProj\\myProj.ndproj");
I may be taking that example and tweaking it out of context, I'm not sure, but it seemed to me that what I tried should work. The solution built fine without any errors, but VisualNDepend didn't run.
It finally hit me that I was trying to use this code that would only execute when the program ran when I really need it to execute when the program builds within TFS and Visual Studio.
I asked my coworkers if they knew of any built-in ways within TFS or VS that would recognize whether or not the solution was being built or not. And they didn't really know of anything in particular. I tried "Googling" this topic and couldn't find any information that was useful to me.
Does anyone know of how to accomplish this? Or am I chasing a lost cause by trying to execute some C# code behind the solution? In which case, is my best bet trying to tweak the XML like I had previously been attempting?
I would recommend writing a custom build task (or tasks). You can essentially make the task do anything you'd like -- run a process, spit out results, etc., and it can be invoked directly from your MSBuild script.
I'm not sure if I'm answering your question (or if I even have a grasp on what you're trying to do), but that's probably the area I'd be looking to find my solution.

MSBuild in a Client Environment

I'm wondering if anyone has some solid advice for me. I'm trying to see if MSBuild is an appropriate tool for a client-side application (sold, commercial product). For example, if on the client machine there is .NET 4.0 and my program, I want users to be able to create screen savers and save them as an EXE.
So far, all I've seen is MSBuild being used for ASP.NET and build machines in a controlled environment, but is it appropriate to use it "in the wild" for a scenario such as described above?
I can't advise whether it is appropriate or not in your particular case, but since it is included in the .NET Framework setup, it is reliable to use it.
Overkill
MSBuild is great for managing complex projects with many interdependencies. If all you want to do though is generate an EXE from a simple set of inputs, like the screensaver scenario you used, I'd just use the C# APIs for calling the compiler or call csc.exe directly.
What you have to ask yourself here is how transparent you want msbuild to be? I would not advise using a command line and giving clients these commands and parameters, but if you mask it and have a good presentation layer that keeps all the technical stuff hidden then it's a pefectly good idea.
My current project relies pretty heavily on msbuild when installing, it works great and no one would know unless they seen the code.
Hope this helps.

SSIS and re-using C#

I'm a newbie to SSIS / C# (I'm generally a Java developer) so apologies if this is a really stupid question.
Essentially the problem is this: I have two Data Flow tasks which load data up and export them to a legacy flat file format. The formatting is done by a Script Task (C#).
What I'd like to do is share some common code between the two. e.g. I could create a common base class and then extend it for my two different script tasks.
However it seems that SSIS doesn't really make provision for this.
Does anyone know if there is a way of accomplishing what I want to do?
You're correct that there is not a straightforward way to do this directly from SSIS.
In a recent project, we took two different approaches, which both worked fairly well depending on what you need to do:
Create a utility class (as a simple class library) and reference it from your script tasks. This is done pretty much the same as any other sort of reference. If you use .NET 3.5, remember that you'll have to update the version manually in the script tasks since SSIS defaults to 2.0. We also found that if we wanted some manner of reusability in the utility assembly (not relying on hardcoded variable names, etc.) then the package still had to have a fairly large amount of "setup" boilerplate to use the utility scripts.
Create a custom data flow component. This is a much more involved process, but ultimately will do the best in terms of avoiding code duplication. Generally, coding the actual data flow is fairly simple and not that much different than a script component, but the various setup code you'll need can tend to make things complicated. There's also not a lot of support in SSIS for when something goes wrong. Led to a lot of detective work on our project.
If you plan on using something a whole lot, and are committed to getting rid of boilerplate code as much as possible, 2 is the preferred option. If it's being used a few places here and there, consider the simple approach of 1.
I am pretty sure it's possible to access .NET assemblies in SSIS scripts. So you could do it this way. See the article "Accessing .NET assemblies with SSIS" on SQL Server Central.
I believe you will have to create an assembly or webservice for this to work.
This does not completely solve your issue but it does help in not having to recreate all the classes every time you need them (I also do not want to deploy referenced assemblies for my current project ). Firstly you need a master copy of your classes, you can copy them from an existing Script Task using the same process below but in reverse.
Open the Editor for the Script Task and on the Property Explorer click on the Project File (the st_[Guid] ), in the Properties window you’ll see the Project Folder location. (This location gets recreated every time you edit the script task)
In explorer, copy your classes to this folder
On the Project Explorer, click on the “Show All Files” icon
Right click on your files and add to Project
Probably way too late to answer this, but you can click on the solution and add a class there. Then when you go into your scripts you can say add existing object and search for that class you created earlier. For me it was located by the solution for the project. Haven't gone through the deployment or anything for this, but at least you can access the class through the individual scripts.

Categories