Skip to content

Commit

Permalink
Fixed browser-sync to open: false, and some minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
orlenyslp committed Dec 12, 2018
1 parent 0e41f8f commit c80bb5a
Show file tree
Hide file tree
Showing 10 changed files with 199 additions and 19,804 deletions.
1 change: 1 addition & 0 deletions v2.0/caterpillar-core/gulpfile.js
Expand Up @@ -29,6 +29,7 @@ gulp.task('test', function() {
// run browser-sync on for client changes
gulp.task('browser-sync', ['nodemon', 'watch'], function() {
browserSync.init(null, {
open: false,
proxy: "http://localhost:3000",
files: ["out/**/*.*", "out/routes/**/*.*", "out/public/**/*.*", "out/views/**/*.*"],
port: 7000,
Expand Down
4 changes: 4 additions & 0 deletions v2.0/caterpillar-core/src/models/abstract/ProcessRegistry.sol
Expand Up @@ -49,6 +49,10 @@ contract ProcessRegistry {
return processAddress;
}

function childrenFor(bytes32 parent, uint nodeInd) external view returns(bytes32) {
return parent2ChildrenBundleId[parent][nodeInd];
}

function bundleFor(address processInstance) public returns(bytes32) {
return instance2Bundle[processInstance];
}
Expand Down
62 changes: 37 additions & 25 deletions v2.0/caterpillar-core/src/models/models.controller.ts
Expand Up @@ -77,51 +77,63 @@ let processRegistryContract: any;
models.get('/processes', (req, res) => {
console.log('QUERYING ALL ACTIVE CONTRACTS');
let actives = [];
let registeredInstances = processRegistryContract.allInstances.call();
registeredInstances.forEach(instance => {
let repoID = web3.toAscii(processRegistryContract.bundleFor.call(instance)).toString().substr(0, 24);
repoSchema.find({_id: repoID},
(err, repoData) => {
if (err) {
res.status(404).send([]);
return;
} else {
if(repoData.length > 0) {
console.log({id: repoID, name: repoData[0].rootProcessName, address: instance});
actives.push({id: repoID, name: repoData[0].rootProcessName, address: instance});
if (actives.length === registeredInstances.length) {
res.status(200).send(actives);
if(processRegistryContract) {
let registeredInstances = processRegistryContract.allInstances.call();
registeredInstances.forEach(instance => {
let repoID = web3.toAscii(processRegistryContract.bundleFor.call(instance)).toString().substr(0, 24);
repoSchema.find({_id: repoID},
(err, repoData) => {
if (err) {
res.status(404).send([]);
return;
} else {
if(repoData.length > 0) {
console.log({id: repoID, name: repoData[0].rootProcessName, address: instance});
actives.push({id: repoID, name: repoData[0].rootProcessName, address: instance});
if (actives.length === registeredInstances.length) {
res.status(200).send(actives);
return;
}
}
}
}
})
})
}
})
})
} else {
res.status(404).send([]);
}
});

// Querying all registered (root) process in the repository

models.get('/models', (req, res) => {
console.log('QUERYING REGISTERED MODELS');
let actives = [];
if(processRegistryContract) {
repoSchema.find({'bpmnModel': {$ne: 'empty'}},
(err, repoData) => {
if (err)
res.send([]);
else {
repoData.forEach(data => {
console.log(data.rootProcessName);
actives.push({
id: data._id,
name: data.rootProcessName,
bpmn: data.bpmnModel,
solidity: data.solidityCode
})
if(web3.toAscii(processRegistryContract.childrenFor(data._id.toString(), 0)).toString().substr(0, 24) === data._id.toString()) {
console.log({id: data._id, name: data.rootProcessName});
actives.push({
id: data._id,
name: data.rootProcessName,
bpmn: data.bpmnModel,
solidity: data.solidityCode
})
}
});

console.log('----------------------------------------------------------------------------------------------');
res.send(actives);
}
});
} else {
res.send([]);
console.log('----------------------------------------------------------------------------------------------');
}
});

// Deploying new model (updating registry and repository)
Expand Down
Expand Up @@ -49,88 +49,88 @@
<bpmndi:BPMNDiagram id="BPMNDiagram_1">
<bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="Invoice_Handling">
<bpmndi:BPMNShape id="_BPMNShape_StartEvent_2" bpmnElement="StartEvent_1">
<dc:Bounds x="29" y="51" width="36" height="36" />
<dc:Bounds x="215" y="105" width="36" height="36" />
<bpmndi:BPMNLabel>
<dc:Bounds x="5" y="87" width="83" height="24" />
<dc:Bounds x="191" y="141" width="83" height="24" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="SequenceFlow_0ep6zut_di" bpmnElement="SequenceFlow_0ep6zut">
<di:waypoint xsi:type="dc:Point" x="65" y="69" />
<di:waypoint xsi:type="dc:Point" x="99" y="69" />
<di:waypoint xsi:type="dc:Point" x="251" y="123" />
<di:waypoint xsi:type="dc:Point" x="285" y="123" />
<bpmndi:BPMNLabel>
<dc:Bounds x="82" y="54" width="0" height="0" />
<dc:Bounds x="268" y="108" width="0" height="0" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape id="UserTask_06i5cy1_di" bpmnElement="Task_0e5xumt">
<dc:Bounds x="99" y="29" width="100" height="80" />
<dc:Bounds x="285" y="83" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="SequenceFlow_0oiwqsu_di" bpmnElement="SequenceFlow_0oiwqsu">
<di:waypoint xsi:type="dc:Point" x="199" y="69" />
<di:waypoint xsi:type="dc:Point" x="233" y="69" />
<di:waypoint xsi:type="dc:Point" x="385" y="123" />
<di:waypoint xsi:type="dc:Point" x="419" y="123" />
<bpmndi:BPMNLabel>
<dc:Bounds x="216" y="54" width="0" height="0" />
<dc:Bounds x="402" y="108" width="0" height="0" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape id="UserTask_1igus1e_di" bpmnElement="Task_1j0spgi">
<dc:Bounds x="312" y="29" width="100" height="80" />
<dc:Bounds x="498" y="83" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="ExclusiveGateway_0bvmb9p_di" bpmnElement="ExclusiveGateway_0bvmb9p" isMarkerVisible="true">
<dc:Bounds x="233" y="44" width="50" height="50" />
<dc:Bounds x="419" y="98" width="50" height="50" />
<bpmndi:BPMNLabel>
<dc:Bounds x="258" y="94" width="0" height="0" />
<dc:Bounds x="444" y="148" width="0" height="0" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="SequenceFlow_1w3n1g7_di" bpmnElement="SequenceFlow_1w3n1g7">
<di:waypoint xsi:type="dc:Point" x="283" y="69" />
<di:waypoint xsi:type="dc:Point" x="312" y="69" />
<di:waypoint xsi:type="dc:Point" x="469" y="123" />
<di:waypoint xsi:type="dc:Point" x="498" y="123" />
<bpmndi:BPMNLabel>
<dc:Bounds x="298" y="54" width="0" height="0" />
<dc:Bounds x="484" y="108" width="0" height="0" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape id="ExclusiveGateway_18klyzt_di" bpmnElement="ExclusiveGateway_18klyzt" isMarkerVisible="true">
<dc:Bounds x="443" y="44" width="50" height="50" />
<dc:Bounds x="629" y="98" width="50" height="50" />
<bpmndi:BPMNLabel>
<dc:Bounds x="441" y="8" width="53" height="24" />
<dc:Bounds x="627" y="62" width="53" height="24" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="SequenceFlow_09h00sj_di" bpmnElement="SequenceFlow_09h00sj">
<di:waypoint xsi:type="dc:Point" x="412" y="69" />
<di:waypoint xsi:type="dc:Point" x="443" y="69" />
<di:waypoint xsi:type="dc:Point" x="598" y="123" />
<di:waypoint xsi:type="dc:Point" x="629" y="123" />
<bpmndi:BPMNLabel>
<dc:Bounds x="428" y="54" width="0" height="0" />
<dc:Bounds x="614" y="108" width="0" height="0" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape id="EndEvent_063of2z_di" bpmnElement="EndEvent_063of2z">
<dc:Bounds x="532" y="51" width="36" height="36" />
<dc:Bounds x="718" y="105" width="36" height="36" />
<bpmndi:BPMNLabel>
<dc:Bounds x="508" y="87" width="83" height="24" />
<dc:Bounds x="694" y="141" width="83" height="24" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="SequenceFlow_0927rr5_di" bpmnElement="SequenceFlow_0927rr5">
<di:waypoint xsi:type="dc:Point" x="493" y="69" />
<di:waypoint xsi:type="dc:Point" x="532" y="69" />
<di:waypoint xsi:type="dc:Point" x="679" y="123" />
<di:waypoint xsi:type="dc:Point" x="718" y="123" />
<bpmndi:BPMNLabel>
<dc:Bounds x="497" y="47" width="18" height="12" />
<dc:Bounds x="683" y="101" width="18" height="12" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="SequenceFlow_006j8eo_di" bpmnElement="SequenceFlow_006j8eo">
<di:waypoint xsi:type="dc:Point" x="468" y="94" />
<di:waypoint xsi:type="dc:Point" x="468" y="159" />
<di:waypoint xsi:type="dc:Point" x="411" y="159" />
<di:waypoint xsi:type="dc:Point" x="654" y="148" />
<di:waypoint xsi:type="dc:Point" x="654" y="213" />
<di:waypoint xsi:type="dc:Point" x="597" y="213" />
<bpmndi:BPMNLabel>
<dc:Bounds x="448" y="121.02490086872996" width="14" height="12" />
<dc:Bounds x="634" y="175" width="14" height="12" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="SequenceFlow_07vj39u_di" bpmnElement="SequenceFlow_07vj39u">
<di:waypoint xsi:type="dc:Point" x="311" y="159" />
<di:waypoint xsi:type="dc:Point" x="258" y="159" />
<di:waypoint xsi:type="dc:Point" x="258" y="94" />
<di:waypoint xsi:type="dc:Point" x="497" y="213" />
<di:waypoint xsi:type="dc:Point" x="444" y="213" />
<di:waypoint xsi:type="dc:Point" x="444" y="148" />
<bpmndi:BPMNLabel>
<dc:Bounds x="285" y="144" width="0" height="0" />
<dc:Bounds x="471" y="198" width="0" height="0" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape id="UserTask_0mjla0b_di" bpmnElement="Task_0m7b8xz">
<dc:Bounds x="311" y="119" width="100" height="80" />
<dc:Bounds x="497" y="173" width="100" height="80" />
</bpmndi:BPMNShape>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
Expand Down

0 comments on commit c80bb5a

Please sign in to comment.