Weaving of advice broken

Issue #278 resolved
Matthias Schoettle created an issue

Currently, weaving of an advice into an existing message view only works if the OriginalBehaviourExecution fragment is located in the interaction itself (i.e., not in a combined fragment).

The reason is that the advice is woven into the message view and not the message view into the location of where that original behaviour fragment is placed.

Since the message view should be kept, I propose the adjustment of weaving advices as follows:

  1. Maintain a sequence of fragments of the existing message view (only from index 1 to n-1, since the initial and reply message will not be changed)
  2. Copy all the fragments of the advice into the existing message view at index 1
    • this is done the same way as currently (i.e., the lifelines are copied or merged as well as the messages)
    • remember the container and index of the OriginalBehaviourExecution fragment
  3. Replace the original ... fragment with the sequence of fragments (i.e., they are moved to that place)
  4. Update the coveredBy of affected fragments/lifelines in case the original fragments were moved into a combined fragment (see #162)

Comments (5)

  1. Matthias Schoettle reporter

    References #278: Adds a recursive method that updates the position of the original behaviour when the OriginalBehaviourExecution fragment is located inside a combined fragment of the advice. Moves the original behaviour to the container where the fragment was found.

    → <<cset 93723768ff0c>>

  2. Matthias Schoettle reporter

    References #278: Changes the way the advice is woven such that in all cases the updateOriginalBehaviourPosition method is used.

    The advice is woven it at the top of the message view. Then, the original behaviour fragment is located and the actual behaviour moved to that position.

    → <<cset f6e701fe2cd1>>

  3. Log in to comment