Problem in adding new stencil option in BPMN editor with Rappid JS

273 views
Skip to first unread message

Anshul

unread,
Aug 9, 2017, 2:54:24 AM8/9/17
to JointJS
I am using trial version of Rappid JS which has stencil with default options. I need to add new element in the list so that i could use it and append inspector form associated with it.
Please help me out in this, below is my code which i tried. This is required for POC to implement Rappid JS.

bpmn.js:

stencil.load([
    new joint.shapes.bpmn.Gateway,
    new joint.shapes.bpmn.Activity,
    .
    .
    new joint,shapes.bpmn.myStencil
]);

inpector.js

window.inputs = {
    'bpmn.Gateway': {
        .
        .
    },
     .
     .
    'bpmn.myStencil':{
    //same as in-built Gateway code
    }
};


Error Shown: joint.shapes.bpmn.myStencil is not a constructor.


Anshul

unread,
Aug 9, 2017, 7:26:46 AM8/9/17
to JointJS
I get it done using below code inside bpmn.js:

joint.shapes.basic.Rect = joint.shapes.basic.Generic.extend({
    markup: '<g class="rotatable"><g class="scalable"><rect class="body"/></g><text class="label"/></g>',

    defaults: joint.util.deepSupplement({
        type: 'basic.Rect',
        attrs: {
            'rect': { fill: 'white', stroke: 'black', 'follow-scale': true, width: 80, height: 40 },
            ".label":{text:"",ref:".body","ref-x":.5,"ref-dy":20,"y-alignment":"middle","x-alignment":"middle","font-size":14,"font-family":"Arial, helvetica, sans-serif",fill:"#000000"},
            'text': { 'font-size': 14, 'ref-x': .5, 'ref-y': .5, ref: 'rect', 'y-alignment': 'middle', 'x-alignment': 'middle' }
        }
    }, joint.shapes.basic.Generic.prototype.defaults)
});


I have one more doubt:
Is there a way to style rappid JS BPMN editor UI. I mean, Can we enhance linking styles, element container ui like we have in QAD editor?

Roman Bruckner

unread,
Aug 16, 2017, 4:55:38 AM8/16/17
to joi...@googlegroups.com
Hi Anshul,


For example:

var message =  new joint.shapes.bpmn.Message({
        attrs: {
            '.body': {
                fill: '#FF0000'
            }
        }
 });
message.addTo(graph);

Regards,
Roman



--

---
You received this message because you are subscribed to the Google Groups "JointJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jointjs+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Reply all
Reply to author
Forward
0 new messages