<commit_before><?php
include '../core/config.php';
include '../core/RESTCalls.php';

$reset = $_GET['reset'];

if(!isset($_COOKIE['JEngine_ScenarioID']) || ($reset == "scenarioID")) {
	$scenarios = ShowScenarios();
	$ScenarioIDs = $scenarios["ids"];
	?>
		<h4> Please select your Scenario</h4>
		<form action='update_jcore_controller.php' method='post'>
		<select name="pcm_scenarioID">
		<option value=""></option>
		<?php 
		    foreach($ScenarioIDs as $key => $value) {
		       $value = htmlspecialchars($value); 
		       echo '<option value="'. $value .'">'. $value .'</option>';
		    }
		?>
		</select>
		<input type='submit' value='Submit'>
		</form>

<?php } elseif(!isset($_COOKIE['JEngine_ScenarioInstanceID']) || ($reset == "scenarioinstanceID")) {
	$scenarioinstances = ShowScenarioInstances($_COOKIE['JEngine_ScenarioID']);
	$scenarioinstanceIds = $scenarioinstances["ids"];
	?>
		<h4> Please select your ScenarioInstance</h4>
		<form action='update_jcore_controller.php' method='post'>
		<select name="pcm_scenarioinstances">
		<option value=""></option>
		<?php 
		    foreach($scenarioinstanceIds as $key => $value) {
		       $category = htmlspecialchars($category); 
		       echo '<option value="'. $value .'">'. $value .'</option>';
		    }
		?>
		</select>
		<input type='submit' value='Submit'>
		</form><br>
		<?php
        echo "<form action='update_jcore_controller.php' method='post'>
		            <input type='hidden' name='pcm_scenarioID_new_Instance' value='".$_COOKIE['JEngine_ScenarioID']."'><br>
		            <input type='submit' value='create new Instance'>
		        </form><br>";

} 

