Please disable Adblockers and enable JavaScript for domain CEWebS.cs.univie.ac.at! We have NO ADS, but they may interfere with some of our course material.

Assignment 6 (up)

 
Write for a correlator for a predefined process. Hints: 
 

Assignment 6a - Preparation (2 points) (up)

You manage an inventory (for your topic). Answer the following questions: 
 
Additionally: write three REST services, das describe above. 

Submission (up)

MANDATORY AND VERY IMPORTANT: Register the rest services via «http://donatello.cs.univie.ac.at/tools_lehre/interop/2020/correlation_phase1/index.php». 

Hints (up)

Assignment 6b - Correlation (10 points) (up)

Write and register a correlation service via «http://donatello.cs.univie.ac.at/tools_lehre/interop/2020/correlation_phase2/index.php». 
 
Implement the correlator logic: To create a process instance, change the process template, and instantiate (from file) it through «http://cpee.org/~demo/cpee-cockpit/». 
How to change the process template: 
When the correlator is called from the engine it should answer, that it wants to call back later. 
<call id="a4" endpoint="correlation">
  <parameters>
    <label>"Warten auf Fortschritt"</label>
    <method>:post</method>
    <parameters>
      <pid>data.pid</pid>
    </parameters>
  </parameters>
  <finalize>data.progress = result["progress"]</finalize>
</call>
 
<finalize>data.progress = result["progress"]</finalize>
 
<?php
  include('rest_handle.php');
  $rest = handleREST($_SERVER,$_GET);
  //******* CPEE POST empfangen. CPEE kann auch GET PUT und DELETE Requests absetzen.
  if ($rest->method=="POST"){
    //******* Der Korrelator kann auch so loggen.
    $fh = fopen("log.log","a");
    //******* ALLE Header in ein File schreiben.
    fwrite($fh,print_r(getallheaders(),true));
    //******* Header damit die CPEE weiss, dass wir spaeter antworten.
    header('CPEE_CALLBACK: true');
  }
/*
  Die Header wuerden so z.B. aussehen.
  Sie brauchen [Cpee_callback]. Ein PUT Request auf diese Adresse laesst den Prozess weiterlaufen.
  (
    [Cpee_base] => http://cpee.org:9298
    [Cpee_instance] => http://cpee.org:9298/194
    [Cpee_callback] => http://cpee.org:9298/194/callbacks/22b728c475d6f70ec970ce0a130a22fa
    [Cpee_activity] => a1
    [Cpee_label] => Wir werden warten
    [Cpee_attr_info] => ss
    [Cpee_attr_modeltype] => CPEE
    [Accept-Encoding] => gzip;q=1.0,deflate;q=0.6,identity;q=0.3
    [Accept] => *//*
    [User-Agent] => Ruby
    [Content-Type] => text/plain
    [Content-Length] => 0
    [Host] => wwwlab.cs.univie.ac.at
  )
*/
?>
 
<?
  $opts = array('http' =>
    array(
      'method'  => 'PUT',
      'header'  => 'Content-type: application/json',
      'content' => JSON_DATA
    )
  );
  $context = stream_context_create($opts);
  $result = file_get_contents('http://...', false, $context);
  exit;
?>

Submission (up)

DONT FORGET: change /testset/attributes/info. 
 
MANDATORY AND VERY IMPORTANT: Register the rest services via «http://donatello.cs.univie.ac.at/tools_lehre/interop/2020/correlation_phase2/».  

Hints (up)

Letzte Änderung: 14.05.2020, 09:55 | 721 Worte