-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FEAT] Allow to only show one or a set of pools at diagram load time #592
Comments
mxgraph resources We tried to make pool parent of lanes and lane parent of other bpmn elements. So making pool not visible in the mxgraph model should hide the children BPMN elements. |
In January, we have provided an example using mxgraph custom code that let hide or collapsed pools. |
As discussed during the POC #2020, option of the filter may look like this:
|
Experimentation completed
Conclusions to be written |
Implementation proposalDone with @csouchet based on the experience gained during the 2 POC. API definition// updated LoadOptions definition
interface LoadOptions {
fit?: FitOptions;
// new property
modelFilter?: ModelFilter;
}
interface ModelFilter {
pools?: PoolFilter | PoolFilter[];
}
interface PoolFilter {
id?: string;
name?: string;
} Note about the usage of the According to the BPMN Specification,
We have decided to keep the
However, when filtering by Example of use of the APIIn the following, bpmnVisualization.load(diagram, {
modelFilter: {
// A Pool is the graphical representation of a Participant in a Collaboration.
pools: [
{
/** id of the Participant related to the Pool to display */
id: 'id1'
},
{
/**
* Name of the Participant, or name of the Process referenced by the Participant
* when the Participant doesn't have a name.
* This is how bpmn-visualization built the name in its internal model.
**/
name: 'name2'
},
{
id: 'id3',
/** in this case, we use the id, not the name*/
name: 'name3'
}]
},
}); Filter a single pool by id bpmnVisualization.load(diagram, {
modelFilter: {
pools: {id: 'id1'},
},
}); Filter several pools by name only bpmnVisualization.load(diagram, {
modelFilter: {
pools: [
{name: 'name1'},
{name: 'name2'},
{name: 'name3'},
],
},
}); Filter with other load options bpmnVisualization.load(diagram, {
fit: {
type: FitType.Center,
margin: 20,
},
modelFilter: {
pools: [
{id: 'id1'},
{name: 'name2',},
],
},
}); For the future, when implementing diagram filter, see #729 bpmnVisualization.load(diagram, {
modelFilter: {
diagram: {
index: 0,
// or one of the following option
// id: 'id1',
},
pools: [
{id: 'id1'},
{name: 'name2',},
{id: 'id2'},
],
},
}); BehaviorThe filtering looks for pools that match id or names passed as parameter.
Error cases [UPDATE] Special cases
If there is a need for these, please fill an issue TestsUse #2025 as base for tests and add at least the following tests. The POC includes a lot of TODO about tests to add. visual tests
unit tests
|
I'm wondering why you silently igore an id or name that does not match? |
Yes, we are aware of this. We consider it as a warning instead of an error. In the future, we may also provide an option to ensure all pool ids/names match. |
Let pass a list of ids and/or names related to the participant in the BPMN semantic related to the pool(s) that will be displayed.
Discussions in progress. We should define the API and the best way to manage it internally.
Note: the original request was different, we decided to reduce the scope of the feature
The text was updated successfully, but these errors were encountered: