Skip to content
This repository has been archived by the owner on Sep 8, 2022. It is now read-only.

Con 98 #32

Open
wants to merge 12 commits into
base: develop
Choose a base branch
from
Prev Previous commit
Next Next commit
-added PredicateSatisfaction handler
Ser0n-ath committed Aug 4, 2022
commit 90a4ac835ead46521fc4e117af7b1db3d9db71c0
12 changes: 10 additions & 2 deletions Orchestra/backend/eventsystem-service/src/index.js
Original file line number Diff line number Diff line change
@@ -277,9 +277,12 @@ app.post("/event/satisifypredicate", async (req,res) => {

let predicate_satisfied = false;

console.log(event_result);

if(event_result["TotalPredicateSatisfied"] + 1 == event_result["NumberOfPredicates"]){
predicate_satisfied = true;
handlePredicateSatisfaction(event_id, event_result); //async task for server.
//------------Execute Code----------// where predicate satisfied

}

if(!event_result["Terminated"] && event_result["TotalPredicateSatisfied"] < event_result["NumberOfPredicates"]){
@@ -306,7 +309,12 @@ app.post("/event/satisifypredicate", async (req,res) => {
return res.status(500).send({success: true, status: "success", result: event_result});
})


async function handlePredicateSatisfaction(event_id, event){
//handleEventExecution if (not terminated) and (TimeSatisfied) and (not DispatcherAcknowledged)
console.log("Inside Predicate Satisfied");
console.log("predicateSatisfiedHandler", event_id, event)
//handle
}

/*--------------------------------------- PREDICATE SIGNAL STATE REGION----------------------------------------/*