jquery.flowchart icon indicating copy to clipboard operation
jquery.flowchart copied to clipboard

Add ability of multiple inputs or outputs to each operator.

Open kasra-ansari opened this issue 9 years ago • 2 comments

Now if user define multipleLinksOnOutput or multipleLinksOnInput on operator, the desired operator can have multiple output or input. For example, if we define multipleLinksOnOutput on Example 2 of http://sebastien.drouyer.com/jquery.flowchart-demo

operator1: {
    top: 20,
    left: 20,
    properties: {
        title: 'Operator 1',
        multipleLinksOnOutput: true, // Add ability of multiple output to this operator.
        inputs: {},
        outputs: {
            output_1: {
                label: 'Output 1',
            }
        }
    }
},

Operator 1 can have multiple outputs, but others are as usual.

kasra-ansari avatar May 15 '16 09:05 kasra-ansari

Hi,

Sorry for my late answer and thank you for your pull request. I think this is a good idea. There is one small problem though in you pull request, could you take a look at my notes?

Thanks,

sdrdis avatar May 24 '16 21:05 sdrdis

@kasra-ansari how can i implement this? Does the allow me to put more the one link to an input ? However this still deletes the previous link.

var data = {
        multipleLinksOnInput: true,
        multipleLinksOnOutput: true,
        operators: {
            operator1: {
                top: 20,
                left: 20,
                properties: {
                    title: 'Start',
                    inputs: {},
                    outputs: {
                        output_1: {
                            label: 'Output',
                        },
                        output_2: {
                            label: 'Output',
                        }
                    }
                }
            },
            operator2: {
                top: 80,
                left: 300,
                properties: {
                    title: 'Send Message',
                    inputs: {
                        input_1: {
                            label: 'Input',
                        },
                        input_2: {
                            label: 'Input',
                        }
                    },
                    outputs: {}
                }
            },
        },
        links: {
        link_1: {
            fromOperator: 'operator1',
            fromConnector: 'output_1',
            toOperator: 'operator2',
            toConnector: 'input_2',
        },
        link_2: {
            fromOperator: 'operator1',
            fromConnector: 'output_2',
            toOperator: 'operator2',
            toConnector: 'input_2',
        },
}
    };

bish25 avatar Jul 28 '17 08:07 bish25