A simple sample of code.

Workflow workflow = new Workflow();
workflow.condition<ConditionA, bool>()
    .on(true)
        .parallel()
            .sequence()
                .execute<ActionA>()
                    .with("speed", 1f)
                    .with("distance", 100)
                .end()
                .condition<ConditionB, bool>()
                    .on(true)
                        .execute<ActionA>()
                            .with("speed", 0.5f)
                            .with("distance", 50)
                        .end()
                        .emit<SignalA>()
                        .end()
                        .wait<SignalB>()
                        .end()
                    .end()
                    .on(false)
                        .execute<ActionA>()
                            .with("speed", 0.5f)
                            .with("distance", 30)
                        .end()
                    .end()
                .end()
            .end()
            .execute<ActionB>()
            .end()
        .end()
    .end()
.end();

WorkflowRuntime r = new WorkflowRuntime();
r.run(workflow);

Last edited Jul 19, 2008 at 3:59 PM by perciun_andrei, version 6

Comments

No comments yet.