Process/ Work Flow Engine - workflow

I am working on a solution for which I need a work flow/process flow engine. My work flow contains some Java based processes(classes) and some Linux Shell scripts. The flow would not be static and the execution of each process depends on the state/outcome of the previous process, and there would be multiple paths and the path would be determined the state of the previous processes.
I tried looking at jBPM, but I do not find a suitable support for invoking shell scripts. Please suggest me a suitable alternative for my requirement.
Many thanks.

well you can use jBPM5, it's extremely simple to add support for running shell scripts, we can help you with that.
Can you elaborate a little bit more on the requirements that you have?
Cheers

Related

How do I control a Beckhoff EtherCAT Coupler with powershell?

We have a Beckhoff EtherCAT Coupler which is currently being controlled by some c# code, we call that c# code from a powershell script. We want to move the entire process of toggling slots on the coupler to the powershell script but I'm not sure how to do that. If you could provide me even with information on how to send/receive Modbus commands in powershell that would be hugely helpful.
Thank you!
EDIT:
Here is the code used in C# to toggle one slot of the IO coupler:
using System.Net.Sockets;
using Modbus.Device;
TcpClient tcp_connection = new TcpClient(ip, MODBUS_TCP_PORT);
ModbusIpMaster coupler = ModbusIpMaster.CreateIp(tcp_connection);
coupler.WriteSingleRegister(0x1120, 0);
coupler.WriteSingleCoil(slot, state);
Acontis offers an EtherCAT Master for Windows library and a C# example application you could leverage to include into your own application: https://acontis.com/en/ecsta.html
Working with machine automation controllers is highly manufacturer specific. I've got working knowledge only about Omron PLC & MACs, so I cannot provide exact details.
Anyway, one way would be to create a C# DLL and call it from Powershell. As how to program the coupler, start by finding out which model, exactly, you are working with and searching Beckhoff's documentation. Maybe there are suitable samples available.
Consider also contacting manufacturer's support. They might be able to provide advice with very reasonable pricing, unless the task grows into a consulting gig.
Programming PLCs and MACs is often done via manufacturer specific solutions. Those are much simpler to use than general-purpose language such as C#.

Deploy Erlang Application

I would like to run Erlang application on a centOS server for stress testing. I would like to know what I must accomplish to deploy a Erlang application before I send it to the server admin to install and run.
What will I need to tell my admin to properly run an Erlang app on a server? (Basically how can I send him a file and give him an really stupid easy instructions to install it?)
Is their a way to send my app in a executable format that the admin can easily install with? Kinda like PyPy?
How can I perform code swapping? Will the app need to be in it's code state still in order to do this?
I would appreciate any help to make this process easy. Thank you!
For anyone just passing by: Even though this is my first Erlang app, I highly recommend anyone wanting to build a easy to scale server user Erlang. The benefits are amazing, if you know how to use Erlang properly.
Cheers!
The usual way of deploying an Erlang program (I'm avoiding the word application here, as it's somewhat ambiguous in an Erlang context) involves building a release (see this for some background). A release is essentially a packaging of your Erlang code (which often consists of multiple applications - hence the ambiguity) and the parts of the runtime system required to run it. The Erlang release system was designed with code upgrades in mind.
If you are using Rebar to build your program, you may find this article helpful. In addition to describing how to build a release (the process is a bit tricky) it also explains how you can deploy an upgrade.
A similar guide is also available for users of erlang.mk. If you're not using one of them already, or a comparable build tool, I strongly encourage you to do so as it makes release handling much less painful.
You may also find the answers to this question helpful. They list some additional options.

PowerBuilder 12.NET automated builds using Nant

Can someone please shed some light on different possibilities of build automation for, PB 12.NET applications. Since PB is .NET, can tools like NAnt or CruiseControl (with MSBuild) can be used to build and deploy the applications.
Basically, Can it be ORCAScript / ECrane PowerGEN independent.
I'm usually wary of "never say never", but I'm pretty sure your answer is no.
To call the PowerBuilder compiler, you need to call PB's ORCA API. The IDE does that. ORCAScript provides you a command line interface to that. PowerGen provides a GUI front end (and lots of additional functionality) to that.
However, I'd expect you could use ORCAScript or PowerGen from these tools. For example, here's a blog post describing leveraging ORACScript in CruiseControl with NAnt. PowerGen has a very robust set of command line options, and will give you more power and opportunities from the command line (e.g. PBL optimization, more efficient bootstrapping).
Good luck,
Terry.

Shell scripting

