|
Re: Problem in a loop parcour XML [message #882045 is a reply to message #882028] |
Tue, 05 June 2012 13:34  |
Eclipse User |
|
|
|
Hi
I've no idea what you want. Your requirement for
"le message switch off() a comme source une frontiere et comme destination un controle"
bears no relationship to the rest of your message.
Your complex use of Java reminds me of the benefits of OCL.
Since you're using Java, use your Java debugger.
Regards
Ed Willink
On 05/06/2012 17:50, Hela Hakim wrote:
> Hello all,
> is the following XML file (ci_joint) and the both following code
> for (Element lifeline : lifelineElements) {
> for (Element message : messagesElements) {
>
> for (Element boundary : boundaryChildren) {
> for (Element control : controlChildren) {
> Boolean messageEmi = lifeline.getAttributeValue("coveredBy")
> .contains(message.getAttributeValue("sendEvent"));
>
>
> Boolean boundaryLifeline = lifeline.getAttributeValue("id", namespaces.get("xmi"))
> .equals(boundary.getAttributeValue("base_Lifeline"));
>
> // System.out.println(message.getAttributeValue("name"));
> if (messageEmi&& boundaryLifeline)
>
>
> {
>
> System.out.println("l'objet source du message " + message.getAttributeValue("name")
> + "est une frontiére");
>
>
> }}}}}
> et for (Element lifeline : lifelineElements) {
> for (Element message : messagesElements) {
>
>
> for (Element control : controlChildren) {
>
> Boolean controleLifeline = lifeline.getAttributeValue("id",
> namespaces.get("xmi")).equals(
> control.getAttributeValue("base_Lifeline"));
>
> Boolean messageRecu = lifeline.getAttributeValue(
> "coveredBy").contains(
> message.getAttributeValue("receiveEvent"));
>
> if (messageRecu&& controleLifeline)
>
> {
> System.out.println("l'objet destination du message "
> + message.getAttributeValue("name")
> + "est un controle ");
>
>
> }
> }
> }
> }
>
> each of these two code gives good resulats is displaying the first code is:
> "l'objet source du message switchoff()est une frontiére"
> the result of the second code is:
> "l'objet destination du message switchoff()est un controle
> l'objet destination du message performshutdown()est un controle "
> I now want to test that combines two code in other words i want a test that has as result:
> "le message switch off() a comme source une frontiere et comme destination un controle"
> I'm really stuck for days .. :roll:
> Thank you for any help
>
|
|
|
Powered by
FUDForum. Page generated in 0.03991 seconds