2
votes

Is it possible to have a precondition action which specifies that an orchestration step should be performed rather than skipped?

Working with custom policies I have seen many cases where the precondition action specifies SkipThisOrchestrationStep

Instead of this:

        <Precondition Type="ClaimEquals" ExecuteActionsIf="true">
          <Value>extension_hasUpdatedPwd</Value>
          <Value>True</Value>
          <Action>SkipThisOrchestrationStep</Action>
        </Precondition>

I want to do something like this:

       <Precondition Type="ClaimEquals" ExecuteActionsIf="true">
          <Value>extension_isMigrated</Value>
          <Value>False</Value>
          <Action>ExecuteThisOrchestrationStep</Action>
        </Precondition>

My use case is that I have a custom attribute which specifies if a password has been reset. If a user has that attribute set to "false", then I want to perform the orchestration step. If a user has that attribute set to true or that attribute does not exist, then I want to skip that orchestration step.

1

1 Answers

2
votes

You need a list of preconditions such as this:

<Preconditions>
  <Precondition Type="ClaimsExist" ExecuteActionsIf="false">
    <Value>extension_isMigrated</Value>
    <Action>SkipThisOrchestrationStep</Action>
  </Precondition>
  <Precondition Type="ClaimEquals" ExecuteActionsIf="false">
    <Value>extension_isMigrated</Value>
    <Value>False</Value>
    <Action>SkipThisOrchestrationStep</Action>
  </Precondition>
</Preconditions>

Currently, Action can only be set to SkipThisOrchestrationStep. So if you don't want to skip the current step, then ExecuteActionsIf must be set to false.