blob: ac21691655ca344e22007002b94a9423e542f73b [file] [log] [blame]
<?xml version="1.0"?>
<!--
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
-->
<!--
This document is an example of using history in parallel
-->
<scxml xmlns="http://www.w3.org/2005/07/scxml" version="1.0" datamodel="jexl"
initial="off_call">
<state id="off_call">
<transition event="dial" target="call_active"/>
</state>
<parallel id="call_active">
<state id="talk_status" initial="talking">
<state id="talking">
<transition event="hold" target="held" />
</state>
<state id="held">
<transition event="retrieve" target="talking" />
</state>
</state>
<state id="call_status" initial="on_call">
<state id="on_call">
<transition event="hangup" target="off_call"/>
<transition event="consult" target="consult_active"/>
</state>
<state id="on_call_consult">
<transition event="hangup" target="off_call"/>
<transition event="alternate" target="resume_consult"/>
</state>
</state>
<history id="resume_call" type="deep">
<transition target="talk_status call_status"/>
</history>
</parallel>
<parallel id="consult_active">
<state id="consult_talk_status" initial="consult_talking">
<state id="consult_talking">
<transition event="hold" target="consult_held" />
</state>
<state id="consult_held">
<transition event="retrieve" target="consult_talking" />
</state>
</state>
<state id="consult_status" initial="on_consult">
<state id="on_consult">
<transition event="hangup" target="resume_call"/>
<transition event="alternate" target="resume_call"/>
</state>
</state>
<history id="resume_consult" type="deep">
<transition target="consult_talk_status consult_status"/>
</history>
</parallel>
</scxml>