• 沒有找到結果。

Output: anomalies

Begin

33. Switch(g, a){

In Algorithm 4.1, the loops in the workflow w are replaced with acyclic structure by using Algorithm 3.3 at line 1. Algorithms 3.1 and 3.2 are applied to compute the level and EAI of each process in lines 2-3. Algorithm 4.1 adopts a similar traveling method as in Algorithm 3.3, so that we do not explain in details for the structure of both “while” and “for” loops in lines 4-63. However, the computation at each turn of the “for” loop is based on the type of process z. The cases for split and joint processes are handled in lines 11-21 and not discussed in details since it is similar to the Algorithm 3.3 containing the anomaly detection steps working on the process z being handled.

For each process, neither split nor joint, the computations are done in lines 22-61.

At line 24, set A is calculated to contain the artifacts operated in the process z. For each artifact, such as a, in A, we define a three tuple (p, a, o) named as pao to simplify our discussion, where p is a process before z, and o is the activity (operation) working on a at p, i.e., o is one of activities, Def, Kill and Use. The pao of each artifact in A is calculated and all the pao’s derived are form as a set S in lines 25-28, where the details of how to get the processes are skipped because we adopt a traveling method in Algorithm 3.2 which has been shown correct.

The do-while loop detects the potential anomaly(ies) due to blank branches in lines 29-59. At line 30, All pao’s in S whose p is a immediate predecessor of z are collected as a set S’. At the end (lines 55-59) of each turn of the loop, if S is changed, S’ contains at least one XOR element that has a blank branch and the next turn starts.

Otherwise, the loop terminates.

In each turn, line 31 is responsible for identifying concurrency for the processes of pao in S’. G is a set of elements which are the set containing pao’s. After G is constructed at line 31, G has the following properties:

1. For each element g in G, if pa1 and pa2 belong to g, pa1.p and pa2.p are

However, the calculation of G is a NP problem: maximum clique problem, and the lemma 2 in Section 4 in [7] is adopted at line 31.

Lines 32-53 analyze each pair (g, a) where g G and a A. According to the discussion in Chapter 2, all possible pairs for (g, a) can be classified into five cases, including single operation and the corresponding operations are described correspondingly as below:

1. The component elements in g are IDS/IDK for a, g itself contains Useless Definition anomaly. Besides, if artifact a has Use operation in g, there is an anomaly of ambiguous use. The handling operations are done in lines 35-37.

2. The operations in g are IKU/IKS. g itself contains an anomaly of Null Kill.

If there is a Use operation on a in z, it causes anomaly of Undefined Usage.

Otherwise, if there is a Kill operation on a in z, it causes anomaly of Null Kill. The handling operations are done in lines 39-43.

3. The operations in g are IDU. If artifact a has Def operation in z, there is anomaly of Useless Definition. The handling operations are done in lines 44-45.

4. The operations in g is Def. If artifact a has Def operation in z, it causes anomaly of Useless Definition. Otherwise, if artifact a has Kill operation in z, it causes anomaly of Null Kill. The handling operations are done in lines 47-51.

5. The operation in g is Kill. If artifact a has Kill operation in z, it causes anomaly of Null Kill. The handling operation is done line 53.

Finally, the content of S is copied to S’’ at line 55. For each process of pao in S’, if there exists an XOR structure X containing the process of pao, X is associated with the same level of the process, and X has XBB, the pao’s in S’ whose process is contained in X are removed from S in lines 56-58. Now, at line 59, that S equals to S’’

indicates there is no blank branch found in XOR structures in lines 55-58. Thus, the do-while loop terminates when the content of S and S’’ are equal, continues otherwise.

After the loop, enqueuing z into q at line 60 is the last step of the handling a successor z of process y.

In algorithm 4.1, lines 23-60 are responsible to find out all the artifact anomalies associated with the operation in the concerned process. The loop defined at line 7 shall pass all processes. In other word, all the processes except split/joint process are examined. Thus, all the anomalies in workflow are detected by algorithm 4.1.

For instance, a sample of TS workflow associated with operation working on an artifact a in Figure 4.1, Algorithm 4.1 would detects Useless Definition at P3 because both P2 and P3 have Def working on a.

Figure 4.1 A sample TS workflow associated with operation working on an artifact a

4.2 Incremental anomaly detection

Each loop in a workflow is transformed into an acyclic structure based on the definition of Section 2.4. Thus, each TS workflow diagram being edited has a corresponding acyclic workflow diagram, named as CTS workflow. Section 4.2 presents a set of algorithms for incremental anomaly analysis of the CTS, which is done once the operation edition on artifacts inside a single process or a structure modification such as insertion/deletion completes in the original workflow.

4.2.1 Detection inside a TS workflow

Our incremental analysis works based on divide and conquer mechanism; it contains three steps, step by step:

1. analyzing the block containing edited process.

2. analyzing the rest of workflow.

3. Computing the anomalies according to the results of 1 and 2.

To simplify the analysis work and discussion, we define five attributes to be

associated with each process p in a workflow w, besides level, working duration, and EAI which are described in Chapters 2 and 3. The definitions of these attributes are defined below:

1. There are five process types: asp, ajp, xsp, xjp and ap; asp/ajp and xsp/xjp indicate split/joint process of AND and XOR respectively, and ap indicates activity process.

2. AOSetp = {(a, o) | a is an artifact in w, operation o works on a in p, and o {Def, Kill, Use}}.

3. ImmeSucprepresents the set of process(es) of which each has an operation on a, and there is an empty path on a from p to the process. Moreover we define ImmeSucp(Def) = {q | q ImmeSucp , the operation of a in q is Def}, ImmeSucp(Kill) = {q | q ImmeSucp , the operation of a in q is Kill}, ImmeSucp(Use) = {q | q ImmeSucp , the operation of a in q is Use}.

4. ImmePrep represents the set of process(es) of which each has an operation on a, and there is an empty path on a from the process to p. we define the following sets: ImmePrep (Def) = {q | q ImmeSucp, the operation of a in q is Def}, ImmePrep(Kill) = {q | q ImmeSucp , the operation of a in q is Kill}, and ImmePrep(Use) = {q |q ImmeSucp , the operation of a in q is Use}.

An incremental analysis in general is to analyze abnormal operation behavior due to an operation in a workflow editor [12]. Because such an analysis has been shown to be an NP problem when a workflow contains a loop(s), we define a new incremental approach to simplify the work. In our work, when a TS workflow is modified (addition/deletion/modification a process) by user, our approach has a

corresponding modification in its CTS workflow to reduce the analysis work and thus waiting time for designer.

To simplify the discussion, the incremental analysis algorithms presented are based on each of the following four types of edit activities:

1. Insertion/deletion of a workflow template indicates to insert/delete a Loop/AND/XOR structure or an activity process.

2. Insertion/deletion of an operation on some artifact.

3. modification of (min, max) turns of a loop.

4. modification of (mix, max) time interval of a process.

Because each loop in a TS workflow has a corresponding complicated acyclic structure in its CTS workflow, when an insertion/deletion/modification of a loop in a TS workflow occurs, the target CTS workflow has to be modified first in order to follow the reduction principle in Section 2.4 correspondingly. Insertion/deletion of an operation on an artifact a is to add/delete an operation on a in an activity process p. To simplify the analysis, it is assumed that an artifact has at most one operation in an activity process. After an operation on a is inserted/delete in p, there is one operation/no operation for a in p and corresponding process(es) in the CTS workflow.

The modification of (min, max) turns for a loop is to increase/decrease the minimum/maximum turns of a loop. As mentioned before, a loop can be transformed into an acyclic structure when a designer adds the loop into a TS workflow (Section 2.4). It has to modify the corresponding CTS workflow for a modification of (min, max) turns of a loop. The modifications of a loop is done by increasing/deleting for one of both of (min, max), and one increases and the other decreases. The modification of a CTS workflow can be discussed according to the followings:

1. The resulting value of subtracting min from max is larger. This case occurs

due to:

a. max is of no change or incremented, but min is incremented lower, of no change, or decremented.

b. max is decremented, but min is decremented larger.

2. The resulting value become smaller. This occurs due to:

a. max is of no change or incremented, but min is incremented larger.

b. max is decremented, but min is incremented, of no change, or decremented lower.

Modification of (min, max) time for a process is to change minimum/maximum working duration of an activity process. If a designer modifies the working duration of an activity process in a loop, it has to adjust the timing of the corresponding acyclic which contain this data in the CTS workflow.

It might update ImmeSucap and ImmePreap of a process p when an edit activity to artifact a occur somewhere else. In our approach, the analysis is focused on a workflow block, containing the process p being edited, and starts by computing ImmeSucap and ImmePreap according to the level of the block. Algorithm 4.2 computes ImmeSucap and Algorithm 4.3 computes ImmePreap. Because we analyze a workflow at a predefined level, obviously, some information need be modified due to an edit activity. The information modification related to the blank branches between p and p’ is done with Algorithm 4.4. which outputs a set of artifacts containing at least one operation in each branch between two input processes p and p’.

Both Algorithm 4.2 and Algorithm 4.3 work with input (w, a, p, p’), where w is a workflow, a is an artifact, and p and p’ are processes. Algorithm 4.2 starts the computation from p, decides whether to make a recursive based on p’, and terminates with output ImmeSucap. Input p’ in Algorithm 4.3 is a split process and the output is

ImmePreap.

相關文件