Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Action

Use acts.core.action to execute engine commands, such as triggering errors, completing steps, etc.

steps:
    - id: step1
      uses: acts.core.irq
      params:
        key: act1
      timeouts:
        # Trigger error on timeout
        - uses: acts.core.action
          if: $cost_in('8s')
          params:
            action: error
            options:
              ecode: err_timeout

Supported Commands

CommandDescription
errorTrigger an error, can pass ecode to specify error code

Client Commands

The client can also use do_action2 to perform the following operations to affect activity state:

OperationEventActionDescription
CompleteNextComplete current activity, continue to next step
SubmitSubmitSubmit the current activity
BackBackBack to a specified step
CancelCancelCancel a specified activity
SkipSkipSkip current activity
AbortAbortAbort current activity
ErrorErrorMark activity as error
RemoveRemoveRemove activity
#![allow(unused)]
fn main() {
// Complete activity
rt.do_action2(&pid, &tid, EventAction::Next, Vars::new()).unwrap();

// Trigger error
let mut options = Vars::new();
options.set("ecode", "err1");
rt.do_action2(&pid, &tid, EventAction::Error, options).unwrap();

// Back to specified step
let mut options = Vars::new();
options.set("to", "step1");
rt.do_action2(&pid, &tid, EventAction::Back, options).unwrap();
}