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