VaKeR CYBER ARMY
Logo of a company Server : Apache/2.4.41 (Ubuntu)
System : Linux absol.cf 5.4.0-198-generic #218-Ubuntu SMP Fri Sep 27 20:18:53 UTC 2024 x86_64
User : www-data ( 33)
PHP Version : 7.4.33
Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Directory :  /var/www/html/libs/absol-form/demo/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /var/www/html/libs/absol-form/demo/processflowdiagrameditor.js
var ProcessFlowDiagramEditor = absol.form.ProcessFlowDiagramEditor;
var editor = new ProcessFlowDiagramEditor();
editor.getView().addTo(document.body);

var data = {
    blocks: [
        {
            tag: "Start",
            attributes: {
                id: "1",
                displayName: "Start",
                permission: {
                    delete: false
                },
                tasks: [],
                participants: [],
                next_nodes: [
                    {
                        condition: "atleast(a)",
                        next_id: 4,
                        tasks: []
                    }
                ]
            }
        },
        {
            tag: "Fail",
            attributes: {
                id: "2",
                displayName: "Fail",
                permission: {
                    delete: false
                },
                tasks: [],
                participants: [],
                next_nodes: [],
                vars: []
            }
        },
        {
            tag: "Success",
            attributes: {
                id: "3",
                displayName: "Success",
                permission: {
                    delete: false
                },
                tasks: [],
                participants: [],
                next_nodes: []
            }
        },
        {
            tag: "Common",
            attributes: {
                id: "4",
                displayName: "test1",
                permission: {},
                tasks: [],
                participants: [],
                next_nodes: [
                    {
                        condition: "atAll(b)",
                        next_id: 5,
                        tasks: []
                    },
                    {
                        condition: "1=2",
                        next_id: 2,
                        tasks: []
                    }
                ],
                vars: []
            }
        },
        {
            tag: "Common",
            attributes: {
                id: "5",
                displayName: "test2",
                permission: {},
                tasks: [],
                participants: [],
                next_nodes: [
                    {
                        condition: "ATleast(a)",
                        next_id: 3,
                        tasks: []
                    },
                    {
                        condition: "atall(b)",
                        next_id: 2,
                        tasks: []
                    }
                ]
            }
        }
    ],
    lines: [
        {
            u: "1",
            v: "4",
            id: "l_1_4_1"
        },
        {
            u: "4",
            v: "5",
            id: "l4_5_2"
        },
        {
            u: "4",
            v: "5",
            id: "l4_5_3"
        },
        {
            u: "4",
            v: "2"
        },
        {
            u: "5",
            v: "3"
        },
        {
            u: "5",
            v: "2"
        },
        {
            u: "2",
            v: "5"
        }
    ],
    diagram: {
        positions: {
            "1": {
                x: 145,
                y: 76
            },
           "2": {
                    x: -29,
               y: 172
           },
            "3": {
                x: 226,
                y: 493
            },
            "4": {
                x: 305,
                y: 171
            },
            "5": {
                x: 121,
                y: 253
            }
        },
        lineIntermediatePoints: {
            "l_1_4_1":[
                {x: 145, y: 171},
                {x: 145, y: 253},
                {x: 305, y: 253},
                {x: 305, y: 471}
            ],
            "l4_5_3": [
                {x: 505, y: 253},
                {x: 421, y: 253}
            ]
        }
    }
};

var savedData;
try {
    var json = localStorage.getItem('pfde_test_data') ||'null';
    savedData = JSON.parse(json) || data;
    console.log('saved data',savedData)

}
catch(err) {
    savedData = data;
}

editor.setData(savedData);

editor.cmdRunner.add('save', function(){
    console.log(this.getData());
    var data = this.getData();
    var json = JSON.stringify(data);
    console.log('save',data, json);

    localStorage.setItem('pfde_test_data', json);
});//vector-polyline-plus

VaKeR 2022