You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by sh...@apache.org on 2015/08/03 21:38:44 UTC

airavata git commit: Update experiment status according to the process status changes

Repository: airavata
Updated Branches:
  refs/heads/master eb4a737c5 -> f903d6014


Update experiment status according to the process status changes


Project: http://git-wip-us.apache.org/repos/asf/airavata/repo
Commit: http://git-wip-us.apache.org/repos/asf/airavata/commit/f903d601
Tree: http://git-wip-us.apache.org/repos/asf/airavata/tree/f903d601
Diff: http://git-wip-us.apache.org/repos/asf/airavata/diff/f903d601

Branch: refs/heads/master
Commit: f903d601405a2ba8182d864437fd4a2c97a4b74a
Parents: eb4a737
Author: Shameera Rathanyaka <sh...@gmail.com>
Authored: Mon Aug 3 15:38:36 2015 -0400
Committer: Shameera Rathanyaka <sh...@gmail.com>
Committed: Mon Aug 3 15:38:36 2015 -0400

----------------------------------------------------------------------
 .../lib/airavata/messaging_events_types.cpp     |  29 ++++-
 .../lib/airavata/messaging_events_types.h       |  11 +-
 .../Airavata/Model/Messaging/Event/Types.php    |  25 +++-
 .../airavata/model/messaging/event/ttypes.py    |  21 +++-
 .../messaging/event/ProcessSubmitEvent.java     | 109 +++++++++++++++++-
 .../airavata/gfac/server/GfacServerHandler.java |  22 +++-
 .../core/impl/RabbitMQStatusConsumer.java       |  19 ++--
 .../core/impl/GFACPassiveJobSubmitter.java      |   8 +-
 .../server/OrchestratorServerHandler.java       | 113 +++++++++++++++----
 .../orchestrator/util/OrchestratorUtils.java    |  45 ++++++++
 .../airavata-api/messaging_events.thrift        |   3 +-
 11 files changed, 354 insertions(+), 51 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/f903d601/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/airavata/messaging_events_types.cpp
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/airavata/messaging_events_types.cpp b/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/airavata/messaging_events_types.cpp
index b32a987..154c49c 100644
--- a/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/airavata/messaging_events_types.cpp
+++ b/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/airavata/messaging_events_types.cpp
@@ -1285,12 +1285,16 @@ void ProcessSubmitEvent::__set_gatewayId(const std::string& val) {
   this->gatewayId = val;
 }
 
+void ProcessSubmitEvent::__set_experimentId(const std::string& val) {
+  this->experimentId = val;
+}
+
 void ProcessSubmitEvent::__set_tokenId(const std::string& val) {
   this->tokenId = val;
 }
 
