izzum\statemachine\loader\JSON::getJSONSchema PHP Method

getJSONSchema() public method

gets the json schema used for the datastructure of the statemachine definitions
public getJSONSchema ( ) : string
return string
    public function getJSONSchema()
    {
        $schema = '{"$schema":"http://json-schema.org/draft-04/schema#","type":"object","title":"izzum statemachines definitions schema","description":"This is a json-schema for the statemachines as defined by the php izzum library. see http://jsonschemalint.com/draft4/# to validate your json definitions","required":["machines"],"properties":{"comment":{"type":["string","null"],"description":"comments for the description of the file contents can be placed here."},"machines":{"minItems":1,"uniqueItems":true,"type":"array","description":"All machines are defined here","items":{"required":["name","description","states","transitions"],"type":"object","description":"A full machine definition","properties":{"name":{"type":"string","description":"the name of the machine","pattern":"^([a-z0-9])+((-)?([a-z0-9])+)*$"},"factory":{"type":["string","null"],"description":"\\fully\\qualified\\Factory class name"},"description":{"type":["string","null"],"description":"a description of the machine"},"states":{"type":"array","description":"All state definitions for a machine go in this array","minItems":2,"uniqueItems":true,"items":{"type":"object","description":"A state definition","required":["name","type"],"properties":{"name":{"type":"string","description":"the state name","pattern":"^([a-z0-9])+((-)?([a-z0-9])+)*$|^(not-)?regex:(.*)$"},"type":{"enum":["initial","normal","final","regex"],"description":"the type of state: initial (1), normal(0..n), final (1..n) or regex (0..n)"},"entry_command":{"type":["string","null"],"description":"\\fully\\qualified\\Command (multiple can be comma seperated) that will be executed on entry of the state"},"exit_command":{"type":["string","null"],"description":"\\fully\\qualified\\Command name (multiple can be comma seperated) that will be executed on exit of the state"},"entry_callable":{"type":["string","null"],"description":"A php callable for state entry. can only be in form of fully\\qualified\\Class::staticMethod"},"exit_callable":{"type":["string","null"],"description":"A php callable for state exit. can only be in form of fully\\qualified\\Class::staticMethod"},"description":{"type":["string","null"],"description":"A description of the state"}}}},"transitions":{"type":"array","description":"A list of transitions, referring to the states","minItems":1,"uniqueItems":true,"items":{"type":"object","description":"A transition definition","required":["state_from","state_to","event"],"properties":{"state_from":{"type":"string","description":"the state from which the transition is made. this can be a regex.","pattern":"^([a-z0-9])+((-)?([a-z0-9])+)*$|^(not-)?regex:(.*)$"},"state_to":{"type":"string","description":"the state to which the transition is made. this can be a regex.","pattern":"^([a-z0-9])+((-)?([a-z0-9])+)*$|^(not-)?regex:(.*)$"},"event":{"type":["string","null"],"description":"an event name by which you can call this transition","pattern":"^[a-zA-Z0-9]+$"},"rule":{"type":["string","null"],"description":"\\fully\\qualified\\Rule name (multiple can be comma seperated) that will be checked as boolean guard logic before the transition"},"command":{"type":["string","null"],"description":"\\fully\\qualified\\Command name (multiple can be comma seperated) that will be executed as the transition logic"},"guard_callable":{"type":["string","null"],"description":"A php callable for guard logic. can only be in form of fully\\qualified\\Class::staticMethod"},"transition_callable":{"type":["string","null"],"description":"A php callable for transition logic. can only be in form of fully\\qualified\\Class::staticMethod"},"description":{"type":["string","null"],"description":"The description of the transition"}}}}}}}}}';
        return $schema;
    }