if((isset($_COOKIE['JEngine_ScenarioInstanceID'])) && (isset($_COOKIE['JEngine_ScenarioID']))) { ?>

    <div class="alert alert-info">
        <a href="#" class="close" data-dismiss="alert">&times;</a>
        <strong>Current Working Set</strong> Scenario ID: <?php echo $_COOKIE['JEngine_ScenarioID']; ?> | Instance ID: <?php echo $_COOKIE['JEngine_ScenarioInstanceID']; ?> |     
        <form action='update_jcore_controller.php' method='post'>
	            <input type='hidden' name='reset_scenarioID' value='true'>
	            <input type='submit' class="btn btn-link" value='change scenarioID'>
		</form> 
		| <form action='update_jcore_controller.php' method='post'>
	            <input type='hidden' name='reset_scenarioinstanceID' value='true'>
	            <input type='submit' class="btn btn-link" value='change scenarioinstanceID'>
		</form> 
    </div>
<?php 

	$enabled_activities = GetActivities($_COOKIE['JEngine_ScenarioID'], $_COOKIE['JEngine_ScenarioInstanceID'], "enabled");
    
    echo "<h4>enabled Activities</h4>
    		<table>
    			<tr>
    				<th> ID</th>
    				<th> Label</th>
    				<th>Action</th>
    			</tr>";

    $amount_of_enabled_activities = count($enabled_activities["ids"]);
    for ($i = 0; $i < $amount_of_enabled_activities; $i++) {
    	 $key = $enabled_activities["ids"][$i];
    	 $value = $enabled_activities["label"][$key];
    	 if($key == "{" || $value == "{") {
    	 	continue;
    	 }
    //foreach($enabled_activities["label"] as $key => $value) {
			  echo "<tr>";
			  echo "<th>".$key."</th>";
			  echo "<th>".$value."</th>";
			  echo "<th><form action='update_jcore_controller.php' method='post'>
	            			<input type='hidden' name='update_activity_status_begin' value='true'>
	            			<input type='hidden' name='pcm_scenarioID' value='".$_COOKIE['JEngine_ScenarioID']."'>
	            			<input type='hidden' name='pcm_scenarioinstances' value='".$_COOKIE['JEngine_ScenarioInstanceID']."'>
	            			<input type='hidden' name='pcm_activity' value='".$key."'>
	          				<input type='submit' class='btn btn-link' value='begin'>
						</form> </th>";
			  echo "</tr>";
	}
	echo "</table>
		  <br><hr>";
	$running_activities = GetActivities($_COOKIE['JEngine_ScenarioID'], $_COOKIE['JEngine_ScenarioInstanceID'], "running");
    			
    echo "<h4>running Activities</h4>
    		<table>
    			<tr>
    				<th> ID</th>
    				<th> Label</th>
    			</tr>
    			<tr>";

    $amount_of_running_activities = count($running_activities["ids"]);
    for ($i = 0; $i < $amount_of_running_activities; $i++) {
    	 $key = $running_activities["ids"][$i];
    	 $value = $running_activities["label"][$key];
    	 if($key == "{" || $value == "{") {
    	 	continue;
    	 }
	//}
    //foreach($running_activities["label"] as $key => $value) {
    	      echo "<tr>";
			  echo "<th>".$key."</th>";
			  echo "<th>".$value."</th>";
			  echo "<th><form action='update_jcore_controller.php' method='post'>
	            			<input type='hidden' name='update_activity_status_terminate' value='true'>
	            			<input type='hidden' name='pcm_scenarioID' value='".$_COOKIE['JEngine_ScenarioID']."'>
	            			<input type='hidden' name='pcm_scenarioinstances' value='".$_COOKIE['JEngine_ScenarioInstanceID']."'>
	            			<input type='hidden' name='pcm_activity' value='".$key."'>
	          				<input type='submit' class='btn btn-link' value='terminate'>
						</form></th>";
		      echo "</tr>";
	}
	echo "</table>
		  <br><hr>";

    $terminated_activities = GetActivities($_COOKIE['JEngine_ScenarioID'], $_COOKIE['JEngine_ScenarioInstanceID'], "terminated");
    
    echo "<h4>terminated Activities</h4>
    		<table>
    			<tr>
    				<th> ID</th>
    				<th> Label</th>
    			</tr>
    			<tr>";

    $amount_of_terminated_activities = count($terminated_activities["ids"]);
    for ($i = 0; $i < $amount_of_terminated_activities; $i++) {
    	 $key = $terminated_activities["ids"][$i];
    	 $value = $terminated_activities["label"][$key];
    	 if($key == "{" || $value == "{") {
    	 	continue;
    	 }
    //foreach($terminated_activities["label"] as $key => $value) {
    	      echo "<tr>";
			  echo "<th>".$key."</th>";
			  echo "<th>".$value."</th>";
		      echo "</tr>";
	}
	echo "</table>";

	$dataobjects = GetAllDataobject($_COOKIE['JEngine_ScenarioID'], $_COOKIE['JEngine_ScenarioInstanceID']);
	var_dump($dataobjects);

    echo "<h4>Dataobject</h4>
    		<table>
    			<tr>
    				<th> ID</th>
    				<th> Status</th>
    			</tr>
    			<tr>";

    $amount_of_dataobjects = count($dataobjects["ids"]);
    for ($i = 0; $i < $amount_of_dataobjects; $i++) {
    	 $key = $dataobjects["ids"][$i];
    	 $value = $dataobjects["label"][$key];
    	 if($key == "{" || $value == "{") {
    	 	continue;
    	 }
    //foreach($terminated_activities["label"] as $key => $value) {
    	      echo "<tr>";
			  echo "<th>".$key."</th>";
			  echo "<th>".$value."</th>";
		      echo "</tr>";
	}
	echo "</table>";
} ?><commit_msg>cleaning up visualisation for dataobjects<commit_after><?php
include '../core/config.php';
include '../core/RESTCalls.php';

$reset = $_GET['reset'];