-const char* ProcessSubmitEvent::ascii_fingerprint = "AB879940BD15B6B25691265F7384B271";
-const uint8_t ProcessSubmitEvent::binary_fingerprint[16] = {0xAB,0x87,0x99,0x40,0xBD,0x15,0xB6,0xB2,0x56,0x91,0x26,0x5F,0x73,0x84,0xB2,0x71};
+const char* ProcessSubmitEvent::ascii_fingerprint = "C93D890311F28844166CF6E571EB3AC2";
+const uint8_t ProcessSubmitEvent::binary_fingerprint[16] = {0xC9,0x3D,0x89,0x03,0x11,0xF2,0x88,0x44,0x16,0x6C,0xF6,0xE5,0x71,0xEB,0x3A,0xC2};
 
 uint32_t ProcessSubmitEvent::read(::apache::thrift::protocol::TProtocol* iprot) {
 
@@ -1305,6 +1309,7 @@ uint32_t ProcessSubmitEvent::read(::apache::thrift::protocol::TProtocol* iprot)
 
   bool isset_processId = false;
   bool isset_gatewayId = false;
+  bool isset_experimentId = false;
   bool isset_tokenId = false;
 
   while (true)
@@ -1333,6 +1338,14 @@ uint32_t ProcessSubmitEvent::read(::apache::thrift::protocol::TProtocol* iprot)
         break;
       case 3:
         if (ftype == ::apache::thrift::protocol::T_STRING) {
+          xfer += iprot->readString(this->experimentId);
+          isset_experimentId = true;
+        } else {
+          xfer += iprot->skip(ftype);
+        }
+        break;
+      case 4:
+        if (ftype == ::apache::thrift::protocol::T_STRING) {
           xfer += iprot->readString(this->tokenId);
           isset_tokenId = true;
         } else {
@@ -1352,6 +1365,8 @@ uint32_t ProcessSubmitEvent::read(::apache::thrift::protocol::TProtocol* iprot)
     throw TProtocolException(TProtocolException::INVALID_DATA);
   if (!isset_gatewayId)
     throw TProtocolException(TProtocolException::INVALID_DATA);
+  if (!isset_experimentId)
+    throw TProtocolException(TProtocolException::INVALID_DATA);
   if (!isset_tokenId)
     throw TProtocolException(TProtocolException::INVALID_DATA);
   return xfer;
@@ -1370,7 +1385,11 @@ uint32_t ProcessSubmitEvent::write(::apache::thrift::protocol::TProtocol* oprot)
   xfer += oprot->writeString(this->gatewayId);
   xfer += oprot->writeFieldEnd();
 
-  xfer += oprot->writeFieldBegin("tokenId", ::apache::thrift::protocol::T_STRING, 3);
+  xfer += oprot->writeFieldBegin("experimentId", ::apache::thrift::protocol::T_STRING, 3);
+  xfer += oprot->writeString(this->experimentId);
+  xfer += oprot->writeFieldEnd();
+
+  xfer += oprot->writeFieldBegin("tokenId", ::apache::thrift::protocol::T_STRING, 4);
   xfer += oprot->writeString(this->tokenId);
   xfer += oprot->writeFieldEnd();
 
@@ -1384,17 +1403,20 @@ void swap(ProcessSubmitEvent &a, ProcessSubmitEvent &b) {
   using ::std::swap;
   swap(a.processId, b.processId);
   swap(a.gatewayId, b.gatewayId);
+  swap(a.experimentId, b.experimentId);
   swap(a.tokenId, b.tokenId);
 }
 
 ProcessSubmitEvent::ProcessSubmitEvent(const ProcessSubmitEvent& other29) {
   processId = other29.processId;
   gatewayId = other29.gatewayId;
+  experimentId = other29.experimentId;
   tokenId = other29.tokenId;
 }
 ProcessSubmitEvent& ProcessSubmitEvent::operator=(const ProcessSubmitEvent& other30) {
   processId = other30.processId;
   gatewayId = other30.gatewayId;
+  experimentId = other30.experimentId;
   tokenId = other30.tokenId;
   return *this;
 }
@@ -1403,6 +1425,7 @@ std::ostream& operator<<(std::ostream& out, const ProcessSubmitEvent& obj) {
   out << "ProcessSubmitEvent(";
   out << "processId=" << to_string(obj.processId);
   out << ", " << "gatewayId=" << to_string(obj.gatewayId);
+  out << ", " << "experimentId=" << to_string(obj.experimentId);
   out << ", " << "tokenId=" << to_string(obj.tokenId);
   out << ")";
   return out;

http://git-wip-us.apache.org/repos/asf/airavata/blob/f903d601/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/airavata/messaging_events_types.h
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/airavata/messaging_events_types.h b/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/airavata/messaging_events_types.h
index 33071ac..63556e4 100644
--- a/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/airavata/messaging_events_types.h
+++ b/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/airavata/messaging_events_types.h
@@ -509,23 +509,26 @@ void swap(JobIdentifier &a, JobIdentifier &b);
 class ProcessSubmitEvent {
  public:
 
-  static const char* ascii_fingerprint; // = "AB879940BD15B6B25691265F7384B271";
-  static const uint8_t binary_fingerprint[16]; // = {0xAB,0x87,0x99,0x40,0xBD,0x15,0xB6,0xB2,0x56,0x91,0x26,0x5F,0x73,0x84,0xB2,0x71};
+  static const char* ascii_fingerprint; // = "C93D890311F28844166CF6E571EB3AC2";
+  static const uint8_t binary_fingerprint[16]; // = {0xC9,0x3D,0x89,0x03,0x11,0xF2,0x88,0x44,0x16,0x6C,0xF6,0xE5,0x71,0xEB,0x3A,0xC2};
 
   ProcessSubmitEvent(const ProcessSubmitEvent&);
   ProcessSubmitEvent& operator=(const ProcessSubmitEvent&);
-  ProcessSubmitEvent() : processId(), gatewayId(), tokenId() {
+  ProcessSubmitEvent() : processId(), gatewayId(), experimentId(), tokenId() {
   }
 
   virtual ~ProcessSubmitEvent() throw();
   std::string processId;
   std::string gatewayId;
+  std::string experimentId;
   std::string tokenId;
 
   void __set_processId(const std::string& val);
 
   void __set_gatewayId(const std::string& val);
 
+  void __set_experimentId(const std::string& val);
+
   void __set_tokenId(const std::string& val);
 
   bool operator == (const ProcessSubmitEvent & rhs) const
@@ -534,6 +537,8 @@ class ProcessSubmitEvent {
       return false;
     if (!(gatewayId == rhs.gatewayId))
       return false;
+    if (!(experimentId == rhs.experimentId))
+      return false;
     if (!(tokenId == rhs.tokenId))
       return false;
     return true;

http://git-wip-us.apache.org/repos/asf/airavata/blob/f903d601/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/lib/Airavata/Model/Messaging/Event/Types.php
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/lib/Airavata/Model/Messaging/Event/Types.php b/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/lib/Airavata/Model/Messaging/Event/Types.php
index c6dce6c..6fa7020 100644
--- a/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/lib/Airavata/Model/Messaging/Event/Types.php
+++ b/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/lib/Airavata/Model/Messaging/Event/Types.php
@@ -1159,6 +1159,10 @@ class ProcessSubmitEvent {
   /**
    * @var string
    */
+  public $experimentId = null;
+  /**
+   * @var string
+   */
   public $tokenId = null;
 
   public function __construct($vals=null) {
@@ -1173,6 +1177,10 @@ class ProcessSubmitEvent {
           'type' => TType::STRING,
           ),
         3 => array(
+          'var' => 'experimentId',
+          'type' => TType::STRING,
+          ),
+        4 => array(
           'var' => 'tokenId',
           'type' => TType::STRING,
           ),
@@ -1185,6 +1193,9 @@ class ProcessSubmitEvent {
       if (isset($vals['gatewayId'])) {
         $this->gatewayId = $vals['gatewayId'];
       }
+      if (isset($vals['experimentId'])) {
+        $this->experimentId = $vals['experimentId'];
+      }
       if (isset($vals['tokenId'])) {
         $this->tokenId = $vals['tokenId'];
       }
@@ -1226,6 +1237,13 @@ class ProcessSubmitEvent {
           break;
         case 3:
           if ($ftype == TType::STRING) {
+            $xfer += $input->readString($this->experimentId);
+          } else {
+            $xfer += $input->skip($ftype);
+          }
+          break;
+        case 4:
+          if ($ftype == TType::STRING) {
             $xfer += $input->readString($this->tokenId);
           } else {
             $xfer += $input->skip($ftype);
@@ -1254,8 +1272,13 @@ class ProcessSubmitEvent {
       $xfer += $output->writeString($this->gatewayId);
       $xfer += $output->writeFieldEnd();
     }
+    if ($this->experimentId !== null) {
+      $xfer += $output->writeFieldBegin('experimentId', TType::STRING, 3);
+      $xfer += $output->writeString($this->experimentId);
+      $xfer += $output->writeFieldEnd();
+    }
     if ($this->tokenId !== null) {
-      $xfer += $output->writeFieldBegin('tokenId', TType::STRING, 3);
+      $xfer += $output->writeFieldBegin('tokenId', TType::STRING, 4);
       $xfer += $output->writeString($this->tokenId);
       $xfer += $output->writeFieldEnd();
     }

http://git-wip-us.apache.org/repos/asf/airavata/blob/f903d601/airavata-api/airavata-client-sdks/airavata-python-sdk/src/main/resources/lib/apache/airavata/model/messaging/event/ttypes.py
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-client-sdks/airavata-python-sdk/src/main/resources/lib/apache/airavata/model/messaging/event/ttypes.py b/airavata-api/airavata-client-sdks/airavata-python-sdk/src/main/resources/lib/apache/airavata/model/messaging/event/ttypes.py
index 24fbc4b..629dba2 100644
--- a/airavata-api/airavata-client-sdks/airavata-python-sdk/src/main/resources/lib/apache/airavata/model/messaging/event/ttypes.py
+++ b/airavata-api/airavata-client-sdks/airavata-python-sdk/src/main/resources/lib/apache/airavata/model/messaging/event/ttypes.py
@@ -932,6 +932,7 @@ class ProcessSubmitEvent:
   Attributes:
    - processId
    - gatewayId
+   - experimentId
    - tokenId
   """
 
@@ -939,12 +940,14 @@ class ProcessSubmitEvent:
     None, # 0
     (1, TType.STRING, 'processId', None, None, ), # 1
     (2, TType.STRING, 'gatewayId', None, None, ), # 2
-    (3, TType.STRING, 'tokenId', None, None, ), # 3
+    (3, TType.STRING, 'experimentId', None, None, ), # 3
+    (4, TType.STRING, 'tokenId', None, None, ), # 4
   )
 
-  def __init__(self, processId=None, gatewayId=None, tokenId=None,):
+  def __init__(self, processId=None, gatewayId=None, experimentId=None, tokenId=None,):
     self.processId = processId
     self.gatewayId = gatewayId
+    self.experimentId = experimentId
     self.tokenId = tokenId
 
   def read(self, iprot):
@@ -968,6 +971,11 @@ class ProcessSubmitEvent:
           iprot.skip(ftype)
       elif fid == 3:
         if ftype == TType.STRING:
+          self.experimentId = iprot.readString();
+        else:
+          iprot.skip(ftype)
+      elif fid == 4:
+        if ftype == TType.STRING:
           self.tokenId = iprot.readString();
         else:
           iprot.skip(ftype)
@@ -989,8 +997,12 @@ class ProcessSubmitEvent:
       oprot.writeFieldBegin('gatewayId', TType.STRING, 2)
       oprot.writeString(self.gatewayId)
       oprot.writeFieldEnd()
+    if self.experimentId is not None:
+      oprot.writeFieldBegin('experimentId', TType.STRING, 3)
+      oprot.writeString(self.experimentId)
+      oprot.writeFieldEnd()
     if self.tokenId is not None:
-      oprot.writeFieldBegin('tokenId', TType.STRING, 3)
+      oprot.writeFieldBegin('tokenId', TType.STRING, 4)
       oprot.writeString(self.tokenId)
       oprot.writeFieldEnd()
     oprot.writeFieldStop()
@@ -1001,6 +1013,8 @@ class ProcessSubmitEvent:
       raise TProtocol.TProtocolException(message='Required field processId is unset!')
     if self.gatewayId is None:
       raise TProtocol.TProtocolException(message='Required field gatewayId is unset!')
+    if self.experimentId is None:
+      raise TProtocol.TProtocolException(message='Required field experimentId is unset!')
     if self.tokenId is None:
       raise TProtocol.TProtocolException(message='Required field tokenId is unset!')
     return
@@ -1010,6 +1024,7 @@ class ProcessSubmitEvent:
     value = 17
     value = (value * 31) ^ hash(self.processId)
     value = (value * 31) ^ hash(self.gatewayId)
+    value = (value * 31) ^ hash(self.experimentId)
     value = (value * 31) ^ hash(self.tokenId)
     return value
 

http://git-wip-us.apache.org/repos/asf/airavata/blob/f903d601/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/messaging/event/ProcessSubmitEvent.java
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/messaging/event/ProcessSubmitEvent.java b/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/messaging/event/ProcessSubmitEvent.java
index 07efd62..0e92f52 100644
--- a/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/messaging/event/ProcessSubmitEvent.java
+++ b/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/messaging/event/ProcessSubmitEvent.java
@@ -57,7 +57,8 @@ public class ProcessSubmitEvent implements org.apache.thrift.TBase<ProcessSubmit
 
   private static final org.apache.thrift.protocol.TField PROCESS_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("processId", org.apache.thrift.protocol.TType.STRING, (short)1);
   private static final org.apache.thrift.protocol.TField GATEWAY_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("gatewayId", org.apache.thrift.protocol.TType.STRING, (short)2);
-  private static final org.apache.thrift.protocol.TField TOKEN_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("tokenId", org.apache.thrift.protocol.TType.STRING, (short)3);
+  private static final org.apache.thrift.protocol.TField EXPERIMENT_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("experimentId", org.apache.thrift.protocol.TType.STRING, (short)3);
+  private static final org.apache.thrift.protocol.TField TOKEN_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("tokenId", org.apache.thrift.protocol.TType.STRING, (short)4);
 
   private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
   static {
@@ -67,13 +68,15 @@ public class ProcessSubmitEvent implements org.apache.thrift.TBase<ProcessSubmit
 
   private String processId; // required
   private String gatewayId; // required
+  private String experimentId; // required
   private String tokenId; // required
 
   /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
   public enum _Fields implements org.apache.thrift.TFieldIdEnum {
     PROCESS_ID((short)1, "processId"),
     GATEWAY_ID((short)2, "gatewayId"),
-    TOKEN_ID((short)3, "tokenId");
+    EXPERIMENT_ID((short)3, "experimentId"),
+    TOKEN_ID((short)4, "tokenId");
 
     private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
 
@@ -92,7 +95,9 @@ public class ProcessSubmitEvent implements org.apache.thrift.TBase<ProcessSubmit
           return PROCESS_ID;
         case 2: // GATEWAY_ID
           return GATEWAY_ID;
-        case 3: // TOKEN_ID
+        case 3: // EXPERIMENT_ID
+          return EXPERIMENT_ID;
+        case 4: // TOKEN_ID
           return TOKEN_ID;
         default:
           return null;
@@ -141,6 +146,8 @@ public class ProcessSubmitEvent implements org.apache.thrift.TBase<ProcessSubmit
         new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
     tmpMap.put(_Fields.GATEWAY_ID, new org.apache.thrift.meta_data.FieldMetaData("gatewayId", org.apache.thrift.TFieldRequirementType.REQUIRED, 
         new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+    tmpMap.put(_Fields.EXPERIMENT_ID, new org.apache.thrift.meta_data.FieldMetaData("experimentId", org.apache.thrift.TFieldRequirementType.REQUIRED, 
+        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
     tmpMap.put(_Fields.TOKEN_ID, new org.apache.thrift.meta_data.FieldMetaData("tokenId", org.apache.thrift.TFieldRequirementType.REQUIRED, 
         new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
     metaDataMap = Collections.unmodifiableMap(tmpMap);
@@ -153,11 +160,13 @@ public class ProcessSubmitEvent implements org.apache.thrift.TBase<ProcessSubmit
   public ProcessSubmitEvent(
     String processId,
     String gatewayId,
+    String experimentId,
     String tokenId)
   {
     this();
     this.processId = processId;
     this.gatewayId = gatewayId;
+    this.experimentId = experimentId;
     this.tokenId = tokenId;
   }
 
@@ -171,6 +180,9 @@ public class ProcessSubmitEvent implements org.apache.thrift.TBase<ProcessSubmit
     if (other.isSetGatewayId()) {
       this.gatewayId = other.gatewayId;
     }
+    if (other.isSetExperimentId()) {
+      this.experimentId = other.experimentId;
+    }
     if (other.isSetTokenId()) {
       this.tokenId = other.tokenId;
     }
@@ -184,6 +196,7 @@ public class ProcessSubmitEvent implements org.apache.thrift.TBase<ProcessSubmit
   public void clear() {
     this.processId = null;
     this.gatewayId = null;
+    this.experimentId = null;
     this.tokenId = null;
   }
 
@@ -233,6 +246,29 @@ public class ProcessSubmitEvent implements org.apache.thrift.TBase<ProcessSubmit
     }
   }
 
+  public String getExperimentId() {
+    return this.experimentId;
+  }
+
+  public void setExperimentId(String experimentId) {
+    this.experimentId = experimentId;
+  }
+
+  public void unsetExperimentId() {
+    this.experimentId = null;
+  }
+
+  /** Returns true if field experimentId is set (has been assigned a value) and false otherwise */
+  public boolean isSetExperimentId() {
+    return this.experimentId != null;
+  }
+
+  public void setExperimentIdIsSet(boolean value) {
+    if (!value) {
+      this.experimentId = null;
+    }
+  }
+
   public String getTokenId() {
     return this.tokenId;
   }
@@ -274,6 +310,14 @@ public class ProcessSubmitEvent implements org.apache.thrift.TBase<ProcessSubmit
       }
       break;
 
+    case EXPERIMENT_ID:
+      if (value == null) {
+        unsetExperimentId();
+      } else {
+        setExperimentId((String)value);
+      }
+      break;
+
     case TOKEN_ID:
       if (value == null) {
         unsetTokenId();
@@ -293,6 +337,9 @@ public class ProcessSubmitEvent implements org.apache.thrift.TBase<ProcessSubmit
     case GATEWAY_ID:
       return getGatewayId();
 
+    case EXPERIMENT_ID:
+      return getExperimentId();
+
     case TOKEN_ID:
       return getTokenId();
 
@@ -311,6 +358,8 @@ public class ProcessSubmitEvent implements org.apache.thrift.TBase<ProcessSubmit
       return isSetProcessId();
     case GATEWAY_ID:
       return isSetGatewayId();
+    case EXPERIMENT_ID:
+      return isSetExperimentId();
     case TOKEN_ID:
       return isSetTokenId();
     }
@@ -348,6 +397,15 @@ public class ProcessSubmitEvent implements org.apache.thrift.TBase<ProcessSubmit
         return false;
     }
 
+    boolean this_present_experimentId = true && this.isSetExperimentId();
+    boolean that_present_experimentId = true && that.isSetExperimentId();
+    if (this_present_experimentId || that_present_experimentId) {
+      if (!(this_present_experimentId && that_present_experimentId))
+        return false;
+      if (!this.experimentId.equals(that.experimentId))
+        return false;
+    }
+
     boolean this_present_tokenId = true && this.isSetTokenId();
     boolean that_present_tokenId = true && that.isSetTokenId();
     if (this_present_tokenId || that_present_tokenId) {
@@ -374,6 +432,11 @@ public class ProcessSubmitEvent implements org.apache.thrift.TBase<ProcessSubmit
     if (present_gatewayId)
       list.add(gatewayId);
 
+    boolean present_experimentId = true && (isSetExperimentId());
+    list.add(present_experimentId);
+    if (present_experimentId)
+      list.add(experimentId);
+
     boolean present_tokenId = true && (isSetTokenId());
     list.add(present_tokenId);
     if (present_tokenId)
@@ -410,6 +473,16 @@ public class ProcessSubmitEvent implements org.apache.thrift.TBase<ProcessSubmit
         return lastComparison;
       }
     }
+    lastComparison = Boolean.valueOf(isSetExperimentId()).compareTo(other.isSetExperimentId());
+    if (lastComparison != 0) {
+      return lastComparison;
+    }
+    if (isSetExperimentId()) {
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.experimentId, other.experimentId);
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+    }
     lastComparison = Boolean.valueOf(isSetTokenId()).compareTo(other.isSetTokenId());
     if (lastComparison != 0) {
       return lastComparison;
@@ -456,6 +529,14 @@ public class ProcessSubmitEvent implements org.apache.thrift.TBase<ProcessSubmit
     }
     first = false;
     if (!first) sb.append(", ");
+    sb.append("experimentId:");
+    if (this.experimentId == null) {
+      sb.append("null");
+    } else {
+      sb.append(this.experimentId);
+    }
+    first = false;
+    if (!first) sb.append(", ");
     sb.append("tokenId:");
     if (this.tokenId == null) {
       sb.append("null");
@@ -477,6 +558,10 @@ public class ProcessSubmitEvent implements org.apache.thrift.TBase<ProcessSubmit
       throw new org.apache.thrift.protocol.TProtocolException("Required field 'gatewayId' is unset! Struct:" + toString());
     }
 
+    if (!isSetExperimentId()) {
+      throw new org.apache.thrift.protocol.TProtocolException("Required field 'experimentId' is unset! Struct:" + toString());
+    }
+
     if (!isSetTokenId()) {
       throw new org.apache.thrift.protocol.TProtocolException("Required field 'tokenId' is unset! Struct:" + toString());
     }
@@ -534,7 +619,15 @@ public class ProcessSubmitEvent implements org.apache.thrift.TBase<ProcessSubmit
               org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
             }
             break;
-          case 3: // TOKEN_ID
+          case 3: // EXPERIMENT_ID
+            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+              struct.experimentId = iprot.readString();
+              struct.setExperimentIdIsSet(true);
+            } else { 
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+            }
+            break;
+          case 4: // TOKEN_ID
             if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
               struct.tokenId = iprot.readString();
               struct.setTokenIdIsSet(true);
@@ -565,6 +658,11 @@ public class ProcessSubmitEvent implements org.apache.thrift.TBase<ProcessSubmit
         oprot.writeString(struct.gatewayId);
         oprot.writeFieldEnd();
       }
+      if (struct.experimentId != null) {
+        oprot.writeFieldBegin(EXPERIMENT_ID_FIELD_DESC);
+        oprot.writeString(struct.experimentId);
+        oprot.writeFieldEnd();
+      }
       if (struct.tokenId != null) {
         oprot.writeFieldBegin(TOKEN_ID_FIELD_DESC);
         oprot.writeString(struct.tokenId);
@@ -589,6 +687,7 @@ public class ProcessSubmitEvent implements org.apache.thrift.TBase<ProcessSubmit
       TTupleProtocol oprot = (TTupleProtocol) prot;
       oprot.writeString(struct.processId);
       oprot.writeString(struct.gatewayId);
+      oprot.writeString(struct.experimentId);
       oprot.writeString(struct.tokenId);
     }
 
@@ -599,6 +698,8 @@ public class ProcessSubmitEvent implements org.apache.thrift.TBase<ProcessSubmit
       struct.setProcessIdIsSet(true);
       struct.gatewayId = iprot.readString();
       struct.setGatewayIdIsSet(true);
+      struct.experimentId = iprot.readString();
+      struct.setExperimentIdIsSet(true);
       struct.tokenId = iprot.readString();
       struct.setTokenIdIsSet(true);
     }

http://git-wip-us.apache.org/repos/asf/airavata/blob/f903d601/modules/gfac/gfac-service/src/main/java/org/apache/airavata/gfac/server/GfacServerHandler.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-service/src/main/java/org/apache/airavata/gfac/server/GfacServerHandler.java b/modules/gfac/gfac-service/src/main/java/org/apache/airavata/gfac/server/GfacServerHandler.java
index 56d9d9c..3fbe245 100644
--- a/modules/gfac/gfac-service/src/main/java/org/apache/airavata/gfac/server/GfacServerHandler.java
+++ b/modules/gfac/gfac-service/src/main/java/org/apache/airavata/gfac/server/GfacServerHandler.java
@@ -23,6 +23,7 @@ package org.apache.airavata.gfac.server;
 import org.apache.airavata.common.exception.AiravataException;
 import org.apache.airavata.common.exception.AiravataStartupException;
 import org.apache.airavata.common.exception.ApplicationSettingsException;
+import org.apache.airavata.common.utils.AiravataUtils;
 import org.apache.airavata.common.utils.ServerSettings;
 import org.apache.airavata.common.utils.ThriftUtils;
 import org.apache.airavata.common.utils.listener.AbstractActivityListener;
@@ -38,6 +39,7 @@ import org.apache.airavata.messaging.core.MessageHandler;
 import org.apache.airavata.messaging.core.MessagingConstants;
 import org.apache.airavata.messaging.core.Publisher;
 import org.apache.airavata.messaging.core.impl.RabbitMQProcessLaunchConsumer;
+import org.apache.airavata.messaging.core.impl.RabbitMQStatusPublisher;
 import org.apache.airavata.model.messaging.event.*;
 import org.apache.airavata.model.status.ProcessState;
 import org.apache.airavata.model.status.ProcessStatus;
@@ -91,8 +93,11 @@ public class GfacServerHandler implements GfacService.Iface {
     }
 
     private void initAMQPClient() throws AiravataException {
+	    // init process consumer
         rabbitMQProcessLaunchConsumer = Factory.getProcessLaunchConsumer();
         rabbitMQProcessLaunchConsumer.listen(new ProcessLaunchMessageHandler());
+	    // init status publisher
+	    statusPublisher = new RabbitMQStatusPublisher();
     }
 
     private void startCuratorClient() throws ApplicationSettingsException {
@@ -217,7 +222,9 @@ public class GfacServerHandler implements GfacService.Iface {
                     ProcessStatus status = new ProcessStatus();
                     status.setState(ProcessState.EXECUTING);
                     status.setTimeOfStateChange(Calendar.getInstance().getTimeInMillis());
-                    Factory.getDefaultExpCatalog().update(ExperimentCatalogModelType.PROCESS_STATUS, status, event.getProcessId());
+                    Factory.getDefaultExpCatalog().update(ExperimentCatalogModelType.PROCESS_STATUS, status, event
+		                    .getProcessId());
+	                publishProcessStatus(event, status);
                     try {
 	                    GFacUtils.createProcessZKNode(curatorClient, gfacServerName, event.getProcessId(), message
 					                    .getDeliveryTag(),
@@ -231,6 +238,8 @@ public class GfacServerHandler implements GfacService.Iface {
                     log.error(e.getMessage(), e); //nobody is listening so nothing to throw
                 } catch (RegistryException e) {
                     log.error("Error while updating experiment status", e);
+                } catch (AiravataException e) {
+	                log.error("Error while publishing process status", e);
                 }
             } else if (message.getType().equals(MessageType.TERMINATEPROCESS)) {
                 ProcessTerminateEvent event = new ProcessTerminateEvent();
@@ -258,4 +267,15 @@ public class GfacServerHandler implements GfacService.Iface {
             }
         }
     }
+
+	private void publishProcessStatus(ProcessSubmitEvent event, ProcessStatus status) throws AiravataException {
+		ProcessIdentifier identifier = new ProcessIdentifier(event.getProcessId(),
+				event.getExperimentId(),
+				event.getGatewayId());
+		ProcessStatusChangeEvent processStatusChangeEvent = new ProcessStatusChangeEvent(status.getState(), identifier);
+		MessageContext msgCtx = new MessageContext(processStatusChangeEvent, MessageType.PROCESS,
+				AiravataUtils.getId(MessageType.PROCESS.name()), event.getGatewayId());
+		msgCtx.setUpdatedTime(AiravataUtils.getCurrentTimestamp());
+		statusPublisher.publish(msgCtx);
+	}
 }

http://git-wip-us.apache.org/repos/asf/airavata/blob/f903d601/modules/messaging/core/src/main/java/org/apache/airavata/messaging/core/impl/RabbitMQStatusConsumer.java
----------------------------------------------------------------------
diff --git a/modules/messaging/core/src/main/java/org/apache/airavata/messaging/core/impl/RabbitMQStatusConsumer.java b/modules/messaging/core/src/main/java/org/apache/airavata/messaging/core/impl/RabbitMQStatusConsumer.java
index 83725e2..46784bf 100644
--- a/modules/messaging/core/src/main/java/org/apache/airavata/messaging/core/impl/RabbitMQStatusConsumer.java
+++ b/modules/messaging/core/src/main/java/org/apache/airavata/messaging/core/impl/RabbitMQStatusConsumer.java
@@ -45,7 +45,8 @@ import java.util.List;
 import java.util.Map;
 
 public class RabbitMQStatusConsumer implements Consumer {
-    private static Logger log = LoggerFactory.getLogger(RabbitMQStatusConsumer.class);
+	public static final String EXCHANGE_TYPE = "topic";
+	private static Logger log = LoggerFactory.getLogger(RabbitMQStatusConsumer.class);
 
     private String exchangeName;
     private String url;
@@ -88,7 +89,7 @@ public class RabbitMQStatusConsumer implements Consumer {
 
             channel = connection.createChannel();
             channel.basicQos(prefetchCount);
-            channel.exchangeDeclare(exchangeName, "topic", false);
+            channel.exchangeDeclare(exchangeName, EXCHANGE_TYPE, false);
 
         } catch (Exception e) {
             String msg = "could not open channel for exchange " + exchangeName;
@@ -162,13 +163,13 @@ public class RabbitMQStatusConsumer implements Consumer {
                             event = experimentStatusChangeEvent;
                             gatewayId = experimentStatusChangeEvent.getGatewayId();
                         } else if (message.getMessageType().equals(MessageType.PROCESS)) {
-                           /* WorkflowNodeStatusChangeEvent wfnStatusChangeEvent = new WorkflowNodeStatusChangeEvent();
-                            ThriftUtils.createThriftFromBytes(message.getEvent(), wfnStatusChangeEvent);
-                            log.debug(" Message Received with message id '" + message.getMessageId()
-                                    + "' and with message type '" + message.getMessageType() + "'  with status " +
-                                    wfnStatusChangeEvent.getState());
-                            event = wfnStatusChangeEvent;
-                            gatewayId = wfnStatusChangeEvent.getWorkflowNodeIdentity().getGatewayId();*/
+	                        ProcessStatusChangeEvent processStatusChangeEvent = new ProcessStatusChangeEvent();
+	                        ThriftUtils.createThriftFromBytes(message.getEvent(), processStatusChangeEvent);
+	                        log.debug("Message Recieved with message id :" + message.getMessageId() + " and with " +
+			                        "message type " + message.getMessageType() + " with status " +
+			                        processStatusChangeEvent.getState());
+	                        event = processStatusChangeEvent;
+	                        gatewayId = processStatusChangeEvent.getProcessIdentity().getGatewayId();
                         } else if (message.getMessageType().equals(MessageType.TASK)) {
                             TaskStatusChangeEvent taskStatusChangeEvent = new TaskStatusChangeEvent();
                             ThriftUtils.createThriftFromBytes(message.getEvent(), taskStatusChangeEvent);

http://git-wip-us.apache.org/repos/asf/airavata/blob/f903d601/modules/orchestrator/orchestrator-core/src/main/java/org/apache/airavata/orchestrator/core/impl/GFACPassiveJobSubmitter.java
----------------------------------------------------------------------
diff --git a/modules/orchestrator/orchestrator-core/src/main/java/org/apache/airavata/orchestrator/core/impl/GFACPassiveJobSubmitter.java b/modules/orchestrator/orchestrator-core/src/main/java/org/apache/airavata/orchestrator/core/impl/GFACPassiveJobSubmitter.java
index f600b72..02ecfe1 100644
--- a/modules/orchestrator/orchestrator-core/src/main/java/org/apache/airavata/orchestrator/core/impl/GFACPassiveJobSubmitter.java
+++ b/modules/orchestrator/orchestrator-core/src/main/java/org/apache/airavata/orchestrator/core/impl/GFACPassiveJobSubmitter.java
@@ -90,9 +90,11 @@ public class GFACPassiveJobSubmitter implements JobSubmitter,Watcher {
             if (gatewayId == null || gatewayId.isEmpty()) {
                 gatewayId = ServerSettings.getDefaultUserGateway();
             }
-            ProcessSubmitEvent processSubmitEvent = new ProcessSubmitEvent(processId, gatewayId, tokenId);
-            MessageContext messageContext = new MessageContext(processSubmitEvent, MessageType.LAUNCHPROCESS, "LAUNCH.TASK-" + UUID.randomUUID().toString(), gatewayId);
-            messageContext.setUpdatedTime(AiravataUtils.getCurrentTimestamp());
+	        ProcessSubmitEvent processSubmitEvent = new ProcessSubmitEvent(processId, gatewayId, experimentId,
+			        tokenId);
+	        MessageContext messageContext = new MessageContext(processSubmitEvent, MessageType.LAUNCHPROCESS, "LAUNCH" +
+			        ".TASK-" + UUID.randomUUID().toString(), gatewayId);
+	        messageContext.setUpdatedTime(AiravataUtils.getCurrentTimestamp());
             publisher.publish(messageContext);
         } catch (Exception e) {
             logger.error(e.getMessage(), e);

http://git-wip-us.apache.org/repos/asf/airavata/blob/f903d601/modules/orchestrator/orchestrator-service/src/main/java/org/apache/airavata/orchestrator/server/OrchestratorServerHandler.java
----------------------------------------------------------------------
diff --git a/modules/orchestrator/orchestrator-service/src/main/java/org/apache/airavata/orchestrator/server/OrchestratorServerHandler.java b/modules/orchestrator/orchestrator-service/src/main/java/org/apache/airavata/orchestrator/server/OrchestratorServerHandler.java
index 404e0c2..15f7133 100644
--- a/modules/orchestrator/orchestrator-service/src/main/java/org/apache/airavata/orchestrator/server/OrchestratorServerHandler.java
+++ b/modules/orchestrator/orchestrator-service/src/main/java/org/apache/airavata/orchestrator/server/OrchestratorServerHandler.java
@@ -25,12 +25,16 @@ import org.apache.airavata.common.exception.AiravataException;
 import org.apache.airavata.common.exception.ApplicationSettingsException;
 import org.apache.airavata.common.utils.AiravataUtils;
 import org.apache.airavata.common.utils.ServerSettings;
+import org.apache.airavata.common.utils.ThriftUtils;
 import org.apache.airavata.credential.store.store.CredentialReader;
 import org.apache.airavata.gfac.core.GFacUtils;
 import org.apache.airavata.gfac.core.scheduler.HostScheduler;
 import org.apache.airavata.messaging.core.MessageContext;
+import org.apache.airavata.messaging.core.MessageHandler;
+import org.apache.airavata.messaging.core.MessagingConstants;
 import org.apache.airavata.messaging.core.Publisher;
 import org.apache.airavata.messaging.core.PublisherFactory;
+import org.apache.airavata.messaging.core.impl.RabbitMQStatusConsumer;
 import org.apache.airavata.model.appcatalog.appdeployment.ApplicationDeploymentDescription;
 import org.apache.airavata.model.appcatalog.appinterface.ApplicationInterfaceDescription;
 import org.apache.airavata.model.appcatalog.computeresource.ComputeResourceDescription;
@@ -40,6 +44,8 @@ import org.apache.airavata.model.experiment.ExperimentType;
 import org.apache.airavata.model.experiment.UserConfigurationDataModel;
 import org.apache.airavata.model.messaging.event.ExperimentStatusChangeEvent;
 import org.apache.airavata.model.messaging.event.MessageType;
+import org.apache.airavata.model.messaging.event.ProcessIdentifier;
+import org.apache.airavata.model.messaging.event.ProcessStatusChangeEvent;
 import org.apache.airavata.model.process.ProcessModel;
 import org.apache.airavata.model.status.ExperimentState;
 import org.apache.airavata.model.status.ExperimentStatus;
@@ -48,14 +54,17 @@ import org.apache.airavata.orchestrator.cpi.OrchestratorService;
 import org.apache.airavata.orchestrator.cpi.impl.SimpleOrchestratorImpl;
 import org.apache.airavata.orchestrator.cpi.orchestrator_cpi_serviceConstants;
 import org.apache.airavata.orchestrator.util.OrchestratorServerThreadPoolExecutor;
+import org.apache.airavata.orchestrator.util.OrchestratorUtils;
 import org.apache.airavata.registry.core.app.catalog.resources.AppCatAbstractResource;
 import org.apache.airavata.registry.core.experiment.catalog.impl.RegistryFactory;
 import org.apache.airavata.registry.core.experiment.catalog.resources.AbstractExpCatResource;
 import org.apache.airavata.registry.cpi.*;
+import org.apache.thrift.TBase;
 import org.apache.thrift.TException;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.HashMap;
 import java.util.List;
@@ -70,6 +79,7 @@ public class OrchestratorServerHandler implements OrchestratorService.Iface {
 	private String airavataUserName;
 	private String gatewayName;
 	private Publisher publisher;
+	private RabbitMQStatusConsumer statusConsumer;
 
     /**
 	 * Query orchestrator server to fetch the CPI version
@@ -92,20 +102,18 @@ public class OrchestratorServerHandler implements OrchestratorService.Iface {
 			// the required properties
 			orchestrator = new SimpleOrchestratorImpl();
 			experimentCatalog = RegistryFactory.getDefaultExpCatalog();
-            appCatalog = RegistryFactory.getAppCatalog();
+			appCatalog = RegistryFactory.getAppCatalog();
 			orchestrator.initialize();
 			orchestrator.getOrchestratorContext().setPublisher(this.publisher);
-        } catch (OrchestratorException e) {
-            log.error(e.getMessage(), e);
-            throw new OrchestratorException("Error while initializing orchestrator service", e);
-		} catch (RegistryException e) {
-            log.error(e.getMessage(), e);
-            throw new OrchestratorException("Error while initializing orchestrator service", e);
-		} catch (AppCatalogException e) {
-            log.error(e.getMessage(), e);
-            throw new OrchestratorException("Error while initializing orchestrator service", e);
-        }
-    }
+			String brokerUrl = ServerSettings.getSetting(MessagingConstants.RABBITMQ_BROKER_URL);
+			String exchangeName = ServerSettings.getSetting(MessagingConstants.RABBITMQ_STATUS_EXCHANGE_NAME);
+			statusConsumer = new RabbitMQStatusConsumer(brokerUrl, exchangeName);
+			statusConsumer.listen(new ProcessStatusHandler());
+		} catch (OrchestratorException | RegistryException | AppCatalogException | AiravataException e) {
+			log.error(e.getMessage(), e);
+			throw new OrchestratorException("Error while initializing orchestrator service", e);
+		}
+	}
 
     /**
 	 * * After creating the experiment Data user have the * experimentID as the
@@ -457,19 +465,78 @@ public class OrchestratorServerHandler implements OrchestratorService.Iface {
                 }
 
             } catch (Exception e) {
-                ExperimentStatus status = new ExperimentStatus();
-                status.setState(ExperimentState.FAILED);
-                status.setTimeOfStateChange(AiravataUtils.getCurrentTimestamp().getTime());
-                try {
-                    experimentCatalog.update(ExperimentCatalogModelType.EXPERIMENT_STATUS, status, experimentId);
-                } catch (RegistryException e1) {
-                    log.error(experimentId, "Error while updating experiment status to " + status.toString(), e);
-                    throw new TException(e);
-                }
-                log.error(experimentId, "Error while updating task status, hence updated experiment status to " + status.toString(), e);
-                throw new TException(e);
+	            ExperimentStatus status = new ExperimentStatus(ExperimentState.FAILED);
+	            status.setReason("Error while updating task status");
+	            OrchestratorUtils.updageExperimentStatus(experimentId, status);
+	            log.error(experimentId, "Error while updating task status, hence updated experiment status to " +
+			            ExperimentState.FAILED, e);
+	            throw new TException(e);
             }
             return true;
         }
+
     }
+
+	private class ProcessStatusHandler implements MessageHandler {
+
+		@Override
+		public Map<String, Object> getProperties() {
+			Map<String, Object> props = new HashMap<>();
+			List<String> routingKeys = new ArrayList<>();
+//			routingKeys.add("*"); // listen for gateway level messages
+//			routingKeys.add("*.*"); // listen for gateway/experiment level messages
+			routingKeys.add("*.*.*"); // listern for gateway/experiment/process level messages
+			props.put(MessagingConstants.RABBIT_ROUTING_KEY, routingKeys);
+			return props;
+		}
+
+		/**
+		 * This method only handle MessageType.PROCESS type messages.
+		 * @param message
+		 */
+		@Override
+		public void onMessage(MessageContext message) {
+			if (message.getType().equals(MessageType.PROCESS)) {
+				try {
+					ProcessStatusChangeEvent processStatusChangeEvent = new ProcessStatusChangeEvent();
+					TBase event = message.getEvent();
+					byte[] bytes = ThriftUtils.serializeThriftObject(event);
+					ThriftUtils.createThriftFromBytes(bytes, processStatusChangeEvent);
+					ExperimentStatus status = new ExperimentStatus();
+					ProcessIdentifier processIdentity = processStatusChangeEvent.getProcessIdentity();
+					switch (processStatusChangeEvent.getState()) {
+						case PRE_PROCESSING:
+							status.setState(ExperimentState.EXECUTING);
+							status.setReason("process  started");
+							break;
+						case COMPLETED:
+							status.setState(ExperimentState.COMPLETED);
+							status.setReason("process  completed");
+							break;
+						case FAILED:
+							status.setState(ExperimentState.FAILED);
+							status.setReason("process  failed");
+							break;
+						case CANCELED:
+							status.setState(ExperimentState.CANCELED);
+							status.setReason("process  cancelled");
+							break;
+						default:
+							// ignore other status changes, thoes will not affect for experiment status changes
+							return;
+					}
+					if (status.getState() != null) {
+						OrchestratorUtils.updageExperimentStatus(processIdentity.getExperimentId(), status);
+						log.info("expId : " + processIdentity.getExperimentId() + " :- Experiment status updated to ", status.getState());
+					}
+				} catch (TException e) {
+					log.error("Message Id : " + message.getMessageId() + ", Message type : " + message.getType() +
+							"Error" + " while prcessing process status change event");
+				}
+			} else {
+				System.out.println("Message Recieved with message id " + message.getMessageId() + " and with message " +
+						"type " + message.getType().name());
+			}
+		}
+	}
 }

http://git-wip-us.apache.org/repos/asf/airavata/blob/f903d601/modules/orchestrator/orchestrator-service/src/main/java/org/apache/airavata/orchestrator/util/OrchestratorUtils.java
----------------------------------------------------------------------
diff --git a/modules/orchestrator/orchestrator-service/src/main/java/org/apache/airavata/orchestrator/util/OrchestratorUtils.java b/modules/orchestrator/orchestrator-service/src/main/java/org/apache/airavata/orchestrator/util/OrchestratorUtils.java
new file mode 100644
index 0000000..5b2cab9
--- /dev/null
+++ b/modules/orchestrator/orchestrator-service/src/main/java/org/apache/airavata/orchestrator/util/OrchestratorUtils.java
@@ -0,0 +1,45 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+package org.apache.airavata.orchestrator.util;
+
+import org.apache.airavata.common.utils.AiravataUtils;
+import org.apache.airavata.model.status.ExperimentState;
+import org.apache.airavata.model.status.ExperimentStatus;
+import org.apache.airavata.registry.core.experiment.catalog.impl.RegistryFactory;
+import org.apache.airavata.registry.cpi.ExperimentCatalogModelType;
+import org.apache.airavata.registry.cpi.RegistryException;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class OrchestratorUtils {
+	private static final Logger log = LoggerFactory.getLogger(OrchestratorUtils.class);
+
+	public static void updageExperimentStatus(String experimentId, ExperimentStatus status) {
+		status.setState(ExperimentState.FAILED);
+		status.setTimeOfStateChange(AiravataUtils.getCurrentTimestamp().getTime());
+		try {
+			RegistryFactory.getDefaultExpCatalog().update(ExperimentCatalogModelType.EXPERIMENT_STATUS, status,
+					experimentId);
+		} catch (RegistryException e) {
+			log.error("expId : " + experimentId + " Error while updating experiment status to " + status.toString(), e);
+		}
+	}
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/f903d601/thrift-interface-descriptions/airavata-api/messaging_events.thrift
----------------------------------------------------------------------
diff --git a/thrift-interface-descriptions/airavata-api/messaging_events.thrift b/thrift-interface-descriptions/airavata-api/messaging_events.thrift
index 599a2ee..eed07da 100644
--- a/thrift-interface-descriptions/airavata-api/messaging_events.thrift
+++ b/thrift-interface-descriptions/airavata-api/messaging_events.thrift
@@ -111,7 +111,8 @@ struct JobIdentifier {
 struct ProcessSubmitEvent{
     1: required string processId,
     2: required string gatewayId,
-    3: required string tokenId
+    3: required string experimentId,
+    4: required string tokenId
 }
 
 struct ProcessTerminateEvent{