if ($prefix === NULL) {
$prefix = sprintf('[%s] ', $this->getWorkflowName());
}
+ $this->assertEquals($refInstance->getWorkflowName(), $cmpInstance->getWorkflowName(), "{$prefix}Should have same workflow name)");
$this->assertEquals($refInstance->export('tplParams'), $cmpInstance->export('tplParams'), "{$prefix}Should have same export(tplParams)");
$this->assertEquals($refInstance->export('tokenContext'), $cmpInstance->export('tokenContext'), "{$prefix}should have same export(tokenContext)");
$this->assertEquals($refInstance->export('envelope'), $cmpInstance->export('envelope'), "{$prefix}Should have same export(envelope)");
*/
trait ReflectiveWorkflowTrait {
+ public function getWorkflowName(): ?string {
+ return $this->_extras['envelope']['workflow'] ?? \CRM_Utils_Constant::value(static::CLASS . '::WORKFLOW');
+ }
+
+ /**
+ * @return string|null
+ * @deprecated
+ * It is not recommended that new things depend on the group-name. However, the plumbing still
+ * passes-through the group-name.
+ */
+ public function getGroupName(): ?string {
+ return $this->_extras['envelope']['groupName'] ?? \CRM_Utils_Constant::value(static::CLASS . '::GROUP');
+ }
+
/**
* The extras are an open-ended list of fields that will be passed-through to
* tpl, tokenContext, etc. This is the storage of last-resort for imported
interface WorkflowMessageInterface {
+ /**
+ * @return string
+ */
+ public function getWorkflowName(): ?string;
+
/**
* @return \Civi\WorkflowMessage\FieldSpec[]
* A list of field-specs that are used in the given format, keyed by their name in that format.