i am new in linux and using ubuntu'10.10'...i basically want to know as what is the significance of learning shell....????...i googled but max time i find tutorial but didnot get any satisfactory answers...
Whenever you want to automate small tasks where using real programming languages is overkill (e.g. batch convert files, rip DVD chapters, synchronize directories, ...) shell scripts often are invaluable.
Moreover, a lot of "plumbing" in the system is done with shell scripts (e.g. daemons start/stop scripts, event scripts), so knowing at least how to read them often can give you a grasp on how some parts of the system work under the hood, and give you a clue about where the problem can lie in case of malfunctions; knowing how to write them can also be useful if you need to customize the system in some way.
That is a nice question to ask. The fact is that studying shell script help you to do a lot of tasks, (well it helped me ). I used shell script whenever i had to perform more than one Linux commands one by one and sometimes when I had to run jobs over and over again with same pattern. Shell really helps in doing such tasks.
And off the syllabus, studying shell for tasks made me more familiar with the OS and commands.

Is PowerShell a good upgrade for a batch file?

I package our server releases into zip files using a batch file (Windows), running the command-line version of WinZip. Previously we did this sort of thing "by hand" but I developed the process of automating it with a batch file.
The batch file has become quite complicated because our product is complicated (i.e., Which sections are we releasing this time? Are we releasing the config files as well?) and I'm starting to run into some frustrating limitations with batch files.
Would PowerShell be a good thing to investigate as an "upgrade" to the batch file? Or is that complete overkill given that most of what it would be doing is firing off DOS commands?
Bonus: can PowerShell consume .NET assemblies? As in, could I start doing the zipping with SharpZip?
If you have a working solution, then you don't need to go to powershell. Having said that, if you plan to make changes or improve the process then I would highly recommend powershell as the way to go. Powershell can access .Net assemblies...mostly. Some assemblies are structured in a way that makes it more difficult than others.
You can check here for some resources if you decide to look at powershell.
Initially I was really excited about PowerShell. Finally a powerful native shell on Windows. However, I quickly realized that compared to your favorite unix shell PowerShell is just way too verbose. Even doing simple stuff takes way too much typing compared to what you can do with bash and GNU tools for Win32.
I like the idea, that the shell knows about different types, but if I need to do that much additional work, I prefer just getting the necessary data with the various unix stream editors.
EDIT: I just had another look at PowerShell, and I have to admit, that it does have some really useful features that are not available for the traditional unix style tools.
For one the PowerShell owns all the commands which means that it can provide a much more coherent set of features. Parameters are treated uniformly, you can search for commands, parameters and so forth using wild cards which is really useful.
The second great feature is that PowerShell lets you enumerate sources which are normally not available to stream editors such as the Windows registry, the certificate store and so forth. Of course you can have tools that does this for you and present it as text, but the PowerShell approach is just really elegant IMO.
Take a look at PowerShell Community Extensions (PSCX), its FREE and it has Zip cmdlets:
Write-Zip
Write-BZip2
Write-GZip
http://www.codeplex.com/PowerShellCX
You should watch this presentation/discussion with Jeffrey Snover, PowerShell creator and architect. If you're not amazed by the technical details (lots of "wow" moments to be had), you'll be amazed by Jeffrey's enthusiasm :). Once you get the basics, it's easy to be very productive with PowerShell.
The answer is YES - PowerShell can use .NET assemblies. There is a bit of funny business involved in v1 if you need to wire up delegates and v2 makes that much more clean.
Just call LoadFile / LoadAssembly to get the appropriate libraries in memory and away you go
[Reflection.Assembly]::LoadFile('/path/to/sharpzip.dll')
$zip = new-object ICSharpCode.SharpZipLib.Zip.FastZip
$zip.CreateZip('C:\Sample.zip', 'C:\BuildFiles\', 'true', '^au')
# note - I didn't actually test this code
# I don't have SharpZip downloaded - just read their reference.
Also note that the PowerShell Community Extensions support various compression methods like write-zip.
I've tried to replace one of the lengthy build batch files I use with power shell. I found it a pain: at least at that time, documentation focused on the funny verbiage and what cool, perly things you can do with it, but lacked in the "getting simple things done" category. I got it working, but the error handling was to shaky.
YMMV, try powershell, you might enjoy it. But try it before updating your build batches.
My solution: use a C# console application. I've got serious logging, exception handling, can use my utility functions, and if something doesn't work I have a real debugger. It's the first solution I like to modify.
I'm not sure about powershell, but might I recommend using something like IronPython (if you want to have access to the .NET libraries) or plain python? You get a full-blown programming language with very few limitations.
On the one hand, if it works, just leave it. But it sounds like this is something you'll be adding to over time, and of course your eventual successor/coworker who needs to edit the batch file will also need to understand it. If you're from a programming background then you may well find the power of Powershell makes your script a lot shorter and easier to read/maintain (for example, even just having full if statements and for/while loops). On the other hand if you're not overly familiar with programming, a lot of people find Powershell a bit daunting at first glance.
Regarding the .NET part, Powershell is built on top of .NET so yes, you can access .NET assemblies (but you should always see if there's a cmdlet available first).
I would recommend a book called "The Powershell Cookbook" by Lee Holmes, published by O'Reilly. It provides "recipes" which you can use for common tasks; this will probably speed up your time to implement the script, and it'll teach you Powershell along the way.