if(!isset($_COOKIE['JEngine_ScenarioID']) || ($reset == "scenarioID")) {
	$scenarios = ShowScenarios();
	$ScenarioIDs = $scenarios["ids"];
	?>
		<h4> Please select your Scenario</h4>
		<form action='update_jcore_controller.php' method='post'>
		<select name="pcm_scenarioID">
		<option value=""></option>
		<?php 
		    foreach($ScenarioIDs as $key => $value) {
		       $value = htmlspecialchars($value); 
		       echo '<option value="'. $value .'">'. $value .'</option>';
		    }
		?>
		</select>
		<input type='submit' value='Submit'>
		</form>

<?php } elseif(!isset($_COOKIE['JEngine_ScenarioInstanceID']) || ($reset == "scenarioinstanceID")) {
	$scenarioinstances = ShowScenarioInstances($_COOKIE['JEngine_ScenarioID']);
	$scenarioinstanceIds = $scenarioinstances["ids"];
	?>
		<h4> Please select your ScenarioInstance</h4>
		<form action='update_jcore_controller.php' method='post'>
		<select name="pcm_scenarioinstances">
		<option value=""></option>
		<?php 
		    foreach($scenarioinstanceIds as $key => $value) {
		       $category = htmlspecialchars($category); 
		       echo '<option value="'. $value .'">'. $value .'</option>';
		    }
		?>
		</select>
		<input type='submit' value='Submit'>
		</form><br>
		<?php
        echo "<form action='update_jcore_controller.php' method='post'>
		            <input type='hidden' name='pcm_scenarioID_new_Instance' value='".$_COOKIE['JEngine_ScenarioID']."'><br>
		            <input type='submit' value='create new Instance'>
		        </form><br>";

} 

