app.comonent.ts
import {Component, ElementRef, OnInit, ViewChild} from '@angular/core';
import {HttpClient} from '@angular/common/http';
import {Observable} from 'rxjs';
import Modeler from "bpmn-js/lib/Modeler";
import propertiesPanelModule from "bpmn-js-properties-panel";
import propertiesProviderModule from "bpmn-js-properties-panel/lib/provider/camunda";
import camundaModdleExtension from "camunda-bpmn-moddle/lib";
import "bpmn-js/dist/assets/diagram-js.css";
import "bpmn-js/dist/assets/bpmn-font/css/bpmn-embedded.css";
import "bpmn-js-properties-panel/dist/assets/bpmn-js-properties-panel.css";
import * as camundaModdleDescriptor from 'camunda-bpmn-moddle/resources/camunda.json';
import * as FileSaver from 'file-saver';
import $ from 'jquery';
import ReplaceMenuProvider from './popup-menu';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent implements OnInit {
title = 'Workflow Modeler';
modeler: Modeler;
collapse1 = true;
@ViewChild('canvas')
private canvesRef: ElementRef;
constructor(private http: HttpClient) {
$('#collapsedPanel').css('right', '-40px');
}
ngOnInit(): void {
this.modeler = new Modeler({
container: '#canvas',
width: '100%',
height: '600px',
propertiesPanel: {
parent: '#properties'
},
additionalModules: [
propertiesPanelModule,
propertiesProviderModule,
// ReplaceMenuProvider,
camundaModdleExtension
],
moddleExtensions: {
camunda: camundaModdleDescriptor
}
});
this.load();
}
load(): void {
this.getExample().subscribe(data => {
this.modeler.importXML(data, value => this.handleError(value));
});
}
handleError(err: any) {
if (err) {
console.warn('Ups, error: ', err);
}
}
public getExample(): Observable<string> {
const url = '/assets/bpmn/initial.bpmn'; // local
return this.http.get(url, {responseType: 'text'});
}
save(): void {
this.modeler.saveSVG((err,result)=>{
if(err){
console.log(err,'got gerro')
}
else{
const blob = new Blob([result], {type: 'text/plain;charset=utf-8'});
FileSaver.saveAs(blob, 'bpmnSample.svg');
}
})
}
saveBPMN():void{
this.modeler.saveSVG((err,result)=>{
if(err){
console.log(err,'got gerro')
}
else{
const blob = new Blob([result], {type: 'text/plain;charset=utf-8'});
FileSaver.saveAs(blob, 'bpmnSample.bpmn');
}
})
}
collapsePanel() {
if (this.collapse1) {
$("#properties").css({"display": "none",});
$("#collapsedPanel").css({ "right": "-43px"});
this.collapse1 = false;
} else {
$("#properties").css('display','block');
$("#collapsedPanel").css('right','216px')
this.collapse1 = true;
}
}
}
app.comonent.html
<div class="modeler">
<div id="canvas" #canvas>
<button type="button" id="collapsedPanel" (click)="collapsePanel()">Properties Panel</button>
</div>
<div class="properties-panel" id="properties"></div>
</div>
<button id="download-svg" (click)="save()">svg image</button>
<button id="download-svg" (click)="saveBPMN()"> BPMN diagram</button>
the defualt event we have not working proeprly
see when i click on send task working properties panle image are below
![image|1366x768](upload://nZILTl3pNmedN3y0JhMH0nTxzFp.png)
but in my new demo when i click on send task
![image|1366x768](upload://dOGqD3pzXdoEACIHu5MfZuYIfPi.png)
hope you are able to understand difference prperties panel are not changed
i am following this github url https://github.com/Mallesh-Nagothi/bpmn-camunda-example
please help me guys
And your question is?
default event like send taks user task not working proerly
That’s not a question. Please explain what you’re trying to do and what exactly you need help with.
this is working image
and below you can see when click on send task nothing will be happen inproperties panel
please see difference
Sorry, I have no idea what your question is.
1 Like
deault menu of service task like send task recive task they are not working properly when i click on send task ok some custom properties should be change but not working this