Want to implement sequencing feature in our app

Hi, So, the scenario is , we have multiple articles which need to be put in an issue. Suppose there are 3 articles (A1,A2,A3) in an issue.  Followings are the total number of pages of each article A1-5 A2-4 A3-6   Here I have to do sequencing like if I wan to have sequence of articles like A1,A2 then A3 in an issue, then A1's tart page should be 1 and end page 5 But start page of Article A2 should be  6 and end page 10 and so on. And I wan to change the sequence of article in issue (like from A1, A2, A3 to A3, A1, A2) , then start and end page number should be calculated accordingly.   I want to implement this in mendix. Please help me out    Thanks
2 answers

Hi Trishla,


If I understand you in the right way, Here are some insights that may help you:


  1. Create an Entity for Articles:

    • Create an entity named Article with attributes such as ArticleName, StartPage, EndPage, and any other relevant information.
  2. Create an Entity for Issues:

    • Create an entity named Issue with attributes such as IssueName and a reference set to the Article entity to represent the articles included in the issue.
  3. Microflows for Sequencing:

    • Create microflows to calculate the start and end pages based on the sequence of articles.
    • When the sequence is A1, A2, A3, the start page of A1 will be 1, the start page of A2 will be the end page of A1 + 1, and so on.
  4. Change Sequence Microflow:

    • Create a microflow to change the sequence of articles in the issue.
    • This microflow can take the issue and a list of articles in the new sequence as parameters.
    • Update the StartPage and EndPage attributes based on the new sequence.
  5. User Interface:

    • Create pages in your Mendix app to display and edit issues and articles.
    • Use data grids or list views to show articles within an issue.
  6. Flow:

    • When creating a new issue, add articles to the issue in the desired sequence.
    • When changing the sequence, call the microflow to update the start and end pages.

Here's a simplified example of what the microflow logic might look like:


Microflow: CalculatePages

1. Retrieve all articles for the issue.

2. Sort the articles based on the desired sequence.

3. Loop through the sorted articles.   

   a. Set the StartPage of the current article.

   b. Set the EndPage of the current article based on its length and the StartPage.

Microflow: ChangeSequence

1. Retrieve the issue and the new sequence of articles.

2. Clear the existing articles in the issue.

3. Loop through the new sequence.

  a. Create a new association between the issue and the article. 

  b. Call the CalculatePages microflow for the updated sequence.


Remember to adjust the details based on your specific requirements and the Mendix version.

This is a high-level guide, and you may need to adapt it to your specific needs and data model.



** Kindly accept my answer if it assists you in solving your problem.


Assuming you want to create a document with the articles you can create an object in which you set the link to the aritcles and use an index integer to determine the order. THen in the document use a list to display the object ordered by the index and then show the associated article. Now you have full control over the  article order as you can create the logic to create the index object and associations