15 include_once (
"FDL/Lib.Attr.php");
16 include_once (
"FDL/Class.DocFam.php");
26 private $lines = array();
31 private $ratio =
'auto';
32 private $orient =
'LR';
34 private $type =
'simple';
35 private $statefontsize;
36 private $conditionfontsize;
37 private $labelfontsize;
39 private $memoTr = array();
40 private $clusters = array();
41 private $clusterProps = array();
43 'autonext-color' =>
'#006400',
44 'arrow-label-font-color' =>
'#555555',
45 'arrow-color' =>
'#00008b',
46 'ask-color' =>
'#00008b',
47 'condition-color0' =>
'#6df8ab',
48 'condition-color1' =>
'#ffff00',
49 'action-color2' =>
'#ffa500',
50 'action-color3' =>
'#74c0ec',
51 'mail-color' =>
'#a264d2',
52 'timer-color' =>
'#64a2d2',
53 'start-color' =>
'#00ff00',
54 'end-color' =>
'#ff0000',
66 $ft = $this->wdoc->firstState;
68 switch ($this->
type) {
74 $this->setStartPoint();
76 $this->setTransitionLines();
77 if ($this->
type ==
'cluster') $this->drawCluster();
82 $this->setTransitionLines();
83 $this->lines[] = sprintf(
'%s [shape=doublecircle]', $this->wdoc->firstState);
87 $this->setActivities();
88 $this->setTransitionLines();
89 $this->lines[] = sprintf(
'%s [penwidth=2]', $this->wdoc->firstState);
95 $this->setTransitionLines();
96 $this->lines[] = sprintf(
'%s [shape=doublecircle]', $this->wdoc->firstState);
100 $dot =
"digraph \"" . $this->wdoc->getHtmlTitle() .
"\" {
101 ratio=\"{$this->ratio}\";
102 rankdir={$this->orient};
106 splines=true; fontsize={$this->conditionfontsize}; fontname=sans;
107 node [shape = circle, style=filled, fixedsize=true,fontsize={$this->fontsize},fontname=sans];
108 edge [shape = circle, style=filled, fixedsize=true,fontsize={$this->conditionfontsize},fontname=sans];\n";
110 $dot.= implode($this->lines,
"\n");
115 private function setTransitionLines()
117 foreach ($this->wdoc->cycle as $k => $v) {
118 switch ($this->
type) {
126 $this->setSimpleTransitionLine($k, $v);
130 $this->setActivityTransitionLine($k, $v);
141 private function setAttachStart($startPoint, $end, $limitIndex = - 1)
143 $transitionLink = array();
145 foreach ($this->wdoc->cycle as $k => $v) {
146 if ($v[
"e2"] == $startPoint) {
147 $t = $this->wdoc->transitions[$v[
"t"]];
149 if (!empty($t[
"m3"]))
$start =
"m3" . $k;
151 $tmids = $this->wdoc->getTransitionTimers($v[
"t"]);
152 if ($tmids)
$start =
"tm" . $k;
154 $tmid = $this->wdoc->getStateTimers($v[
"e2"]);
156 if ($tmid)
$start =
"tmf" . $k;
158 $tmid = $this->wdoc->getTransitionMailTemplates($v[
"t"]);
160 if ($tmid)
$start =
"mt" . $k;
162 $tmid = $this->wdoc->getStateMailTemplate($v[
"e2"]);
164 if ($tmid)
$start =
"mtf" . $k;
167 if (!empty($t[
"m2"]))
$start =
"m2" . $k;
168 else $start = $v[
"e2"] . $k;
174 if (
$start && (($limitIndex == - 1) || (empty($transitionLink[$v[
"t"] . $v[
"e2"]])))) {
175 $transitionLink[$v[
"t"] . $v[
"e2"]] =
true;
176 if (empty($this->memoTr[
$start][$end]) && empty($transitionLink[$kt])) {
177 $transitionLink[$kt] =
true;
178 $this->lines[] = sprintf(
'"%s" -> "%s" [labelfontcolor="%s",decorate=false, color="%s", labelfontname=sans, label="%s"];',
$start, $end, $this->style[
'arrow-label-font-color'], $this->style[
'arrow-color'],
"");
180 $this->memoTr[
$start][$end] =
true;
191 private function setTransitionState($e1, $index)
193 $color = $this->wdoc->getColor($e1);
194 $saction = $this->getActivityLabel($e1);
195 $tt = sprintf(
'label="%s"', $this->
_n($e1));
196 $tt.=
',shape = circle, style=filled, fixedsize=true,width=1.0, fontname=sans';
197 if ($saction) $tt.=
', tooltip="' . $e1 .
'"';
199 if ($color) $tt.=
',fillcolor="' . $color .
'"';
201 $this->lines[] =
'"' . $e1 . $index .
'" [' . $tt .
'];';
203 $this->clusters[$index][] = $e1 . $index;
204 $this->clusterProps[$index] = sprintf(
'color="%s";fillcolor="blue:yellow";label="%s";', $color, $index);
207 private function existsTransition($e1, $e2, $t)
209 foreach ($this->wdoc->cycle as $k => $v) {
210 if (($v[
"e1"] == $e1) && ($v[
"e2"] == $e2) && ($v[
"t"] == $t))
return true;
214 private function linkSameTransition($tr, $index)
216 foreach ($this->wdoc->cycle as $k => $v) {
217 if (($k < $index) && ($v[
"e2"] == $tr[
"e2"]) && ($v[
"t"] == $tr[
"t"])) {
219 $t = $this->wdoc->transitions[$tr[
"t"]];
220 if (!empty($t[
"m0"])) $e2 =
"m0" . $k;
221 elseif (!empty($t[
"m1"])) $e2 = "m1" . $k;
222 $e1 = $this->getActivityId($tr["e1"]);
223 if ($this->existsTransition($tr["e2"], $tr["e1"], $tr["
t"])) continue;
225 $this->lines[] = sprintf('"%s" -> "%s" [labelfontsize=6,color="%s" ,labelfontname=sans, label="%s"];', $e1, $e2, $this->style['arrow-color'], $this->
_n($tr["
t"]));
238 $this->lines[] = sprintf(
'# complete %d %s %s->%s', $index, $tr[
"t"], $tr[
"e1"], $tr[
"e2"]);
241 $t = $this->wdoc->transitions[$tr[
"t"]];
242 $m0 = isset($t[
"m0"]) ? $t[
"m0"] : null;
243 $m1 = isset($t[
"m1"]) ? $t[
"m1"] : null;
244 $m2 = isset($t[
"m2"]) ? $t[
"m2"] : null;
245 $m3 = isset($t[
"m3"]) ? $t[
"m3"] : null;
246 $ask = isset($t[
"ask"]) ? $t[
"ask"] : null;
247 $act = $this->getActivityId($e1);
249 if ($this->linkSameTransition($tr, $index)) {
251 $this->setAttachStart($e1, $act);
255 $this->setTransitionState($e2, $index);
256 $this->setM0M3($t, $index);
258 if (isset($this->wdoc->autonext[$tr[
"e1"]]) && ($this->wdoc->autonext[$e1] == $e2)) {
259 $tmain = sprintf(
'color="%s",style="setlinewidth(3)",arrowsize=1.0', $this->style[
'autonext-color']);
261 $startedPoint =
false;
263 $this->setAttachStart($e1, $act);
264 $startedPoint =
true;
270 $mi =
"ask" . $index;
271 if (!$startedPoint) {
272 $this->setAttachStart($e1, $mi);
273 $startedPoint =
true;
275 $this->lines[] =
'#ASK';
276 $this->lines[] = sprintf(
'"%s" -> "%s" [labelfontcolor="%s",decorate=false, color="%s", labelfontname=sans, label="%s"];', $e1, $mi, $this->style[
'arrow-label-font-color'], $this->style[
'arrow-color'], _($tr[
"t"]));
281 if (!$startedPoint) {
282 $this->setAttachStart($e1, $mi);
283 $startedPoint =
true;
285 $this->lines[] =
'#M0';
286 $this->lines[] = sprintf(
'"%s" -> "%s" [labelfontcolor="%s",decorate=false, color="%s", labelfontname=sans, label="%s"];', $e1, $mi, $this->style[
'arrow-label-font-color'], $this->style[
'arrow-color'], _($tr[
"t"]));
292 if (!$startedPoint) {
293 $this->setAttachStart($e1, $mi);
294 $startedPoint =
true;
296 $this->lines[] =
'#M1';
297 $this->lines[] = sprintf(
'"%s" -> "%s" [labelfontcolor="%s",decorate=false, color="%s", labelfontname=sans, label="%s"];', $e1, $mi, $this->style[
'arrow-label-font-color'], $this->style[
'arrow-color'], _($tr[
"t"]));
301 if (empty($this->memoTr[$e1][$e2p])) {
303 if (!$startedPoint) {
304 $this->setAttachStart($e1, $e2);
305 $startedPoint =
true;
307 $this->lines[] = sprintf(
'"%s" -> "%s" [labelfontsize=6,color="%s" %s,labelfontname=sans, label="%s"];', $e1, $e2p, $this->style[
'arrow-color'], $tmain, _($tr[
"t"]));
308 $this->memoTr[$e1][$e2p] =
true;
313 $this->lines[] =
'#M2';
314 $this->lines[] = sprintf(
'"%s" -> "%s" [labelfontcolor="%s",decorate=false, color="%s", labelfontname=sans, label="%s"];', $e2, $mi, $this->style[
'arrow-label-font-color'], $this->style[
'arrow-color'], _($tr[
"t"]));
317 $e2 = $this->setTransitionMail($e2, $tr, $index);
318 $e2 = $this->setStateMail($e2, $tr, $index);
319 $e2 = $this->setTransitionTimer($e2, $tr, $index);
320 $e2 = $this->setStateTimer($e2, $tr, $index);
323 $this->lines[] =
'#M3';
324 $this->lines[] = sprintf(
'"%s" -> "%s" [labelfontcolor="%s",decorate=false, color="%s", labelfontname=sans, label="%s"];', $e2, $mi, $this->style[
'arrow-label-font-color'], $this->style[
'arrow-color'], _($tr[
"t"]));
327 $this->lines[] = sprintf(
'# end complete %d %s %s->%s', $index, $tr[
"t"], $tr[
"e1"], $tr[
"e2"]);
332 private function setEndPoint()
336 foreach ($this->wdoc->cycle as $k => $t) {
340 $end = array_unique($end);
342 $endState = array_diff(($end) , (
$start));
346 foreach ($endState as $e) {
347 foreach ($this->wdoc->cycle as $k => $t) {
348 if ($t[
"e2"] == $e && (empty($see[$e])) && (empty($see[$t[
"t"] . $t[
"e2"]]))) {
349 $end =
'E' . $e . $k;
350 $this->lines[] =
'"' . $end .
'" [shape = square,style=filled, width=0.3,label="", fixedsize=true,fontname=sans,color="' . $this->style[
'end-color'] .
'"];';
352 $see[$t[
"t"] . $t[
"e2"]] =
true;
355 $this->setAttachStart($t[
"e2"], $end, $k);
359 if (count($ends) > 0) {
367 private function drawCluster()
369 foreach ($this->clusters as $kc => $aCluster) {
370 $sCluster = sprintf(
'subgraph cluster_%d {
371 style="rounded"; %s label="%s"', $kc, $this->clusterProps[$kc], $kc);
372 $sCluster.=
'"' . implode(
'";"', $aCluster) .
'"';
374 $this->lines[] = $sCluster;
380 private function setStartPoint()
383 $aid = strtolower($this->wdoc->attrPrefix .
"_TMID" . $this->wdoc->firstState);
384 $tm = $this->wdoc->getMultipleRawValues($aid);
385 $aid = strtolower($this->wdoc->attrPrefix .
"_MTID" . $this->wdoc->firstState);
386 $mt = $this->wdoc->getMultipleRawValues($aid);
389 $this->lines[] =
'"' . $e1 .
'" [shape = point,style=filled, width=0.3, fixedsize=true,fontname=sans,color="' . $this->style[
'start-color'] .
'"];';;
391 if (count($tm) == 0 && count($mt) == 0) {
392 $e2 = $this->getActivityId($this->wdoc->firstState);
393 $this->lines[] = sprintf(
'"%s" -> "%s" [labelfontcolor="%s",decorate=false, color="%s", labelfontname=sans];', $e1, $e2, $this->style[
'arrow-label-font-color'], $this->style[
'arrow-color']);
396 $e2 =
'D' . $this->wdoc->firstState;
397 $this->lines[] = sprintf(
'"%s" [label="%s",shape = doublecircle, style=filled, width=1.0, fixedsize=true,fontname=sans,fillcolor="%s"];', $e2, $this->
_n($this->wdoc->firstState) , $this->wdoc->getColor($this->wdoc->firstState));
398 $this->lines[] = sprintf(
'"%s" -> "%s" [labelfontcolor="%s",decorate=false, color="%s", labelfontname=sans];', $e1, $e2, $this->style[
'arrow-label-font-color'], $this->style[
'arrow-color']);
401 if (count($tm) > 0) {
404 $tmlabel = $this->quoteLabel($this->wdoc->getHtmlValue($this->wdoc->getAttribute($this->wdoc->attrPrefix .
"_TMID" . $this->wdoc->firstState) , $this->wdoc->arrayToRawValue($tm) ,
'_self',
false));
406 $this->lines[] =
'"' . str_replace(
" ",
"\\n", $e2) .
'" [ label="' . $tmlabel .
'",fixedsize=false,style=bold,shape=octagon,color="' . $this->style[
'timer-color'] .
'", fontsize=' . $this->conditionfontsize . $timgt .
' ];';
407 $this->lines[] = sprintf(
'"%s" -> "%s" [labelfontcolor="%s",decorate=false, color="%s", labelfontname=sans];', $e1, $e2, $this->style[
'arrow-label-font-color'], $this->style[
'arrow-color']);
410 if (count($mt) > 0) {
412 $tmlabel = $this->quoteLabel($this->wdoc->getHtmlValue($this->wdoc->getAttribute($this->wdoc->attrPrefix .
"_MTID" . $this->wdoc->firstState) , $this->wdoc->arrayToRawValue($mt) ,
'_self',
false));
414 $this->lines[] =
'"' . $e2 .
'" [ label="' . $tmlabel .
'",fixedsize=false,style=bold,shape=house,color="' . $this->style[
'mail-color'] .
'", fontsize=' . $this->conditionfontsize . $timgt .
' ];';
415 $this->lines[] = sprintf(
'"%s" -> "%s" [labelfontcolor="%s",decorate=false, color="%s", labelfontname=sans];', $e1, $e2, $this->style[
'arrow-label-font-color'], $this->style[
'arrow-color']);
421 $e2 = $this->getActivityId($this->wdoc->firstState);
422 $this->lines[] = sprintf(
'"%s" -> "%s" [labelfontcolor="%s",decorate=false, color="%s", labelfontname=sans];', $e1, $e2, $this->style[
'arrow-label-font-color'], $this->style[
'arrow-color']);
427 private function quoteLabel(
$s)
429 return str_replace(array(
448 private function setTransitionMail($e2, $t, $index)
451 $tm = $this->wdoc->getStateMailTemplate($t[
"t"]);
452 if ($tm) $ttrans[] = $tm;
453 $mtrans = $this->wdoc->getTransitionMailTemplates($t[
"t"]);
455 if (count($mtrans) > 0) {
459 $tmlabel = $this->quoteLabel($this->wdoc->getHtmlValue($this->wdoc->getAttribute($this->wdoc->attrPrefix .
"_TRANS_MTID" . $t[
"t"]) , $this->wdoc->arrayToRawValue($mtrans) ,
'_self',
false));
462 $this->lines[] =
'"' . $ex .
'" [ label="' . $tmlabel .
'",fixedsize=false, tooltip="mail",style=bold,shape=house,color="' . $this->style[
'mail-color'] .
'"' . $timgt .
' ];';
463 $this->lines[] = sprintf(
'"%s" -> "%s" [labelfontcolor="%s",decorate=false,color="%s",labelfontname=sans];', $e2, $ex, $this->style[
'arrow-label-font-color'], $this->style[
'arrow-color']);
464 $this->clusters[$index][] = $ex;
477 private function setStateMail($e2, $t, $index)
479 $mt = $this->wdoc->getStateMailTemplate($t[
"e2"]);
480 if (count($mt) > 0) {
481 $ex =
'mtf' . $index;
483 $tmlabel = $this->quoteLabel($this->wdoc->getHtmlValue($this->wdoc->getAttribute($this->wdoc->attrPrefix .
"_MTID" . $t[
"e2"]) , $this->wdoc->arrayToRawValue($mt) ,
'_self',
false));
485 $this->lines[] =
'"' . $ex .
'" [ label="' . $tmlabel .
'",fixedsize=false,tooltip="mail",style=bold,shape=house,color="' . $this->style[
'mail-color'] .
'"' . $timgt .
' ];';
486 $this->lines[] = sprintf(
'"%s" -> "%s" [labelfontcolor="%s",decorate=false, color="%s", labelfontname=sans];', $e2, $ex, $this->style[
'arrow-label-font-color'], $this->style[
'arrow-color']);
488 $this->clusters[$index][] = $ex;
501 private function setStateTimer($e2, $t, $index)
503 $aid = strtolower($this->wdoc->attrPrefix .
"_TMID" . $t[
"e2"]);
504 $mt = $this->wdoc->getMultipleRawValues($aid);
505 if (count($mt) > 0) {
506 $ex =
'tmf' . $index;
508 $tmlabel = $this->quoteLabel($this->wdoc->getHtmlValue($this->wdoc->getAttribute($this->wdoc->attrPrefix .
"_TMID" . $t[
"e2"]) , $this->wdoc->arrayToRawValue($mt) ,
'_self',
false));
510 $this->lines[] =
'"' . $ex .
'" [ label="' . $tmlabel .
'",fixedsize=false,tooltip="timer",style=bold,shape=octagon,color="' . $this->style[
'mail-color'] .
'"' . $timgt .
' ];';
511 $this->lines[] = sprintf(
'"%s" -> "%s" [labelfontcolor="%s",decorate=false, color="%s", labelfontname=sans];', $e2, $ex, $this->style[
'arrow-label-font-color'], $this->style[
'arrow-color']);
512 $this->clusters[$index][] = $ex;
525 private function setTransitionTimer($e2, $t, $index)
528 $tm = $this->wdoc->getRawValue($this->wdoc->attrPrefix .
"_TRANS_TMID" . $t[
"t"]);
529 if ($tm) $ttrans[] = $tm;
530 $ttrans = array_merge($ttrans, $this->wdoc->getMultipleRawValues($this->wdoc->attrPrefix .
"_TRANS_PA_TMID" . $t[
"t"]));
532 if (count($ttrans) > 0) {
534 $tmlabel = $this->quoteLabel($this->wdoc->getHtmlValue($this->wdoc->getAttribute($this->wdoc->attrPrefix .
"_TRANS_MTID" . $t[
"t"]) , $this->wdoc->arrayToRawValue($ttrans) ,
'_self',
false));
536 $this->lines[] =
'"' . $ex .
'" [ label="' . $tmlabel .
'",fixedsize=false,style=bold,tooltip="timer",shape=octagon,color="' . $this->style[
'timer-color'] .
'"' . $timgt .
' ];';
537 $this->lines[] = sprintf(
'"%s" -> "%s" [labelfontcolor="%s",decorate=false, color="%s",labelfontname=sans];', $e2, $ex, $this->style[
'arrow-label-font-color'], $this->style[
'arrow-color']);
538 $this->clusters[$index][] = $ex;
545 private function setSimpleTransitionLine($index, $tr)
547 $this->lines[] = sprintf(
'# simple %d %s %s->%s', $index, $tr[
"t"], $tr[
"e1"], $tr[
"e2"]);
552 if (isset($this->wdoc->autonext[$tr[
"e1"]]) && ($this->wdoc->autonext[$tr[
"e1"]] == $tr[
"e2"])) {
553 $tmain = sprintf(
'color="%s",style="setlinewidth(3)",arrowsize=1.0', $this->style[
'autonext-color']);
555 $this->lines[] = sprintf(
'"%s" -> "%s" [labelfontsize=6,color="%s" %s,labelfontname=sans, label="%s"];', $e1, $e2, $this->style[
'arrow-color'], $tmain, _($tr[
"t"]));
558 private function getActivityLabel($e)
560 $act = $this->wdoc->getActivity($e);
562 $act = sprintf(_(
"activity for %s") , _($e));
564 return str_replace(
'_',
' ', $act);
567 private function setActivityTransitionLine($index, $tr)
569 $this->lines[] = sprintf(
'# activity %d %s %s->%s', $index, $tr[
"t"], $tr[
"e1"], $tr[
"e2"]);
573 $act = $this->getActivityId($e1);
575 if (isset($this->wdoc->autonext[$tr[
"e1"]]) && ($this->wdoc->autonext[$e1] == $e2)) {
576 $tmain = sprintf(
'color="%s",style="setlinewidth(3)",arrowsize=1.0', $this->style[
'autonext-color']);
579 if (empty($this->memoTr[$e1][$act])) {
580 $this->lines[] = sprintf(
'"%s" -> "%s" [labelfontcolor="%s",decorate=false, color="%s", labelfontname=sans, label="%s"];', $e1, $act, $this->style[
'arrow-label-font-color'], $this->style[
'arrow-color'],
"");
582 $this->memoTr[$e1][$act] =
true;
587 if (empty($this->memoTr[$e1][$e2])) {
588 $this->lines[] = sprintf(
'"%s" -> "%s" [labelfontsize=6,color="%s" %s,labelfontname=sans, label="%s"];', $e1, $e2, $this->style[
'arrow-color'], $tmain, _($tr[
"t"]));
589 $this->memoTr[$e1][$e2] =
true;
593 private function setStates()
595 $states = $this->wdoc->getStates();
596 foreach ($states as $k => $v) {
597 $color = $this->wdoc->getColor($v);
598 $saction = $this->getActivityLabel($v);
599 $tt = sprintf(
'label="%s"', $this->
_n($v));
600 $tt.=
',shape = circle, style=filled, fixedsize=true,width=1.0, fontname=sans';
601 if ($saction) $tt.=
', tooltip="' . $v .
'"';
603 if ($color) $tt.=
',fillcolor="' . $color .
'"';
605 $this->lines[] =
'"' . $v .
'" [' . $tt .
'];';
609 private function setActivities()
611 $states = $this->wdoc->getStates();
612 foreach ($states as $k => $v) {
613 $color = $this->wdoc->getColor($v);
614 $activity = $this->wdoc->getActivity($v);
623 $tt = sprintf(
'label="%s"', $this->
_n($activity));
624 $tt.=
',shape = ' . $shape .
', style=filled, fixedsize=false,width=1.0, fontname=sans';
625 if ($v) $tt.=
', tooltip="' . $v .
'"';
627 if ($color) $tt.=
',fillcolor="' . $color .
'"';
629 $this->lines[] =
'"' . $v .
'" [' . $tt .
'];';
632 private function setActivity()
634 $states = $this->wdoc->getStates();
635 foreach ($states as $k => $v) {
636 $color = $this->wdoc->getColor($v);
637 $sact = $this->getActivityLabel($v);
642 if ($this->wdoc->getActivity($v) || (!$this->isEndState($v))) {
643 $tt =
'shape = box, style=filled, fixedsize=false,width=1.0, fontname=sans';
644 if ($sact) $tt.= sprintf(
',label="%s"', $this->
_n($sact));
646 if ($color) $tt.=
',fillcolor="' . $color .
'"';
648 $this->lines[] =
'"' . $this->getActivityId($v) .
'" [' . $tt .
'];';
653 private function getActivityId($state)
655 return "act_" . $state;
658 private function isEndState($e)
660 foreach ($this->wdoc->cycle as $t) {
661 if ($t[
"e1"] == $e)
return false;
666 private function setM0M3($tr, $k)
669 $tt = sprintf(
'fixedsize=false,fontsize="%s"', $this->conditionfontsize);
670 if (!empty($tr[
"m0"])) {
672 $this->lines[] = sprintf(
'"%s" [%s,label="%s", shape=Mdiamond,tooltip="m0",color="%s"];', $mi, $tt, $this->
_n($tr[
"m0"]) , $this->style[
'condition-color0']);
674 $this->clusters[$k][] = $mi;
676 if (!empty($tr[
"m1"])) {
678 $this->lines[] = sprintf(
'"%s" [%s,label="%s", tooltip="m1",shape=diamond,color="%s"];', $mi, $tt, $this->
_n($tr[
"m1"]) , $this->style[
'condition-color1']);
679 $this->clusters[$k][] = $mi;
681 if (!empty($tr[
"m2"])) {
683 $this->lines[] = sprintf(
'"%s" [%s,label="%s",tooltip="m2",shape=box,color="%s"];', $mi, $tt, $this->
_n($tr[
"m2"]) , $this->style[
'action-color2']);
684 $this->clusters[$k][] = $mi;
686 if (!empty($tr[
"m3"])) {
688 $this->lines[] = sprintf(
'"%s" [%s,label="%s",tooltip="m3",shape=box,color="%s"];', $mi, $tt, $this->
_n($tr[
"m3"]) , $this->style[
'action-color3']);
689 $this->clusters[$k][] = $mi;
691 if (!empty($tr[
"ask"]) && count($tr[
"ask"]) > 0) {
694 foreach ($tr[
"ask"] as $aAsk) {
695 $oa = $this->wdoc->getAttribute($aAsk);
696 if ($oa) $askLabel[] = $oa->getLabel();
698 $this->lines[] = sprintf(
'"%s" [%s,label="%s", style="rounded",tooltip="ask",shape=egg,color="%s", image="%s"];', $mi, $tt, implode(
'\\n', $askLabel) , $this->style[
'ask-color'],
DEFAULT_PUBDIR .
'/Images/wask.png');
699 $this->clusters[$k][] = $mi;
705 if (
$s)
return str_replace(array(
724 $this->ratio = $ratio;
734 $this->orient = $orient;
739 $this->fontsize = 13;
740 if (
$isize ==
"auto") $this->size =
"";
743 $this->fontsize = 20;
744 $this->size =
"size=\"7.6,11!\";";
747 if (preg_match(
"/([0-9\.]+),([0-9\.]+)/",
$isize, $reg)) {
748 $this->fontsize = intval(min($reg[1], $reg[2]) / 1);
749 $this->fontsize = 12;
750 $this->size = sprintf(
"size=\"%.2f,%.2f!\";", floatval($reg[1]) / 2.55, floatval($reg[2]) / 2.55);
753 $this->size =
"size=\"$isize,$isize!\";";
758 $this->statefontsize = $this->fontsize;
759 $this->conditionfontsize = intval($this->fontsize * 10 / 13);
760 $this->labelfontsize = intval($this->fontsize * 11 / 13);
768 print "Database not found : appl->dbaccess";
773 $usage->setDefinitionText(
"Create graph image for workflow");
774 $docid =
$usage->addRequiredParameter(
"docid",
"workflow identificator");
775 $orient =
$usage->addOptionalParameter(
"orient",
"orientation", array(
782 $ratio =
$usage->addOptionalParameter(
"ratio",
"ratio", array(
788 $isize =
$usage->addOptionalParameter(
"size",
"image size", array() ,
"10");
790 $type =
$usage->addOptionalParameter(
"type",
"type of output", array(
804 $dw->setOrient($orient);
805 $dw->setRatio($ratio);
Exception class use exceptionCode to identifiy correctly exception.
if($app->id > 0) return false
setCompleteTransitionLine($index, $tr)
Verify arguments for wsh programs.