if((isset($_COOKIE['JEngine_ScenarioInstanceID'])) && (isset($_COOKIE['JEngine_ScenarioID']))) { ?>

    <div class="alert alert-info">
        <a href="#" class="close" data-dismiss="alert">&times;</a>
        <strong>Current Working Set</strong> Scenario ID: <?php echo $_COOKIE['JEngine_ScenarioID']; ?> | Instance ID: <?php echo $_COOKIE['JEngine_ScenarioInstanceID']; ?> |     
        <form action='update_jcore_controller.php' method='post'>
	            <input type='hidden' name='reset_scenarioID' value='true'>
	            <input type='submit' class="btn btn-link" value='change scenarioID'>
		</form> 
		| <form action='update_jcore_controller.php' method='post'>
	            <input type='hidden' name='reset_scenarioinstanceID' value='true'>
	            <input type='submit' class="btn btn-link" value='change scenarioinstanceID'>
		</form> 
    </div>
<?php 

	$enabled_activities = GetActivities($_COOKIE['JEngine_ScenarioID'], $_COOKIE['JEngine_ScenarioInstanceID'], "enabled");
    
    echo "<h4>enabled Activities</h4>
    		<table>
    			<tr>
    				<th> ID</th>
    				<th> Label</th>
    				<th>Action</th>
    			</tr>";

    $amount_of_enabled_activities = count($enabled_activities["ids"]);
    for ($i = 0; $i < $amount_of_enabled_activities; $i++) {
    	 $key = $enabled_activities["ids"][$i];
    	 $value = $enabled_activities["label"][$key];
    	 if($key == "{" || $value == "{") {
    	 	continue;
    	 }
    //foreach($enabled_activities["label"] as $key => $value) {
			  echo "<tr>";
			  echo "<th>".$key."</th>";
			  echo "<th>".$value."</th>";
			  echo "<th><form action='update_jcore_controller.php' method='post'>
	            			<input type='hidden' name='update_activity_status_begin' value='true'>
	            			<input type='hidden' name='pcm_scenarioID' value='".$_COOKIE['JEngine_ScenarioID']."'>
	            			<input type='hidden' name='pcm_scenarioinstances' value='".$_COOKIE['JEngine_ScenarioInstanceID']."'>
	            			<input type='hidden' name='pcm_activity' value='".$key."'>
	          				<input type='submit' class='btn btn-link' value='begin'>
						</form> </th>";
			  echo "</tr>";
	}
	echo "</table>
		  <br><hr>";
	$running_activities = GetActivities($_COOKIE['JEngine_ScenarioID'], $_COOKIE['JEngine_ScenarioInstanceID'], "running");
    			
    echo "<h4>running Activities</h4>
    		<table>
    			<tr>
    				<th> ID</th>
    				<th> Label</th>
    			</tr>
    			<tr>";

    $amount_of_running_activities = count($running_activities["ids"]);
    for ($i = 0; $i < $amount_of_running_activities; $i++) {
    	 $key = $running_activities["ids"][$i];
    	 $value = $running_activities["label"][$key];
    	 if($key == "{" || $value == "{") {
    	 	continue;
    	 }
	//}
    //foreach($running_activities["label"] as $key => $value) {
    	      echo "<tr>";
			  echo "<th>".$key."</th>";
			  echo "<th>".$value."</th>";
			  echo "<th><form action='update_jcore_controller.php' method='post'>
	            			<input type='hidden' name='update_activity_status_terminate' value='true'>
	            			<input type='hidden' name='pcm_scenarioID' value='".$_COOKIE['JEngine_ScenarioID']."'>
	            			<input type='hidden' name='pcm_scenarioinstances' value='".$_COOKIE['JEngine_ScenarioInstanceID']."'>
	            			<input type='hidden' name='pcm_activity' value='".$key."'>
	          				<input type='submit' class='btn btn-link' value='terminate'>
						</form></th>";
		      echo "</tr>";
	}
	echo "</table>
		  <br><hr>";

    $terminated_activities = GetActivities($_COOKIE['JEngine_ScenarioID'], $_COOKIE['JEngine_ScenarioInstanceID'], "terminated");
    
    echo "<h4>terminated Activities</h4>
    		<table>
    			<tr>
    				<th> ID</th>
    				<th> Label</th>
    			</tr>
    			<tr>";

    $amount_of_terminated_activities = count($terminated_activities["ids"]);
    for ($i = 0; $i < $amount_of_terminated_activities; $i++) {
    	 $key = $terminated_activities["ids"][$i];
    	 $value = $terminated_activities["label"][$key];
    	 if($key == "{" || $value == "{") {
    	 	continue;
    	 }
    //foreach($terminated_activities["label"] as $key => $value) {
    	      echo "<tr>";
			  echo "<th>".$key."</th>";
			  echo "<th>".$value."</th>";
		      echo "</tr>";
	}
	echo "</table><br><br>";

	$dataobjects = GetAllDataobject($_COOKIE['JEngine_ScenarioID'], $_COOKIE['JEngine_ScenarioInstanceID']);

    echo "<h4>Dataobject</h4>
    		<table>
    			<tr>
    				<th> ID</th>
    				<th> Status</th>
    			</tr>
    			<tr>";

    $amount_of_dataobjects = count($dataobjects["ids"]);
    for ($i = 0; $i < $amount_of_dataobjects; $i++) {
    	 $key = $dataobjects["ids"][$i];
    	 $value = $dataobjects["label"][$key];
    	 if($key == "{" || $value == "{") {
    	 	continue;
    	 }
    //foreach($terminated_activities["label"] as $key => $value) {
    	      echo "<tr>";
			  echo "<th>".$key."</th>";
			  echo "<th>".$value."</th>";
		      echo "</tr>";
	}
	echo "</table>";
} ?>
{'fraction_non_alphanumeric': 0.20427126264518547, 'fraction_numerical': 0.002397901835893593, 'mean_word_length': 3.257097288676236, 'pattern_counts': {'":': 0, '<': 297, '<?xml version=': 0, '>': 301, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6741164', 'n_tokens_mistral': 4927, 'n_tokens_neox': 4604, 'n_words': 761}