• 沒有找到結果。

Output: The set of processes which are concurrent to p in w Begin

01. S = ;

02. p’ = the predecessor of p;

03. while(p’.level > 0){ predecessor equals to zero. In Algorithm 4.6, s is initialized as an empty set (line 1). If p is an AND split process, Algorithm 4.5 is called for the each successor of p, but the predecessor of p, where another parameter is p’s corresponding joint process. The works are done as a while loop which stops when p’.level equals to zero. After getting all the process which might be parallel with p, line 11 filtering out those which cannot concurrent with p according to temporal information.

S is initially empty set at line 1. p’ is assigned as predecessor of p. Line 3 -10 is a while loop, if p’.level is greater than zero, it executes line 4-9. At line 4, if p’ is an AND split process, it inputs successors of p’ to Algorithm 4.5 at line 6 to get the processes in each branch, and the results is putted into S, but the branch containing p is not executed because we only need the processes which are parallel with p at line 5.

At line 9, p’ is assigned as its predecessor. If p’.level equals to zero, it indicates no control block need to be inspected. Line 11 collects the processes which their EAI are overlaid with the EAI of p. Line 12 returns the set of processes which are concurrent to p. For instance, Algorithm 4.6(w, P4) being called in Figure 4.1 would output {P2,

P3}.

Algorithm 4.5 and Algorithm 4.6 can be improved. For instance, since the checking at line 11, Algorithm 4.6 is done for each process in the parallel branch of p.

The checking can be done at each parallel process found to check whether its following process is parallel with p temporally. If the answer is not, it’s not necessary to continue the work for its successor. Thus, it saves the execution time.

Our incremental analysis of a TS workflow is classified into two steps:

1. For the edited process, we observe its immediate predecessor and immediate successor,

a. The loops in this workflow are removed and replaced by XOR structures in our discussion in Section 2.4.

b. It compares ImmeSuc and ImmePre of edited process to check what anomalies occur.

2. For the edited process, we find out the processes which are concurrent to the process by Algorithm 4.6. For each artifact a,

a. the operation in the edited process on a is Def, if there exists Def/Kill in these processes, Useless Definition occurs.

b. the operation in the edited process on a is Kill, if there exists Def/Kill/Use in these processes, Useless Definition/Null Kill/Undefined Usage occur.

c. the operation in the edited process on a is Use, if there exists Kill in these processes to cause Undefined Usage.

4.2.3 Anomaly detection with the algorithms in above two subsections

Consider the edit activities in a well-formed workflow editing environment, there are at least 5 types of editing activities, besides moving the cursor,

1. Add/delete a flow structure of AND/XOR/LOOP,

2. Transfer a flow structure intro another structure, for example, transfer an AND structure into an XOR structure,

3. Add/delete a branch

4. Modify the content of an activity process, and

5. Move one process (a simple activity process or a process which can be decomposed into a workflow diagram) from one location to another.

An incremental analysis is done right after each edit activity. To simplify the analysis work, we can redefine these works type by type as follows:

1. As type one, “add” can be treated as adding an empty structure of AND/XOR/LOOP, but “delete” can be treated as deleting a workflow structure directly, i.e., deleting a process which can be decomposed into a workflow of one of AND/XOR/LOOP structure.

2. A transfer can be done 1) between AND and XOR, 2) between LOOP and XOR.

3. An activity process can be deemed as containing a sequence of activities, where each artifact is given one of the following actions: Define, Reference, Kill

4. When completing a move activity, it can be treated as 2 steps: a) delete a process at one location and b) add this process into another location., and inserting/deleting a branch.

Because a process of some structure can be treated as a complex process to be decomposed recursively, types 1 and 4 and merged together. Inserting/Deleting a branch can be treated as the activities: a sequence of process insertions/deletions and

then handling an empty branch. Therefore, an incremental analysis can be done right after

1. Adding/Deleting a complicated process, 2. Adding/Deleting an empty branch,

3. Adding/Deleting an simple activity process, and

4. Transferring an AND/LOOP to an XOR Structure and vice versa.

In our model, each TS workflow being edited can be transformed into a CTS workflow used for analysis. In the thesis, we are studying the anomaly analysis after each of the following activities on a CTS workflow to simply the analysis work further:

1. Adding an empty AND/XOR/activity process, 2. Deleting an activity AND/XOR/activity process, 3. Modifying the activity(ies) in an activity process and

4. Inserting/Deleting an empty branch without changing the structure.

Before the discussion of calculations with above algorithms, during incremental analysis, each node in a CTW workflow is defined to be associated with the information described in Section 4.2.1 to maintain the information to reduce the computation. In other word, each node contains level, working duration, EAI, process type, ImmeSucap, ImmePreap and AOSetp.

For case 1, there is no analysis only, because no activity change occurs. After an edit for a simple process at case 2 and 3, Algorithms 4.2 and 4.3 can be applied to find the immediate previous/next activities for the artifact whose activities are inserted, deleted or modified (after being deleted and then inserted). Therefore, the operation anomalies for the artifact can be detected/corrected. For case 4, i.e., after an

insertion/deletion of a branch occurs, Algorithm 4.4 is applied to find all the artifacts which have an activity before the branch. An empty branch added/deleted in a AND structure do not affect the information and thus anomalies. Thus, there is no analysis.

However, for the insertion/deletion of an empty branch in an XOR structure, it is introduced/deleted a valid path which contains this branch. An anomaly detection can be done for each artifact which has an immediate predecessor of the split node of this branch. The corresponding computation are described in Algorithms 4.8 and 4.9, by applying Algorithms 4.2, 4.3, 4.4, and 4.7.

Algorithm 4.7 detects anomalies between two set of processes. Algorithm 4.7 accepts (a, Pre, Suc), where a is an artifact, and for each process p in Pre, each process q in Suc, there exist a path from p to q. Finally Algorithm 4.7 output anomalies.

相關文件