-
Notifications
You must be signed in to change notification settings - Fork 1
/
.README.md.html
750 lines (662 loc) · 22.7 KB
/
.README.md.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Strict//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>D:\dev\git\bonita-community\BonitaCommandDeployment\.README.md.html</title>
<style type="text/css">
body {
color: #333;
font: 13px/1.4 "Helvetica Neue", Helvetica, "Segoe UI", Arial, freesans, sans-serif;
padding: 0;
margin: 0;
}
a {
background: transparent;
color: #4183c4;
text-decoration: none;
}
a:active,
a:hover {
outline: 0 none;
text-decoration: underline;
}
abbr[title] {
border-bottom: 1px dotted;
}
b,
strong {
font-weight: bold;
}
dfn {
font-style: italic;
}
h1 {
font-size: 2em;
margin: 0.67em 0;
}
mark {
background: #ff0;
color: #000;
}
small {
font-size: 80%;
}
sub, sup {
font-size: 75%;
line-height: 0;
position: relative;
vertical-align: baseline;
}
sup {
top: -0.5em;
}
sub {
bottom: -0.25em;
}
img {
border: 0 none;
}
svg:not(:root) {
overflow: hidden;
}
figure {
margin: 1em 40px;
}
hr {
box-sizing: content-box;
height: 0;
}
code,
kbd,
pre,
samp {
font-family: monospace,monospace;
font-size: 1em;
}
pre {
overflow: auto;
font: 12px Consolas,"Liberation Mono",Menlo,Courier,monospace;
margin-bottom: 0;
margin-top: 0;
}
.markdown-body {
padding: 30px;
font-size: 16px;
line-height: 1.6;
word-wrap: break-word;
}
.markdown-body>*:first-child {
margin-top: 0 !important;
}
.markdown-body>*:last-child {
margin-bottom: 0 !important;
}
.markdown-body .absent {
color: #c00;
}
.markdown-body .anchor {
position: absolute;
top: 0;
bottom: 0;
left: 0;
display: block;
padding-right: 6px;
padding-left: 30px;
margin-left: -30px;
}
.markdown-body .anchor:focus {
outline: none;
}
.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4,
.markdown-body h5,
.markdown-body h6 {
position: relative;
margin-top: 1em;
margin-bottom: 16px;
font-weight: bold;
line-height: 1.4;
}
.markdown-body h1 .octicon-link,
.markdown-body h2 .octicon-link,
.markdown-body h3 .octicon-link,
.markdown-body h4 .octicon-link,
.markdown-body h5 .octicon-link,
.markdown-body h6 .octicon-link {
display: none;
color: #000;
vertical-align: middle;
}
.markdown-body h1:hover .anchor,
.markdown-body h2:hover .anchor,
.markdown-body h3:hover .anchor,
.markdown-body h4:hover .anchor,
.markdown-body h5:hover .anchor,
.markdown-body h6:hover .anchor {
padding-left: 8px;
margin-left: -30px;
line-height: 1;
text-decoration: none;
}
.markdown-body h1:hover .anchor .octicon-link,
.markdown-body h2:hover .anchor .octicon-link,
.markdown-body h3:hover .anchor .octicon-link,
.markdown-body h4:hover .anchor .octicon-link,
.markdown-body h5:hover .anchor .octicon-link,
.markdown-body h6:hover .anchor .octicon-link {
display: inline-block;
}
.markdown-body h1 tt,
.markdown-body h1 code,
.markdown-body h2 tt,
.markdown-body h2 code,
.markdown-body h3 tt,
.markdown-body h3 code,
.markdown-body h4 tt,
.markdown-body h4 code,
.markdown-body h5 tt,
.markdown-body h5 code,
.markdown-body h6 tt,
.markdown-body h6 code {
font-size: inherit;
}
.markdown-body h1 {
padding-bottom: 0.3em;
font-size: 2.25em;
line-height: 1.2;
border-bottom: 1px solid #eee;
}
.markdown-body h2 {
padding-bottom: 0.3em;
font-size: 1.75em;
line-height: 1.225;
border-bottom: 1px solid #eee;
}
.markdown-body h3 {
font-size: 1.5em;
line-height: 1.43;
}
.markdown-body h4 {
font-size: 1.25em;
}
.markdown-body h5 {
font-size: 1em;
}
.markdown-body h6 {
font-size: 1em;
color: #777;
}
.markdown-body p,.markdown-body blockquote,
.markdown-body ul,.markdown-body ol,
.markdown-body dl,.markdown-body table,
.markdown-body pre {
margin-top: 0;
margin-bottom: 16px;
}
.markdown-body hr {
height: 4px;
padding: 0;
margin: 16px 0;
background-color: #e7e7e7;
border: 0 none;
}
.markdown-body ul,
.markdown-body ol {
padding-left: 2em;
}
.markdown-body ul.no-list,
.markdown-body ol.no-list {
padding: 0;
list-style-type: none;
}
.markdown-body ul ul,
.markdown-body ul ol,
.markdown-body ol ol,
.markdown-body ol ul {
margin-top: 0;
margin-bottom: 0;
}
.markdown-body li>p {
margin-top: 16px;
}
.markdown-body dl {
padding: 0;
}
.markdown-body dl dt {
padding: 0;
margin-top: 16px;
font-size: 1em;
font-style: italic;
font-weight: bold;
}
.markdown-body dl dd {
padding: 0 16px;
margin-bottom: 16px;
}
.markdown-body blockquote {
padding: 0 15px;
color: #777;
border-left: 4px solid #ddd;
}
.markdown-body blockquote>:first-child {
margin-top: 0;
}
.markdown-body blockquote>:last-child {
margin-bottom: 0;
}
.markdown-body table {
display: block;
width: 100%;
overflow: auto;
word-break: normal;
word-break: keep-all;
}
.markdown-body table th {
font-weight: bold;
}
.markdown-body table th,
.markdown-body table td {
padding: 6px 13px;
border: 1px solid #ddd;
}
.markdown-body table tr {
background-color: #fff;
border-top: 1px solid #ccc;
}
.markdown-body table tr:nth-child(2n) {
background-color: #f8f8f8;
}
.markdown-body img {
max-width: 100%;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
.markdown-body span.frame {
display: block;
overflow: hidden;
}
.markdown-body span.frame>span {
display: block;
float: left;
width: auto;
padding: 7px;
margin: 13px 0 0;
overflow: hidden;
border: 1px solid #ddd;
}
.markdown-body span.frame span img {
display: block;
float: left;
}
.markdown-body span.frame span span {
display: block;
padding: 5px 0 0;
clear: both;
color: #333;
}
.markdown-body span.align-center {
display: block;
overflow: hidden;
clear: both;
}
.markdown-body span.align-center>span {
display: block;
margin: 13px auto 0;
overflow: hidden;
text-align: center;
}
.markdown-body span.align-center span img {
margin: 0 auto;
text-align: center;
}
.markdown-body span.align-right {
display: block;
overflow: hidden;
clear: both;
}
.markdown-body span.align-right>span {
display: block;
margin: 13px 0 0;
overflow: hidden;
text-align: right;
}
.markdown-body span.align-right span img {
margin: 0;
text-align: right;
}
.markdown-body span.float-left {
display: block;
float: left;
margin-right: 13px;
overflow: hidden;
}
.markdown-body span.float-left span {
margin: 13px 0 0;
}
.markdown-body span.float-right {
display: block;
float: right;
margin-left: 13px;
overflow: hidden;
}
.markdown-body span.float-right>span {
display: block;
margin: 13px auto 0;
overflow: hidden;
text-align: right;
}
.markdown-body code,.markdown-body tt {
padding: 0;
padding-top: 0.2em;
padding-bottom: 0.2em;
margin: 0;
font-size: 85%;
background-color: rgba(0,0,0,0.04);
border-radius: 3px;
}
.markdown-body code:before,
.markdown-body code:after,
.markdown-body tt:before,
.markdown-body tt:after {
letter-spacing: -0.2em;
content: "\00a0";
}
.markdown-body code br,
.markdown-body tt br {
display: none;
}
.markdown-body del code {
text-decoration: inherit;
}
.markdown-body pre>code {
padding: 0;
margin: 0;
font-size: 100%;
word-break: normal;
white-space: pre;
background: transparent;
border: 0;
}
.markdown-body .highlight {
margin-bottom: 16px;
}
.markdown-body .highlight pre,
.markdown-body pre {
padding: 16px;
overflow: auto;
font-size: 85%;
line-height: 1.45;
background-color: #f7f7f7;
border-radius: 3px;
}
.markdown-body .highlight pre {
margin-bottom: 0;
word-break: normal;
}
.markdown-body pre {
word-wrap: normal;
}
.markdown-body pre code,
.markdown-body pre tt {
display: inline;
max-width: initial;
padding: 0;
margin: 0;
overflow: initial;
line-height: inherit;
word-wrap: normal;
background-color: transparent;
border: 0;
}
.markdown-body pre code:before,
.markdown-body pre code:after,
.markdown-body pre tt:before,
.markdown-body pre tt:after {
content: normal;
}
.highlight .pl-coc,
.highlight .pl-entl,
.highlight .pl-entm,
.highlight .pl-eoa,
.highlight .pl-mai .pl-sf,
.highlight .pl-mm,
.highlight .pl-pdv,
.highlight .pl-sc,
.highlight .pl-som,
.highlight .pl-sr,
.highlight .pl-v,
.highlight .pl-vpf {
color: #0086b3;
}
.highlight .pl-eoac,
.highlight .pl-mdht,
.highlight .pl-mi1,
.highlight .pl-mri,
.highlight .pl-va,
.highlight .pl-vpu {
color: #008080;
}
.highlight .pl-c,
.highlight .pl-pdc {
color: #b4b7b4;
font-style: italic;
}
.highlight .pl-k,
.highlight .pl-ko,
.highlight .pl-kolp,
.highlight .pl-mc,
.highlight .pl-mr,
.highlight .pl-ms,
.highlight .pl-s,
.highlight .pl-sok,
.highlight .pl-st {
color: #6e5494;
}
.highlight .pl-ef,
.highlight .pl-enf,
.highlight .pl-enm,
.highlight .pl-entc,
.highlight .pl-eoi,
.highlight .pl-sf,
.highlight .pl-smc {
color: #d12089;
}
.highlight .pl-ens,
.highlight .pl-eoai,
.highlight .pl-kos,
.highlight .pl-mh .pl-pdh,
.highlight .pl-mp,
.highlight .pl-pde,
.highlight .pl-stp {
color: #458;
}
.highlight .pl-enti {
color: #d12089;
font-weight: bold;
}
.highlight .pl-cce,
.highlight .pl-enc,
.highlight .pl-kou,
.highlight .pl-mq {
color: #f93;
}
.highlight .pl-mp1 .pl-sf {
color: #458;
font-weight: bold;
}
.highlight .pl-cos,
.highlight .pl-ent,
.highlight .pl-md,
.highlight .pl-mdhf,
.highlight .pl-ml,
.highlight .pl-pdc1,
.highlight .pl-pds,
.highlight .pl-s1,
.highlight .pl-scp,
.highlight .pl-sol {
color: #df5000;
}
.highlight .pl-c1,
.highlight .pl-cn,
.highlight .pl-pse,
.highlight .pl-pse .pl-s2,
.highlight .pl-vi {
color: #a31515;
}
.highlight .pl-mb,
.highlight .pl-pdb {
color: #df5000;
font-weight: bold;
}
.highlight .pl-mi,
.highlight .pl-pdi {
color: #6e5494;
font-style: italic;
}
.highlight .pl-ms1 {
background-color: #f5f5f5;
}
.highlight .pl-mdh,
.highlight .pl-mdi {
font-weight: bold;
}
.highlight .pl-mdr {
color: #0086b3;
font-weight: bold;
}
.highlight .pl-s2 {
color: #333;
}
.highlight .pl-ii {
background-color: #df5000;
color: #fff;
}
.highlight .pl-ib {
background-color: #f93;
}
.highlight .pl-id {
background-color: #a31515;
color: #fff;
}
.highlight .pl-iu {
background-color: #b4b7b4;
}
.highlight .pl-mo {
color: #969896;
}
</style>
<script type="text/javascript">
function getDocumentScrollTop()
{
var res = document.body.scrollTop || document.documentElement.scrollTop || window.pageYOffset || 0;
// alert(res);
return res;
}
function setDocumentScrollTop(ypos)
{
window.scrollTo(0, ypos);
}
</script>
</head>
<body class="markdown-body">
<h1> <a id="bonitacommanddeployment" class="anchor" href="#bonitacommanddeployment" aria-hidden="true"><span aria-hidden="true" class="octicon octicon-link"></span></a>BonitaCommandDeployment</h1>
<p>Library to deploy automatically a command, when needed, and organize the communication between the source and the command.</p>
<h1> <a id="bonitacommanddeployment-advantages" class="anchor" href="#bonitacommanddeployment-advantages" aria-hidden="true"><span aria-hidden="true" class="octicon octicon-link"></span></a>BonitaCommandDeployment advantages</h1>
<p>A command must implement the method org.bonitasoft.engine.command.TenantCommand.TenantComand.execute().</p>
<p>This method has different concerns:</p>
<ol>
<li> <p>it passes as parameters a TenantServiceAccessor object. This object is not documented, and it's an internal class. The object you can access via this class is not stable and can change on BonitaVersion. Any command you implement via this object can not work in the next release of Bonita.</p> </li>
<li> <p>BonitaEngine open for you a Database Transaction before the call. If you can access a public accessor, all method from the public accessor will not work (like a processAPI.getPendingTask() ): a connection is already opened.</p> </li>
<li> <p>Deployment is a point: is your software has to redeploy the command every time? It should be better to verify first is the JAR is a new one, and deploy the command only when needed.</p> </li>
<li> <p>Dependencies are a clue. All command uses the same dependencies. If a command use BonitaEvent 1.8, and then you deploy a new command with a dependency BonitaEvent 1.6, then the first command will now use Bonita Event 1.6. So, when you deploy a dependency, it's better to check if the newest version exists, isn't' it?</p> </li>
</ol>
<h1> <a id="implement-your-command" class="anchor" href="#implement-your-command" aria-hidden="true"><span aria-hidden="true" class="octicon octicon-link"></span></a>Implement your command</h1>
<p>Implement the method org.bonitasoft.engine.command.TenantCommand.TenantComand.execute().</p>
<p>This method has to concern:</p>
<p>1/ it pass as parameters a TenantServiceAccessor object. This object is not documented, and it's an internal class. Object you can access via this class are not stable, and can change on BonitaVersion. Any command you implement via this object can not work in a next release of Bonita</p>
<p>2/ BonitaEngine open for you a Database Transaction before the call. If you can access a public accessor, all method from the public accessor will not work (like a processAPI.getPendingTask() ): a connection is already opened.</p>
<p>To avoid this concern, BonitaCommandDeployment propose to extend a BonitaCommandApiAccessor class, method executeCommandApiAccessor().</p>
<div class="highlight highlight-source-java">
<pre><span class="pl-k">public</span> <span class="pl-k">abstract</span> <span class="pl-smi">ExecuteAnswer</span> executeCommandApiAccessor(<span class="pl-smi">ExecuteParameters</span> executeParameters, <span class="pl-smi">APIAccessor</span> apiAccessor);</pre>
</div>
<p>This command provide a APIAccessor, where you can get all the public API.</p>
<p>You are welcome to provide the method</p>
<div class="highlight highlight-source-java">
<pre><span class="pl-k">public</span> <span class="pl-smi">String</span> getHelp(<span class="pl-k">Map<<span class="pl-smi">String</span>, <span class="pl-smi">Serializable</span>></span> parameters, <span class="pl-k">long</span> tenantId, <span class="pl-smi">TenantServiceAccessor</span> serviceAccessor) </pre>
</div>
<p>to return information to the Administrator via the Custom Page Command.</p>
<h1> <a id="deploy-a-command" class="anchor" href="#deploy-a-command" aria-hidden="true"><span aria-hidden="true" class="octicon octicon-link"></span></a>Deploy a command</h1>
<p>Deploying a command via the API is complex.</p>
<p>To help the deployment, object BonitaCommandDeployment encapsulate all the work. So, a custom page who want to deploy automatically a command can just use this object.</p>
<div class="highlight highlight-source-java">
<pre> <span class="pl-k">public</span> <span class="pl-smi">DeployStatus</span> checkAndDeployCommand(<span class="pl-smi">File</span> pageDirectory, <span class="pl-smi">CommandAPI</span> commandAPI, <span class="pl-smi">PlatformAPI</span> platFormAPI,
<span class="pl-k">long</span> tenantId) {
<span class="pl-smi">BonitaCommandDeployment</span> bonitaCommand <span class="pl-k">=</span> <span class="pl-smi">BonitaCommandDeployment</span><span class="pl-k">.</span>getInstance(<span class="pl-smi">MilkCmdControl</span><span class="pl-k">.</span>cstCommandName);
<span class="pl-smi">BonitaCommandDescription</span> commandDescription <span class="pl-k">=</span> <span class="pl-k">new</span> <span class="pl-smi">BonitaCommandDescription</span>(bonitaCommand, pageDirectory);
commandDescription<span class="pl-k">.</span>forceDeploy <span class="pl-k">=</span> <span class="pl-c1">false</span>;
commandDescription<span class="pl-k">.</span>mainCommandClassName <span class="pl-k">=</span> <span class="pl-smi">MilkCmdControl</span><span class="pl-k">.</span>class<span class="pl-k">.</span>getName();
commandDescription<span class="pl-k">.</span>mainJarFile <span class="pl-k">=</span> <span class="pl-s"><span class="pl-pds">"</span>TruckMilk-1.0-Page.jar<span class="pl-pds">"</span></span>;
commandDescription<span class="pl-k">.</span>commandDescription <span class="pl-k">=</span> <span class="pl-smi">MilkCmdControl</span><span class="pl-k">.</span>cstCommandDescription;
<span class="pl-c"><span class="pl-c">//</span> "bonita-commanddeployment-1.2.jar" is deployed automaticaly with BonitaCommandDeployment</span>
<span class="pl-c"><span class="pl-c">//</span> commandDescription.dependencyJars = new String[] { "bonita-event-1.5.0.jar", "bonita-properties-2.0.0.jar" }; // "mail-1.5.0-b01.jar", "activation-1.1.jar"};</span>
commandDescription<span class="pl-k">.</span>addJarDependency(<span class="pl-s"><span class="pl-pds">"</span>bonita-event<span class="pl-pds">"</span></span>, <span class="pl-s"><span class="pl-pds">"</span>1.5.0<span class="pl-pds">"</span></span>, <span class="pl-s"><span class="pl-pds">"</span>bonita-event-1.5.0.jar<span class="pl-pds">"</span></span>);
commandDescription<span class="pl-k">.</span>addJarDependency(<span class="pl-s"><span class="pl-pds">"</span>bonita-properties<span class="pl-pds">"</span></span>, <span class="pl-s"><span class="pl-pds">"</span>2.1.0<span class="pl-pds">"</span></span>, <span class="pl-s"><span class="pl-pds">"</span>bonita-properties-2.1.0.jar<span class="pl-pds">"</span></span>);
<span class="pl-smi">DeployStatus</span> deployStatus <span class="pl-k">=</span> bonitaCommand<span class="pl-k">.</span>checkAndDeployCommand(commandDescription, <span class="pl-c1">true</span>, tenantId, commandAPI, platFormAPI);
<span class="pl-k">return</span> deployStatus;
}</pre>
</div>
<h1> <a id="dependency-policies" class="anchor" href="#dependency-policies" aria-hidden="true"><span aria-hidden="true" class="octicon octicon-link"></span></a>Dependency policies</h1>
<p>Bonita does not manage a list of dependency per command. All dependencies are visible by all command. Second, it's not possible to get the content of the dependencie, and even not the list of dependencies via the commandAPI.</p>
<p>Is that better to give a dependencie like "bonita-event-1.5.0" ? at one moment, you will have in the dependencies "bonita-event-1.4.0", bonita-event-1.5.0", you don't know which command use which dependencies, you may face a "NoSuchMethod" if the command load bonita-event-1.4.0 first</p>
<p>Is that better to give a dependencie like "bonita-event" and then load the last one? Sure, that's help (only one jar file). The point is : a) to be sure the librairy is ascendent compatible (command developped with 1.4.0 can work with 1.5.0), b) how to load the last version? when you deploy a command embeded 1.4.0, you have to verify first if the JAR currently load is less than 1.4.0 before loading it</p>
<p>BonitaDeployment can manage the two situations:</p>
<div class="highlight highlight-source-java">
<pre> commandDescription<span class="pl-k">.</span>addJarDependency(<span class="pl-s"><span class="pl-pds">"</span>bonita-event-1.5.0<span class="pl-pds">"</span></span>, <span class="pl-s"><span class="pl-pds">"</span>1.5.0<span class="pl-pds">"</span></span>, <span class="pl-s"><span class="pl-pds">"</span>bonita-event-1.5.0.jar<span class="pl-pds">"</span></span>);</pre>
</div>
<p>This method load the JAR file, whatever the existing version</p>
<div class="highlight highlight-source-java">
<pre> commandDescription<span class="pl-k">.</span>addJarDependencyLastVersion(<span class="pl-s"><span class="pl-pds">"</span>bonita-event<span class="pl-pds">"</span></span>, <span class="pl-s"><span class="pl-pds">"</span>1.5.0<span class="pl-pds">"</span></span>, <span class="pl-s"><span class="pl-pds">"</span>bonita-event-1.5.0.jar<span class="pl-pds">"</span></span>);</pre>
</div>
<p>This method check the dependencies, and load the version only if the jar in the database is older. The second parameters, the version, is then checked according the policy x.y.z</p>
<h1> <a id="internal-architecture" class="anchor" href="#internal-architecture" aria-hidden="true"><span aria-hidden="true" class="octicon octicon-link"></span></a>Internal architecture</h1>
<ul>
<li>BonitaCommand Internal class. This class is the TenantCommand implementation. The engine call</li>
</ul>
<div class="highlight highlight-source-java">
<pre> <span class="pl-k">public</span> <span class="pl-smi">Serializable</span> execute(<span class="pl-k">Map<<span class="pl-smi">String</span>, <span class="pl-smi">Serializable</span>></span> parameters, <span class="pl-smi">TenantServiceAccessor</span> serviceAccessor)</pre>
</div>
<pre><code>BonitaCommand then call the methode BonitaCommand.executeSingleton()
This executeSingleton form the ExcuteParameters object, check if the call is for a PING, a AFTERDEPLOYMENT or anopther one.
If this is an another one, the call call the method (abstract)
</code></pre>
<div class="highlight highlight-source-java">
<pre> <span class="pl-smi">ExecuteAnswer</span> executeCommand(<span class="pl-smi">ExecuteParameters</span> executeParameters, <span class="pl-smi">TenantServiceAccessor</span> serviceAccessor);</pre>
</div>
<ul>
<li>BonitaCommandApiAccessor A second class, implement BonitaCommand. This class implement the abstract method</li>
</ul>
<div class="highlight highlight-source-java">
<pre> executeCommand(<span class="pl-smi">ExecuteParameters</span> executeParameters, <span class="pl-smi">TenantServiceAccessor</span> serviceAccessor);</pre>
</div>
<pre><code>In order to give a (abstract) method
</code></pre>
<div class="highlight highlight-source-java">
<pre> <span class="pl-k">public</span> <span class="pl-k">abstract</span> <span class="pl-smi">ExecuteAnswer</span> executeCommandApiAccessor(<span class="pl-smi">ExecuteParameters</span> executeParameters, <span class="pl-smi">APIAccessor</span> apiAccessor);</pre>
</div>
<pre><code>this class implement the executeCommand().
In the implementation, the method start a new thread. The new thread call the executeCommandApiAccessor(). In the new thread, no Database connextion are open, then a APIAcessor can be created and given.
When a user extend BonitaCommandApiAccessor, and implement executeCommandAPIAccessor(), this class extend BonitaCommand and BonitaCommandApiAccessor.
Command call BonitaCommand.execute()
This method check the verb, and then call BonitaCommand.executeCommand()
BonitaCommand.executeCommand() is implemented by BonitaCommandAPIAccessor()
BonitaCommandAPIAccessor creates a thread, and the thread call executeCommandApiAccessor()
This is your class.
</code></pre>
<ul>
<li> <p>BonitaCommandDeployment This method simplify the command deployment and call. At deploiment, this class check if the command is already deployed / or is new (compare the Signature on file) THis class check and deploy the dependencie, based on the date on the JAR and the date in database (BonitaDependencie does not saved version).</p> </li>
<li> <p>BonitaCommandDescription Class to manipulate the command description.</p> </li>
</ul>
</body>
</html>