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

IRQ

acts.core.irq is an interrupt request activity that pauses workflow execution and waits for a client response.

steps:
    - id: step1
      uses: acts.core.irq
      params:
        key: act1

Parameters

ParameterDescription
keyActivity key identifier

Client Handling

On the client side, subscribe to req type messages, then complete the activity:

#![allow(unused)]
fn main() {
use acts::event::EventAction;

fn on_message(msg: &Message) {
    if msg.r#type == "req" && msg.key == "act1" {
        // Process the business logic
        let mut outputs = Vars::new();
        outputs.set("result", "processed");

        // Complete the activity
        rt.do_action2(&msg.pid, &msg.tid, EventAction::Next, outputs).unwrap();
    }
}
}

Other Actions

In addition to Next (complete), IRQ activities can also be handled with other actions:

ActionDescription
NextComplete the activity and pass output data
BackBack to a specified step
SkipSkip the activity
CancelCancel the activity
AbortAbort the activity
ErrorMark the activity as error
SubmitSubmit the activity
RemoveRemove the activity