Running a BO process from outside my SF app. ( like a VFP app as com object )


Running a BO process from outside my SF app. ( like a VFP app as com...
Author
Message
Charles R Hankey
Charles R Hankey
Advanced StrataFrame User (764 reputation)Advanced StrataFrame User (764 reputation)Advanced StrataFrame User (764 reputation)Advanced StrataFrame User (764 reputation)Advanced StrataFrame User (764 reputation)Advanced StrataFrame User (764 reputation)Advanced StrataFrame User (764 reputation)Advanced StrataFrame User (764 reputation)Advanced StrataFrame User (764 reputation)
Group: Forum Members
Posts: 524, Visits: 30K
If I have an SF C# app connected to SQL Server and there is process in a business object that interacts with other business objects and changes data :

In my SF UI the interaction of the BOs is done in a winform code. 

The connections are made in the startup of the app. 

How would I call this same BO process from outside of my SF app ( or automatically run my SF app to invoke that process with no UI ) and take advantage of connections and bo interaction etc ? 

The idea is that a backnend process is going to run an SSIS package to get CSV data into a staging table ( one of the bos in my app ) and then bo logic is going to create or update reocords in three other tables based on the new staging records. 

I may also want to pass into the app the id of the staging record batch to process.

Suggestions greatly appreciated.
Ivan George Borges
Ivan George Borges
Strategic Support Team Member (2.8K reputation)Strategic Support Team Member (2.8K reputation)Strategic Support Team Member (2.8K reputation)Strategic Support Team Member (2.8K reputation)Strategic Support Team Member (2.8K reputation)Strategic Support Team Member (2.8K reputation)Strategic Support Team Member (2.8K reputation)Strategic Support Team Member (2.8K reputation)Strategic Support Team Member (2.8K reputation)
Group: StrataFrame MVPs
Posts: 1.9K, Visits: 21K
Hi Charles.

The BOs should be in a library of itself, so you can reference this DLL in as many projects as you need.
The connection string can be shared by many EXEs. Just set the ConnectionManager.ApplicationKey to the same key and they will share the same connection originally set.
Fabian R Silva, -
Fabian R Silva, -
StrataFrame User (241 reputation)StrataFrame User (241 reputation)StrataFrame User (241 reputation)StrataFrame User (241 reputation)StrataFrame User (241 reputation)StrataFrame User (241 reputation)StrataFrame User (241 reputation)StrataFrame User (241 reputation)StrataFrame User (241 reputation)
Group: StrataFrame Users
Posts: 153, Visits: 1.2K
Greetings, after you call SetDataSources() can call anything you want before that.  I still not implemented  this but I suppose that this can work....


For example in c#: you can call the exe with a parameter from a bat if you like, to do this you have to add an "args" string array as a string[] parameter on program.cs (something like that in vb, check creating an application console and check how do it VB)

in c#
static void Main(bstring[] args) <-- this is the starting point of the app, I added string[] args array to receive a parameter with name of the process that wants to execute...

put the value of args[0] on a static public "callerArgument" property and when StrataFrame event SetDataSources() is called, at the end of this method you can see the callerArgument property and if it have some string, call a method that do the processing that you want.

after you call your processing method you can call
Environment.Exit(0);
to exit from the exe without do anything more.

As Ivan says, it too can be accomplished creating another project (can be an console app) and adding the dll references to the BOs library(s) projects/dlls needed.


Charles R Hankey
Charles R Hankey
Advanced StrataFrame User (764 reputation)Advanced StrataFrame User (764 reputation)Advanced StrataFrame User (764 reputation)Advanced StrataFrame User (764 reputation)Advanced StrataFrame User (764 reputation)Advanced StrataFrame User (764 reputation)Advanced StrataFrame User (764 reputation)Advanced StrataFrame User (764 reputation)Advanced StrataFrame User (764 reputation)
Group: Forum Members
Posts: 524, Visits: 30K
Thanks guys, as soon as I got the idea of console app and BO library into my head ( as well as searching here for the connection info etc) I started to fall into place - except that now management wants me to do it all from within my SSIS package with SPs.  Oh well.
Ivan George Borges
Ivan George Borges
Strategic Support Team Member (2.8K reputation)Strategic Support Team Member (2.8K reputation)Strategic Support Team Member (2.8K reputation)Strategic Support Team Member (2.8K reputation)Strategic Support Team Member (2.8K reputation)Strategic Support Team Member (2.8K reputation)Strategic Support Team Member (2.8K reputation)Strategic Support Team Member (2.8K reputation)Strategic Support Team Member (2.8K reputation)
Group: StrataFrame MVPs
Posts: 1.9K, Visits: 21K
Great Charles. Come back here if you need anything else.
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search