Event Handler Content must support at least one class.
这个问题出现在 oracle CPM 要绑定在自定义对象上的操作引起的
官方文档 :https://cx.rightnow.com/app/answers/detail/a_id/6971/kw/Event%20Handler%20Content%20must%20support%20at%20least%20one%20class.%20
/*
* CPMObjectEventHandler: demo
* Package: OracleServiceCloud
* Objects: Contact, CO\TestCustomObject PS:如果只是操作oracle 自身的 Contact直接写,但是操作定义的要加上 CO\
* Actions: Create, Update
* Version: 1.3
*/
- the header is required, even though it is commented
- it will be read and used by the runtime
- it contains information on the objects and actions supported by the script
- the CPMObjectEventHandler name must match the class name and the test harness class (see examples below)
2. The implementation
- contains the required custom business logic to manipulate objects that are passed in at runtime
- the apply() method does most of the work
- the API version must match the one specified in the header
- the class name must match the name specified in the header
- the apply() function has 4 parameters: $run_mode (indicates if the script is running in a test harness or in production), $action (the event that triggered the execution - create, update or destroy), $object - the object executed on (e.g. Incident), $n_cycles (the number of execution loops the script has entered)
- sample:
use \RightNow\Connect\v1_3 as RNCPHP;
use \RightNow\CPM\v1 as RNCPM;
class demo implements RNCPM\ObjectEventHandler {
public static function apply($run_mode, $action, $obj, $n_cycles){
switch($action) {
case RNCPM\ActionCreate:
$verb="created";
break;
case RNCPM\ActionUpdate:
$verb="updated";
break;
}
}
}