I want to write a asp.net based game which has rules(of course) I want this: When the user fills the form and clicks the button it will check the inputs according to rules and save the outputs to the db or show to user.
-Can I write the rules using WF?
-Can I exchange data between asp.net form-wf-db?
-Can somebody edit the rule file during runtime of web application?(Or replace the .xaml file completely?)
Thanks
It would be possible but I don't think WF4 would be an ideal fit. The one thing you can't do is modify an workflow declaration while the workflow is running.
Related
So I'm working on a project with pretty specific client requirements. The want a document that, once uploaded, is automatically given a custom content model (which I've already made) and then, immediately after upload, allow the user to select aspects to add to it. If the user cancels out of the aspect selection, the document needs to be deleted.
We have a full Maven space setup for alfresco and share development and have our standard-document.xml in alfresco/src/main/resource/alfrescco/extension/model.
The question I have is, where in my share environment do I start working on this process? Would it be best to make a custom dashlet that deals with the upload process, or is there some class or function I can rewire within the Slingshot/Spring Application Context. I couldn't find any existing plugins or share amp files that I could use as a reference. Is there anything out there that currently has something similar to this functionality?
I guess you're using Alfresco's Share client, right?
you'll have to have to tweak Share's JavaScript components:
add a custom flag to "metadataRefresh" event object that is fired in x-upload.js
tweak handling of "metadataRefresh" event in documentlist.js to call the relevant action
it's gonna be a though JavaScript implementation task.
Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
We have an ASP.NET web-application which has become difficult to maintain, and I'm looking for ideas on how to redesign it. It's an employee administration system which can be highly customized for each of our customers. Let me explain how it works now:
On the default page we have a menu where a user can select a task, such as Create Employee or View Timesheet. I'll use Create Employee as an example.
When a user selects Create Employee from the menu, an ASPX page is loaded which contains a dynamically loaded usercontrol for the selected menuitem, e.g. for Create Employee this would be AddEmployee.ascx
If the user clicks Save on the control, it navigates to the default page.
Some menuitems involve multiple steps, so if the user clicks Next on a multi-step flow then it will navigate to the next page in the flow, and so on until it reaches the final step, where clicking Save navigates to the default page.
Some customers may require an extra step in the Create Employee flow (e.g. SecurityClearance.ascx) but others may not.
Different customers may use the same ASCX usercontrol, so in the AddEmployee.OnInit we can customize the fields for that customer, i.e. making certain fields hidden or readonly or mandatory.
The following things are customizable per customer:
Menu items
Steps in each flow (ascx control names)
Hidden fields in each ascx
Mandatory fields in each ascx
Rules relating to each ascx, which allows certain logic to be used in the code for that customer
The customizations are held in a huge XML file per customer, which could be 7500 lines long.
Is there any framework or rules-engine that we could use to customize our application in this way? How do other applications manage customizations per customer?
If your regular data is held in a database I'm not entirely sure why you'd want to have all of that customer specific information in an xml file. Move it into the database.
Next, there are many different kinds of rules engines out there. Considering you're using asp.net you might want to look at Windows Workflow for at least some of this. You might read the following: http://karlreinsch.com/2010/02/05/microsoft-rule-engines/
A long time ago I used a product called Haley Rules to drive a c# web app. It controlled everything from the screens that were available right down to the fields that appeared and whether they were required or not. It took awhile to get the team on board with how it worked, but once that happened bringing on a new client was extremely simple. Haley was since gobbled up by Oracle, but was probably the absolute best one out there.
Others you might be interested in are NxBRE and even nCalc. NxBRE is an actual rules engine which is a port of one built for java. nCalc on the other hand isn't a rules engine per se. However, if you can express your logic in simple boolean statements then it is extremely fast. I'm currently using this to drive page flow in one of our applications.
Some commercial ones include: FlexRule, iLog
Your existing rule engine tool supports your web application, which means it meets your needs already. You can use other "Rule Engine" like MS work flow, but IMO it can also end with a hard to maitain situation.
Let's say there is registration portal. It collects general user infomation and save them into database. Simple. we build one protal for one client with several ASCXs and Rules.Then for another client,we add more rules and more controls to these ASCXs. Working in this way, sooner or later we will reach the final straw client. At that time the code base is hard to maitain and devs lost themselves in lots of rules. It is what happened to me.
So to me, it is not about which Rule engine to use.
Then How?
I have raised a question, and one of the answer makes sense to me( thought not a picked answer). In this answer, the guy mentioned what kind of company you are. In your question it is more like which department you are or do you want to seperate your dev teams.
If you are in a archetect teams, build a framework with a rule engine. Create a basic registraion portal as a sample portal.Make DAO,BO decoupled with UI (Seperate layers).
If you are in a customise teams, create customised user control (dont reuse these user control in basic version). What you will recreate is just UI, you can still use DAO,BO as they are not defined in user control, they are at other layers. In this way you get the freedom to define your client specified rules without worring about contaminating other clients rules or introducing new bugs to other client's registrations.
Just realise it is not like an answer to your question. Anyway it is my thoughts after limited xp of working on a engine rule based ,multi-clients web application.
Our team is building a new web site with ASP.NET. We plan to use a 3-tier architecture. The problem is that the controls shown on the web page need to be changed all the time according to the customer's requirements, which means adding a pair of label/textbox, or removing a pair of label/dropdownlist when the customer needs it. So the layout needs to be flexible and allow to easily add or remove controls, although it just shows some simple product messages like price, discount, tax, etc.
The previous version of the web site saved all the control information in a database, like control name, control type (textbox, label, dropdownlist), which page and panel it belongs to, etc. You can see there is a big performance hit because every time there is a request to this page, it needs to get all the required controls from the database and add them to the page manually, no matter whether the request is a postback or not.
We thought about adding the controls directly to the .aspx page, but in this case it will be difficult to change them later. We also considered holding all the controls' information in XML files, which may give a little performance advantage, but it still needs to render the controls all the time.
So this is the problem we have, to improve the app's performance and also meet the users' needs at the same time. Could anyone help me with any solutions or ideas?
PS: you can also ask questions if I didn't make it clear enough. Best regards.
This sounds like a good situation for User Controls. If all you're doing is toggling child-control visibility, then creating a user control with toggleable visibility properties should meet your needs. You can still use your backend to toggle visibility, but you'll only need to pull yes/no flags from the db instead of entire page schemas.
From an architectural standpoint, User Controls are great because they encourage modularity, code reuse, and lend themselves well to version control (UsercontrolV1.cs, UserControlsV2.cs, etc). The point on version control is especially great in cases where change requests require logic updates, or simply need to revert to a build that existed x iterations ago.
Now that is what i call a Flexible web-Application.
the controls shown on the web page need to be changed all the time
Who will change the controls? The client? Can you not just update the .aspx file and publish it to the server every time a control is requested to be changed?
but any way, its an interesting question. There is nothing else really that can be done except using a XML file.
uploading multiple files from client to server with asp.net
I have been looking at the asp.net upload control but that is for one file (unless someone knows a better way to do it).
http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.fileupload.aspx
For what I want to do I don't even really need a browse. I know the files off of the client are at a certain location. Is it possible to create a collection of HttpPostedFiles and upload those?
http://msdn.microsoft.com/en-us/library/system.web.httppostedfile.aspx
I don't think it is possible but would be glad to be proven wrong. Is there a different asp.net method or control that will easily allow uploading multiple files from client to server?
Here's a few ideas to look over:
http://www.c-sharpcorner.com/UploadFile/rahul4_saxena/UploadingMultipleFilesInASPDotNET203062009015325AM/UploadingMultipleFilesInASPDotNET2.aspx
http://aspalliance.com/1221_CodeSnip_Uploading_Multiple_Files_At_Once.all
http://www.dotnetcurry.com/ShowArticle.aspx?ID=68&AspxAutoDetectCookieSupport=1
The only multiple file upload component I know from the top of my head is the one Telerik provides:
http://www.telerik.com/products/aspnet-ajax/upload.aspx
That's bundled in RadControls, which is a pretty nice kit to have, though it costs a bit.
Have a look at the System.Net.WebClient.UploadFile and System.Net.WebClient.UploadFileAsync methods.
If you use the synchronous method, you would upload one file at a time sequentially. If you opt for the asynchronous method instead, you could fire off multiple uploads at once.
I Prefer Purifying the stuff with HTML & JavaScript on the Client Side and on the Server Side Using Generic Handler if you are a JavaScript Developer it will be more easier and customizable in your hand and maybe you invent your way of uploading the files
i will tell you about my way of doing this technically
(1st) of course you need to make the upload process without posting the page back and forth to the server so in this case the main item here is an HTML Item which will help us uploading files without posting the whole page which is IFRAME.
(2nd) for most of us in the very beginning we knew the FORM tag is responsible of posting the data from client to server but we didn't know that if we had a INPUT FILE in our FORM we can't post its files to the server without adding a specific attribute in the form tag which is enctype= multipart/form-data
(3rd) there is many techniques invented to make the multiple upload the first one is by adding a attribute to the INPUT FILE which is multiple="multiple" that will make the input file acts to hold a multiple files inside it but in this case it will be a one by one multiple upload when posting the files all together in 1 request to the server.
the other technique is creating in the run time an input file for each file we need to upload with that we can pass the input files control to a form related to each that form of course is inside an IFRAME related to it with that we have a request to each uploading process
to whom ever need more details about that technique free to ask for more description
We have about 10 applications that basically do the same thing, all written using the Wizard Control for .Net 2.0. The flow they follow is pretty simple:
1. User selects option from a drop downs.
2. Next page has more options more narrowed.
3. User sees confirmation page.
4. Report is generated.
Some of these applications have optional pages, such as allowing the user to upload custom images for the report and allowing the user to select specific lines of data.
I'm attempting to merge these applications, but I'm not sure I'm approaching this the correct way. My first inclination is to create configuration tables in SQL to drive the menus that appear. So, for example, there might be a table with the WizardId, Name, Theme, etc., also a table of steps, and another table to link everything together.
Is there an easier way to approach this that I'm just missing?
We've been thinking through this issue lately and I've come up with two options that both seem valid, just have different uses. One way to do it, similar to what you have described, is to create the following:
A table that holds the wizard information
A table that lists the types of questions to be asked in each wizard
A table to hold the data entered by the user for each question
This is very flexible, but the problem is you have to dynamically generate all the controls you need to collect the information (textbox, drop down, radio, file upload, etc) and store how to display that control in your database.
The other approach that we have tried out on a recent project is to associate a user control with either each wizard or type of wizard step. It isn't as modular, but you have a lot of control over how the controls are arranged and how you collect the data.
I think both approaches are useful in different scenarios. Going with a database driven approach allows you to generate new questions and wizards easily, but lacks the user friendly approach that we wanted for our new application.