Same as flow charts, microflows also have a start and end event between which the whole process of programming is handled. Below is the example of a simple microflow that is taken from the examples available on the Mendix website. Here, Department is used as a parameter. A parameter is a data that serves as input for a microflow reference.
This was the most basic example of a microflow being used. More intricate and bigger applications can be developed by making use of the activities provided by Mendix. The object activity can be used for directly performing actions on the entities by creating their objects.
The object activities can be used for creating, changing, retrieving, casting and deleting the objects. List operations are used for handling list of the data of an object rather than a single value for an object. An XPath query can be used in the list functions. An XPath is a type of query language used by Mendix for retrieving data. XPath query can be written by specifying the path expressions that select the data of Mendix entities and its attributes and associations reference.
Action call activities can be used for calling any previously created Java action or calling a microflow in another microflow. Variable activities are used to perform tasks on variable; the variables can be created as well as changed as per the requirement of the microflow.
The major advantage of OQL is that OQL uses entity and association names instead of the actual database table names reference. For understanding the working of Mendix it was necessary to choose a topic developing which I could experiment with Mendix features. So, for the full evaluation of Mendix I decided to develop a Payroll application that will use and understand all the possible features provided by Mendix.
I used to work part time in a shop in my home country India. In the shop the wages of the employees were handled through a payroll system. I was impressed by the working of the system. When I got a chance to create a working application using Mendix the first clue that hit me was to develop a payroll application.
This is how I decided to develop a payroll application for my research. Some of the employees may get wages on monthly basis while others may get based on hours worked daily or weekly. Using the computerized payroll system the wages can be generated by calculating the bonuses or allowances and even deductions like Provident Fund, medical insurance, charitable contributions, loans, taxes, etc. A payroll application is used by a payroll specialist and pay checks are generated reference.
The sign in and sign out time can also be kept track by making use of a payroll application. The employers keep constant tally on the details of the employees and all the data is maintained. The basic requirement of a payroll system is that it collects the hour details of an employee and calculates gross wages, subtract all the deductions and print checks.
Payroll software does the critical calculations just by taking a small input from the user i. The salary is calculated on its own without taking any pain.
In higher level payroll softwares, automatic updates are received for the taxes every time the law is changed. Computerized payroll software reduces the tedious work that used to be done in handling the employee details manually and it also saves huge amount time. As mentioned above in the Methodology section of my report, among the RAD based Methodologies phased development, prototyping and throwaway prototyping I am going to use Prototyping.
After the evaluation of the prototype I will refine the requirements and develop a second prototype. This process will be followed till the whole system is developed fully.
After the analysis I came to know the basic requirements of a payroll system. The first thing to be done for the first prototype was to create a domain model.
The first domain model was as follows:. This is the very first domain model I created when I started using Mendix. I was learning to use the features properly and was confused regarding the relationships that should be established between the entities. I have used Microsoft Access before as a database for my application and according to the rule for establishing relationship between tables in MS Access, each table should have a primary key and a foreign key then only relationship can be established.
A foreign key is the primary key of other table with which relationship has to be established. The type of relation can also be selected i. For the system to work properly, it is necessary that the relations between the entities are correct and sensible. I was not able to decide relations between some of the entities and I found the model impractical so I decided to develop a new improved version of the domain model in which I decided to remove some of the entities that were of no use in my application.
The new version of my domain model is as follows:. In the above microflow, a parameter of the Payment object with the variable name Payment is used for input for the Payment object. I consulted to Mr Jim Longstaff about this problem and he guided me to use the reference selectors in the forms through which we can directly fetch data from the desired entity without using microflows.
For this we do not need the attributes of other entities in our desired entity, it can be directly fetched from the referenced entity. For this the only thing you need is the relationship between the two entities.
I discovered the problem with the above microflow when I understood the working of microflows in the later stage of my project. But there was no need of using microflows for this purpose now. To implement the reference selectors instead of microflows I had to develop another version of the domain model. So I created a 3rd domain model as follows:. After creating the version 3 of domain model I developed the forms and used reference selectors in the form fields as suggested by Mr Jim Longstaff which fulfilled my requirement.
Again I discovered a problem in the present domain model, the relationships between Employee — Payment, Employee — Job and Job — Payment were one-to-one which was not realistic and should have been a one-to-many relationships and needed improvement. Thus, I created a last and final domain model as follows:.
Also the type of relationship was changed to one — to — many from one — to — one. I have given float datatype to all the time related attributes as it would be easy to calculate a float entry rather than a time entry. I have set a single value as a pay amount for each employee i. After the creation of this final domain model I started implementing these in the forms for making my application functional.
Implementation in my application was intended to develop forms that would include the entities created already in the domain model. The first form that I made was EmpDetails form that contained a grid that would show all the details of all the employees.
The above form can display the details of all the employees all together. It is necessary to specify another form through which you can edit and add new employee details on the new and edit buttons of the grid otherwise it shows errors. The form that opens by clicking on New or Edit buttons looks like a simple form that contains labels, textboxes and buttons.
An interesting thing to notice here is that there is the same form for adding new employee details as well as to edit the existing details. This is because data grid has to be used for both the purposes so if you want to add new detail in the database you can just click on the New button and a fresh form will open and if you want to edit a particular employees details, select the employees details first and click on the Edit button, an already filled in form will appear.
This is so simple. Similarly other forms were created. I created an enumeration called Weekday which acts as an attribute for the TimeCard entity through which the day can be selected from the list of seven days while entering timecard details for an employee.
After implementing all this I wanted my application to look more attractive and easy to use. I wanted to display all the details of an employee together in different tables on the same page. That could be possible using the Listen Target property of a data view. For displaying three different grids on the same page and connect them with each other Horizontal and Vertical Panes were used. This form was named EmpOverview and became the home form of my application.
In this form when an employee is selected, all the details like payment and timecard details related to that employee automatically start appearing in other two tables. The new EmpOverview form is as follows:. Above is the home form showing three tables together. In the present scenario, there are only three employees in the database, so selecting the employee named Amyn Khoja in the employee table displays the Payment and TimeCard details of the same employee.
The navigation bar at the top of the Employee Overview form contains four tabs through which a user can navigate between different forms. Mendix has many impressive features but the main feature that I found most difficult to understand was the use of microflows. I tried to eliminate the use of microflows as much as possible but for handling the main calculations that were supposed to be carried out automatically, microflows were the only feature using which this could be possible.
The calculation of total hours per day and the per day wages of employees was supposed to be handled through microflows. The first thing I wanted to calculate was the total hours an employee worked on a particular day.
Before calculating the total hours worked in a day, hours worked before and after meal were necessary to be calculated. For this I created two microflows. The first microflow was to calculate total hours before meal. After the microflows for the calculation of total hours before and after meal are done, another microflow has to be created that takes the value of total hours before meal and after meal and adds both the values.
The microflow below does the same:. After the microflows had been developed, these microflows had to be applied on the form fields so that they can be triggered to carry out calculations. The example below shows how the calculations are handled through the microflows when we run the application on localhost: :.
After the TimeCard calculations started working properly the other complex calculations were the calculations for Payment entity. For calculating the total payment amount of an employee it is necessary to fetch the total hours worked by an employee from the TimeCard entity. Following is the microflow PaymentTotalHours :. The above microflow takes Payment as an input. An exclusive split has been used which works on the following condition:.
But if the above If condition becomes false another exclusive split is used that checks the condition for the deduction amount:. So far I was able to do what I wanted to do using microflows. I needed to include more features and wanted to experiment more with microflows but due to the lack of time I was unable to do that. The next functionality that I wanted to include in my application is the monthly report generation for the employees.
This was a difficult task because I consumed maximum time in understanding the working of microflows so there was no time left to understand the working of Report widget. But I found another feature as an alternative to generating reports and it is Export to Excel button in data grid. Using this button all the details of the data grid can be exported to Microsoft Excel and can be printed out from there. I have used this button in the main data grids so that a kind of report can be generated.
Mendix is wonderful software and defines the RAD tools properly up to some extent. Even though it has been recognised very quickly and has been in the top lists of IT awards, according to me it requires many improvements that will make it easier to use.
I think that the first thing that should be improved is its look and feel. The other thing I found annoying about Mendix is that sometimes while running the application in the browser, the application becomes very slow and tasks are not performed properly.
Mendix can be efficiently used for creating prototypes as large projects cannot be developed because of the limitation of the use of code. Large and complex systems like Banking, HR Management systems for huge multi-national companies, Stock Exchange systems, railways and Aircraft Management systems, etc. While experimenting, using and evaluating Mendix I found that it is difficult to develop large applications because for developing huge systems, very complex coding is required for fulfilling the requirements of the system, but Mendix provides a very limited set of coding that would not even be useful for developing half of such systems.
So Mendix can be used to develop the prototype of such systems for presenting it to the client and then the prototype can be handed over to the developing team for developing the system using proper code. While evaluating Mendix I was supposed to develop a functional application that would use all the possible features of Mendix.
The main feature of Mendix is Microflow and I was successful in using and understanding the events that are used in a microflow for carrying out calculations which I think now I am capable of doing. The Payroll system application that I have developed is a very basic level application that performs basic tasks.
I have developed a basic version of my Payroll Application because I took maximum time in learning the features of Mendix, therefore there are many functionalities that I wanted to include in my application but I could not because of the diminutive time constraints.
The main functionality that I wanted to include was monthly report generation which is now the area of future development of this application. Also the present application calculates the wages without considering the bonuses, deductions and taxes which is generally done by a genuine payroll system. This might require more complex microflows and entities but including these things in my application is my future goal. Category : Free Essays , Information Technology. If you enjoyed this article, subscribe to receive more just like it.
Including student tips and advice. Click here to ask a question about this article. Subscribe If you enjoyed this article, subscribe to receive more just like it. If I am right about its lack of uptake, but its backing within Microsoft is strong enough, then maybe in Visual Studio 12 or even sooner we will get a version that does it right, with output options for cross-platform HTML5 clients and for Windows Phone and Windows Metro.
But do not hold your breath. Answer: No Microsoft today has an anti-Silverlight focus, for many well documented reasons. LightSwitch ought to have been developed, or should be re-developed, to use the current zero-plug in client-side technology e.
Not an easy job I grant you, but given that developers would then be able to build native Windows 8 applications AND have these run on other operating systems, it is the only thing that will save LightSwitch. The LightSwitch team is facing the same which-client-technology quandary that MS as a whole, and MS-customer devs are facing. I stuck with the latter and never regretted it. LightSwitch is really just another part of Visual Studio.
The way MVC is. It is a bit like Entity Framework on steroids. The Silverlight screens are also still needed. If you need a desktop application with the best performance you will always want to use the Silverlight screens when you can.
Lightswitch needs a really big win in a publically visible market application. I find the Silverlight apps that it spits out are sluggish and ponderous and am looking forward the proper web-based output that must surely be in the works. Lightswitch — Fight with their design to make the interface the way you need it vs ASP — Build the interface from the ground up! The only benefit I really see in this software is prototyping.
I gave it a chance developing an application for it for a business and wow the amount of effort going into working against their model defeats the purpose of the software to begin with. They are better off just making an improved straight-ASP development tool. Businesses are built around solutions not software. The less time I have to spend writing code the better.
Lightswitch is an awesome product, something that has been sorely missed. You can change this on the Navigation tab of the Application Designer. LightSwitch applications automatically include an application shell, a navigation menu, a ribbon, a tabbed area for screens and data binding, as shown in Figure 8. The application also has built-in dirty checking and concurrency handling.
The LightSwitch screen templates provide specific functionality. For example, a search screen contains a grid to display items and a button to export those items to Excel. You can add additional items as needed. To add a button to the grid, use the Command Bar contained in the grid.
When you add a button, LightSwitch prompts you for the name of the method that runs when the user clicks the button. You can right-click the button and select Edit Execute Code, and then write the code that executes.
Just like entities, screens have a number of events you can handle, as shown in Figure The Run event occurs when a request is made to display a screen.
The Run event handler includes a handled argument. If you set this to true, you can prevent the screen from continuing. The InitializeDataWorkspace event occurs just before the screen data is retrieved.
This is a good place for screen initialization code. The other events are self-explanatory. You might think that events such as Run or Saving are good places to put code that checks whether the user can perform actions such as open the screen or save the data.
However, you should put that code in the appropriate Access Control methods, such as CanRun at the screen level or CanUpdate at the entity level. LightSwitch development is designed to be highly iterative. Developers can edit screens at run time while running in Debug Mode by clicking the Design Screen button in the ribbon.
It therefore does not expose XAML at design time. This makes it dramatically easier for users to build applications. You can create composite controls or even entire screens that include custom logic, plus you can easily bind these user controls to screen entities.
Another way to add functionality to a LightSwitch application is to use an extension. There are six types of LightSwitch extensions: controls, screen templates, business types, shells application look and feel , themes colors and brushes for a shell and custom data sources. Extensions are distributed via VSIX packages.
If you want to make an extension broadly available, you can upload it to the Visual Studio Gallery. It will then appear in the Extension Manager within LightSwitch.
After installing an extension, you can enable it on the Extensions tab of the Application Designer. The Contoso Construction sample application uses a Bing map control extension to show the location of customers, as shown in Figure All screens are based on queries. The query for a Detail screen returns one row. The query for a List and Details screen returns one parent row and all of the related child rows.
The query for a Search or Editable Grid screen will return all rows by default. The queries support paging by default. To configure the paging, select the query in either the Screen or Query Designer and change the paging-related properties.
You can filter the data returned by a screen query that returns a collection of entities. To do this, click Edit Query in the Screen Designer.
In the Query Designer, you can then add Where and Sort clauses. You can also add parameters to queries. Screen queries are specific to a particular screen. For example, you may want customers sorted by company name on the customer search screen. However, customers may also appear in a modal window picker on the screen where you create new appointments and in an autocomplete text box on the screen that displays customers and their projects. Rather than add the same Sort to three queries on three different screens, you can create one query and use it on the three screens.
To create a query, you can right-click on an entity in the Solution Designer and select Add Query. You can name the query and then add filtering, sorting and parameters.
The CurrentAppointments query, shown in Figure 13 , returns all appointments, sorted by start time, where the start time is now or later.
You can also use it as the basis for additional queries. For example, in the sample application, the CurrentAppointmentsByEmployee query starts with the CurrentAppointments query and then filters the results to return only the appointments for a particular employee.
Access control gives you the ability to control what actions users can take in an application. LightSwitch uses the standard ASP.
NET membership and role providers to enable both Windows and Forms authentication. You can authorize users to perform actions by creating permissions, assigning them to users and then checking in code whether the user has a particular permission.
By default, all users can perform all actions in a LightSwitch application. To change this, open the Application Designer and select the Access Control tab, as shown in Figure Then select either Windows or Forms authentication. The built-in SecurityAdministration permission controls whether a user can see the security administration screens at run time. You use those screens to assign permissions to users and add users if necessary.
You can create additional permissions if desired. During development, you can turn off permissions by unchecking Granted for debug. This enables you to test the application using various combinations of permissions. You can check for permissions in code at the entity, screen and query levels.
0コメント