wip cleaning and other stuff

This commit is contained in:
Benjamin Dalsass
2025-11-25 10:59:27 +01:00
parent 10ac497a18
commit 7a67267c7d
8 changed files with 61 additions and 40 deletions

View File

@@ -17,15 +17,15 @@ use Combodo\iTop\Forms\Register\IORegister;
class BooleanExpressionFormBlock extends AbstractExpressionFormBlock
{
// Outputs
public const OUTPUT_CONDITION_MET = "condition_met";
public const OUTPUT_CONDITION_UNMET = "condition_unmet";
public const OUTPUT_RESULT = "result";
public const OUTPUT_NOT_RESULT = "not_result";
/** @inheritdoc */
protected function RegisterIO(IORegister $oIORegister): void
{
parent::RegisterIO($oIORegister);
$oIORegister->AddOutput(self::OUTPUT_CONDITION_MET, BooleanIOFormat::class);
$oIORegister->AddOutput(self::OUTPUT_CONDITION_UNMET, BooleanIOFormat::class);
$oIORegister->AddOutput(self::OUTPUT_RESULT, BooleanIOFormat::class);
$oIORegister->AddOutput(self::OUTPUT_NOT_RESULT, BooleanIOFormat::class);
}
/**
@@ -42,8 +42,8 @@ class BooleanExpressionFormBlock extends AbstractExpressionFormBlock
// Update output
$bResult = boolval($oResult);
$this->GetOutput(self::OUTPUT_CONDITION_MET)->SetValue($sEventType, new BooleanIOFormat($bResult));
$this->GetOutput(self::OUTPUT_CONDITION_UNMET)->SetValue($sEventType, new BooleanIOFormat(!$bResult));
$this->GetOutput(self::OUTPUT_RESULT)->SetValue($sEventType, new BooleanIOFormat($bResult));
$this->GetOutput(self::OUTPUT_NOT_RESULT)->SetValue($sEventType, new BooleanIOFormat(!$bResult));
return $oResult;
}