The claim is the following:
Consider a unital commutative ring $R$ with $R=X_1 \oplus \ldots \oplus X_n = Y_1 \oplus \ldots \oplus Y_m$ ($n,m \in \mathbb{N}^+$) where each of the summands is an ideal that is further indecomposable. Then $n=m$ and the two decompositions may differ only in order.
I have something in mind that from the decomposition we should make a composition series somehow, and then apply the Jordan-Hölder theorem, but I am not sure how exactly to proceed. Will anyone help me out with the proof of this, because I am getting a bit confused.
UPDATE: Is the following reasoning correct?
$$0 \leq X_1 \leq X_1 \oplus X_2 \leq \ldots \leq X_1 \oplus \ldots \oplus X_n = R$$ and $$0 \leq Y_1 \leq Y_1 \oplus Y_2 \leq \ldots \leq Y_1 \oplus \ldots \oplus Y_m = R$$ are both finite composition series of $R$, so Jordan-Hölder Theorem implies their equivalence which is exactly what is needed?
While your reasoning is correct, what you have proved is weaker than the claim.
The claim should mean there is a permutation $\sigma$ of $[n]$ such that $X_i= Y_{\sigma(i)}$ as sets (or ideals of $R$). The following is a simple proof of the claim.
For all $i\in [n]$, $$X_i=X_1R=X_i(Y_1+\cdots+Y_n)=X_iY_1 + \cdots + X_iY_m,$$ where $X_iY_j\subseteq Y_j$ for all $j\in[m]$.
Since $X_i$ is indecomposable and $Y_1+\cdots+Y_m$ is a direct sum, all of $X_iY_1, \cdots, X_iY_m$ must be $0$ except for one of them, which we will denote by $X_iY_{\sigma(i)}$. So $X_i=X_iY_{\sigma(i)}\subseteq Y_{\sigma(i)}$.
Symmetrically, there is a map $\tau$ such that for all $j\in[m]$ $\ Y_j\subseteq X_{\tau(j)}$.
Hence for all $i\in[n]$, $\ X_i\subseteq Y_{\sigma(i)}\subseteq X_{\tau(\sigma(i))}$. Since $X_1,\cdots,X_n$ are nonzero sets that intersect each other only at $0$, we have $i=\tau(\sigma(i))$ and hence $X_i=Y_{\sigma(i)}$.
Symmetrically, we have for all $j\in[m]$, $\ \sigma(\tau(j))=j$ and $Y_j=X_{\tau(j)}$.
So $\sigma:[n]\to[m]$ and $\tau:[m]\to[n]$ are inverse to each other, i.e., they are permutations. Hence $n=m$ and $\{X_1,\cdots, X_n\}=\{Y_1,\cdots, Y_m\}$.