Coverage Report - org.apache.camel.bam.ProcessContext
 
Classes in this File Line Coverage Branch Coverage Complexity
ProcessContext
0% 
N/A 
1
 
 1  
 /**
 2  
  *
 3  
  * Licensed to the Apache Software Foundation (ASF) under one or more
 4  
  * contributor license agreements.  See the NOTICE file distributed with
 5  
  * this work for additional information regarding copyright ownership.
 6  
  * The ASF licenses this file to You under the Apache License, Version 2.0
 7  
  * (the "License"); you may not use this file except in compliance with
 8  
  * the License.  You may obtain a copy of the License at
 9  
  *
 10  
  * http://www.apache.org/licenses/LICENSE-2.0
 11  
  *
 12  
  * Unless required by applicable law or agreed to in writing, software
 13  
  * distributed under the License is distributed on an "AS IS" BASIS,
 14  
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 15  
  * See the License for the specific language governing permissions and
 16  
  * limitations under the License.
 17  
  */
 18  
 package org.apache.camel.bam;
 19  
 
 20  
 import org.apache.camel.Exchange;
 21  
 import org.apache.camel.bam.model.ProcessInstance;
 22  
 import org.apache.camel.bam.model.ActivityState;
 23  
 
 24  
 /**
 25  
  * @version $Revision: 1.1 $
 26  
  */
 27  
 public class ProcessContext {
 28  
     private Exchange exchange;
 29  
 
 30  
     private ProcessRules processRules;
 31  
     private ActivityRules activityRules;
 32  
 
 33  
     private ProcessInstance processInstance;
 34  
     private ActivityState activityState;
 35  
 
 36  0
     public ProcessContext(Exchange exchange, ActivityRules activityRules, ActivityState activityState) {
 37  0
         this.exchange = exchange;
 38  0
         this.activityRules = activityRules;
 39  0
         this.activityState = activityState;
 40  0
         this.processRules = activityRules.getProcess();
 41  0
         this.processInstance = activityState.getProcess();
 42  0
     }
 43  
 
 44  
     public ActivityRules getActivity() {
 45  0
         return activityRules;
 46  
     }
 47  
 
 48  
     public void setActivity(ActivityRules activityRules) {
 49  0
         this.activityRules = activityRules;
 50  0
     }
 51  
 
 52  
     public ActivityState getActivityState() {
 53  0
         return activityState;
 54  
     }
 55  
 
 56  
     public void setActivityState(ActivityState activityState) {
 57  0
         this.activityState = activityState;
 58  0
     }
 59  
 
 60  
     public Exchange getExchange() {
 61  0
         return exchange;
 62  
     }
 63  
 
 64  
     public void setExchange(Exchange exchange) {
 65  0
         this.exchange = exchange;
 66  0
     }
 67  
 
 68  
     public ProcessRules getProcessDefinition() {
 69  0
         return processRules;
 70  
     }
 71  
 
 72  
     public void setProcessDefinition(ProcessRules processRules) {
 73  0
         this.processRules = processRules;
 74  0
     }
 75  
 
 76  
     public ProcessInstance getProcessInstance() {
 77  0
         return processInstance;
 78  
     }
 79  
 
 80  
     public void setProcessInstance(ProcessInstance processInstance) {
 81  0
         this.processInstance = processInstance;
 82  0
     }
 83  
 
 84  
     public ActivityState getActivityState(ActivityRules activityRules) {
 85  0
         return getProcessInstance().getActivityState(activityRules);
 86  
     }
 87  
 
 88  
     /**
 89  
      * Called when the activity is started which may end up creating some timers
 90  
      * for dependent actions
 91  
      */
 92  
     public void onStarted(ActivityState activityState) {
 93  
         /** TODO */
 94  0
     }
 95  
 
 96  
     /**
 97  
      * Called when the activity is completed which may end up creating some timers
 98  
      * for dependent actions
 99  
      */
 100  
     public void onCompleted(ActivityState activityState) {
 101  
         /** TODO */
 102  0
     }
 103  
 }