Good day, fellow Appian developers,
I have a question about best practices regarding managing document uploads conditionally.
Scenario:
I have about 11 user tasks in a new application. Each task has different business logic regarding what documents can be uploaded and how. For example:
On the first task, only documentType1 and documentType2 can be uploaded.
documentType1
documentType2
documentType1 can be uploaded only once and must have a .docx extension.
.docx
documentType2 can be uploaded multiple times, with no restriction on file extension.
Business rules will vary from task to task. Additionally, this setup is currently only applicable for country1/organization1.
Over time, this process will be adapted for seven organizations/countries. Each organization will have different business rules about what documents are required and how they can be uploaded in each task.
Since this involves quite a number of validations, what is the best practice for creating a generic document upload component that can work across all organizations and tasks within this process type?
Would you recommend using configurations in the database, decision trees, or another approach? Is it even feasible to design a truly generic component at this level? This challenge seems to exist across many applications, and we've never handled it properly in the past.
Thank you all in advance!
Discussion posts and replies are publicly visible
Feels like this is more about generic validations, than a generic file upload component. A simple approach could be to create a main validation expression, which takes all the relevant parameters as input, and then branches out to separate and more specific validation expressions.
Hi Tomislav Fuček This is a common scenario, and it's definitely feasible to design a generic, scalable document upload component. Here's a recommended approach:
1. Use Configuration Tables: Store rules like allowed document types, file extensions, upload limits, and task/organization mappings in a database. This makes your logic data-driven and easy to update.
2. Decision Rules: Use decision tables or expression rules to fetch validation logic dynamically based on task and organization.
3. Reusable Component: Build a reusable upload interface that takes task name and organization as inputs, fetches config, and enforces rules (e.g., extension checks, single vs. multiple upload).
4. Centralized Validation: Create one expression rule to handle all upload validations using the config data.
This approach improves maintainability and makes it easy to adapt for new organizations or countries.