first commit from pmos9a

1.)methods/bpmn
2.)templates/bpmn
This commit is contained in:
safan
2010-12-06 06:10:31 +00:00
parent 5715059f24
commit 490ffa1f68
83 changed files with 18770 additions and 0 deletions

View File

@@ -0,0 +1,301 @@
<?php
/**
* cases_Scheduler_Save.php
*
* ProcessMaker Open Source Edition
* Copyright (C) 2004 - 2010 Colosa Inc.23
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*
*/
try {
/*
global $RBAC;
switch ($RBAC->userCanAccess('PM_FACTORY'))
{
case -2:
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels');
G::header('location: ../login/login');
die;
break;
case -1:
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels');
G::header('location: ../login/login');
die;
break;
}
*/
require_once 'classes/model/CaseScheduler.php';
$oCaseScheduler = new CaseScheduler();
if (empty($_POST)) {
die('The information sended is empty!');
}
if(empty($_POST['SCH_UID']))
$aData['SCH_UID'] = G::generateUniqueID();
else
$aData['SCH_UID'] = $_POST['SCH_UID'];
$aData['SCH_NAME'] = $_POST['SCH_NAME'];
$aData['SCH_DEL_USER_NAME'] = $_POST['SCH_DEL_USER_NAME'];
$aData['SCH_DEL_USER_PASS'] = md5($_POST['SCH_USER_PASSWORD']);
$aData['SCH_DEL_USER_UID'] = $_POST['SCH_DEL_USER_UID'];
$aData['PRO_UID'] = $_POST['PRO_UID'];
$aData['TAS_UID'] = $_POST['TAS_UID'];
$aData['SCH_STATE'] = 'ACTIVE';
$aData['SCH_LAST_STATE'] = 'CREATED'; // 'ACTIVE';
$aData['USR_UID'] = $_SESSION['USER_LOGGED'];
$sOption = $_POST['SCH_OPTION'];
if($sOption == 'Daily')
{
$aData['SCH_OPTION'] = '1';
$sOption = '1';
}
else if($sOption == 'Weekly')
{
$aData['SCH_OPTION'] = '2';
$sOption = '2';
}
else if($sOption == 'Monthly')
{
$aData['SCH_OPTION'] = '3';
$sOption = '3';
}
else if($sOption == 'One time only')
{
$aData['SCH_OPTION'] = '4';
$sOption = '4';
}
if ($_POST['SCH_START_DATE']!=''){
$sDateTmp = $_POST['SCH_START_DATE'];
} else {
$sDateTmp = date('Y-m-d');
}
$sTimeTmp = $_POST['SCH_START_TIME'];
$aData['SCH_START_TIME'] = date('Y-m-d', strtotime($sDateTmp)) . ' ' . date('H:i:s', strtotime($sTimeTmp));
$aData['SCH_START_DATE'] = date('Y-m-d', strtotime($sDateTmp)) . ' ' . date('H:i:s', strtotime($sTimeTmp));
$nActualTime = $_POST['SCH_START_TIME']; // time();
// $nActualDate = date("Y-m-d H:i:s", $nActualTime);
$sValue = '';
$sDaysPerformTask = '';
$sWeeks = '';
$sMonths = '';
$sMonths = '';
$sStartDay = '';
$nSW = 0;
switch($sOption){
case '1' : // Option 1
$sValue = $_POST['SCH_DAYS_PERFORM_TASK'];
switch($sValue){
case '1' : $aData['SCH_DAYS_PERFORM_TASK'] = $_POST['SCH_DAYS_PERFORM_TASK'] . '|1';
break;
case '2' :
$aData['SCH_OPTION'] = '2';
$aData['SCH_EVERY_DAYS'] = '1';
$aData['SCH_WEEK_DAYS'] = '1|2|3|4|5|';
break;
case '3' : // Every [n] Days
$sDaysPerformTask = $_POST['SCH_DAYS_PERFORM_TASK_OPT_3'];
$aData['SCH_DAYS_PERFORM_TASK'] = $_POST['SCH_DAYS_PERFORM_TASK'] . '|' . $_POST['SCH_DAYS_PERFORM_TASK_OPT_3'];
break;
}
break;
case '2' : // If the option is zero, set by default 1
if(empty($_POST['SCH_EVERY_DAYS']))
$nEveryDays = 1;
else
$nEveryDays = $_POST['SCH_EVERY_DAYS'];
$aData['SCH_EVERY_DAYS'] = $nEveryDays;
$sWeeks = '';
if(!empty($_POST['SCH_WEEK_DAYS'])){
$aWeekDays = explode(',',$_POST['SCH_WEEK_DAYS']);
foreach($aWeekDays as $value) {
$sWeeks = $sWeeks . $value . '|';
}
}
/*if(!empty($_POST['SCH_WEEK_DAYS_2'])){
$aWeekDays2 = $_POST['SCH_WEEK_DAYS_2'];
foreach($aWeekDays2 as $value) {
$sWeeks = $sWeeks . $value . '|';
}
}*/
$sStartTime = $_POST['SCH_START_TIME'];
$aData['SCH_WEEK_DAYS'] = $sWeeks;
break;
case '3' :
$nStartDay = $_POST['SCH_START_DAY'];
if($nStartDay == 'Day of Month')
$nStartDay = 1;
else if($nStartDay == 'The Day')
$nStartDay = 2;
$sStartDayOpt2Week = $_POST['SCH_START_DAY_OPT_2_WEEKS'];
switch($sStartDayOpt2Week){
case 'First':
$sStartDayOpt2Week = 1;
break;
case 'Second':
$sStartDayOpt2Week = 2;
break;
case 'Third':
$sStartDayOpt2Week = 3;
break;
case 'Fourth':
$sStartDayOpt2Week = 4;
break;
case 'Last':
$sStartDayOpt2Week = 5;
break;
}
$sStartDayOpt2DayWeek = $_POST['SCH_START_DAY_OPT_2_DAYS_WEEK'];
switch($sStartDayOpt2DayWeek){
case 'Monday':
$sStartDayOpt2DayWeek = 1;
break;
case 'Tuesday':
$sStartDayOpt2DayWeek = 2;
break;
case 'Wednesday':
$sStartDayOpt2DayWeek = 3;
break;
case 'Thursday':
$sStartDayOpt2DayWeek = 4;
break;
case 'Friday':
$sStartDayOpt2DayWeek = 5;
break;
case 'Saturday':
$sStartDayOpt2DayWeek = 6;
break;
case 'Sunday':
$sStartDayOpt2DayWeek = 7;
break;
}
if($nStartDay == 1){
$aData['SCH_START_DAY'] = $nStartDay . '|' . $_POST['SCH_START_DAY_OPT_1'];
} else {
$aData['SCH_START_DAY'] = $nStartDay . '|' . $sStartDayOpt2Week . '|' . $sStartDayOpt2DayWeek;
}
$sMonths = '';
if(!empty($_POST['SCH_MONTHS'])){
//$aMonths = $_POST['SCH_MONTHS'];
$aMonths = explode(',',$_POST['SCH_MONTHS']);
foreach($aMonths as $value) {
$sMonths = $sMonths . $value . '|' ;
}
}
/*if(!empty($_POST['SCH_MONTHS_2'])){
$aMonths2 = $_POST['SCH_MONTHS_2'];
foreach($aMonths2 as $value) {
$sMonths = $sMonths . $value . '|' ;
}
}
if(!empty($_POST['SCH_MONTHS_3'])){
$aMonths3 = $_POST['SCH_MONTHS_3'];
foreach($aMonths3 as $value) {
$sMonths = $sMonths . $value . '|' ;
}
} */
$aData['SCH_MONTHS'] = $sMonths;
$sStartDay = $aData['SCH_START_DAY'];
$sValue = $nStartDay;
break;
}
if(($sOption!='1') && ($sOption!='4')) {
if ($sStartDay==''){
$sStartDay = date('Y-m-d');
}
// echo $sOption."*". $sValue."*". $nActualTime."*". $sDaysPerformTask."*". $sWeeks."*". $sStartDay ."*". $sMonths."<br>";
$dCurrentDay = date("d");
$dCurrentMonth = date("m");
$aStartDay = explode( "|" , $aData['SCH_START_DAY'] );
if($sOption=='3'&&$aStartDay[0]=='1'){
$monthsArray = explode("|",$sMonths);
foreach ($monthsArray as $row){
if ( $dCurrentMonth == $row && $dCurrentDay<$aStartDay[1] ){
$startTime = $_POST['SCH_START_TIME'].":00";
$aData['SCH_TIME_NEXT_RUN'] = date('Y') . '-' . $row . '-' . $aStartDay[1] . ' ' . $startTime;
break;
} else {
$aData['SCH_TIME_NEXT_RUN'] = $oCaseScheduler->updateNextRun($sOption, $sValue, $nActualTime, $sDaysPerformTask, $sWeeks, $sStartDay, $sMonths, $sDateTmp);
}
}
} else {
$aData['SCH_TIME_NEXT_RUN'] = $oCaseScheduler->updateNextRun($sOption, $sValue, $nActualTime, $sDaysPerformTask, $sWeeks, $sStartDay, $sMonths, $sDateTmp);
}
// print_r ($aData['SCH_TIME_NEXT_RUN']);
// die;
} else {
if ($sOption=='4'){
$aData['SCH_END_DATE'] = $aData['SCH_START_TIME'];
}
$aData['SCH_TIME_NEXT_RUN'] = $aData['SCH_START_TIME'];
}
if(trim($_POST['SCH_END_DATE'])!=''){
$aData['SCH_END_DATE'] = $_POST['SCH_END_DATE'];
}
if(!empty($_POST['SCH_REPEAT_TASK_CHK'])){
$nOptEvery = $_POST['SCH_REPEAT_EVERY_OPT'];
if($nOptEvery ==2)
$aData['SCH_REPEAT_EVERY'] = $_POST['SCH_REPEAT_EVERY'] * 60;
else
$aData['SCH_REPEAT_EVERY'] = $_POST['SCH_REPEAT_EVERY'];
}
//$aData['SCH_END_DATE'] = "2020-12-30";
if(empty($_POST['SCH_UID']))
$oCaseScheduler->create($aData);
else
$oCaseScheduler->update($aData);
//Save Scheduler_uid in the Event Table for Start Timer.
$oData['EVN_UID']= $_POST['EVN_UID'];
$oData['EVN_ACTION']= $aData['SCH_UID'];
require_once "classes/model/Event.php";
$oEvent = new Event();
$oEvent->update($oData);
echo "{success: true}";
//G::header('location: cases_Scheduler_List');
}
catch (Exception $oException) {
die($oException->getMessage());
}
?>

View File

@@ -0,0 +1,249 @@
<?php
/**
* events_EditAction.php
*
* ProcessMaker Open Source Edition
* Copyright (C) 2004 - 2008 Colosa Inc.23
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*
*/
global $RBAC;
global $_DBArray;
if ($RBAC->userCanAccess('PM_SETUP') != 1) {
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels');
G::header('location: ../login/login');
die;
}
if ( isset ($_SESSION['EVN_UID']) ) {
$evnUid = $_SESSION['EVN_UID'];
unset ( $_SESSION['EVN_UID'] );
}
else
$evnUid = $_GET['EVN_UID'];
require_once 'classes/model/Event.php';
require_once 'classes/model/Triggers.php';
$oEvent = new Event();
$oTrigger = new Triggers();
$aFields = $oEvent->load( $evnUid );
$parameters = unserialize ( $oEvent->getEvnActionParameters() );
//g::pr($parameters); die;
$aTrigger = $oTrigger->load($aFields['TRI_UID']);
$hash = md5 ( $oTrigger->getTriWebbot() );
//var_dump($hash,$parameters->hash);die;
//if the hash is different, the script was edited , so we will show the trigger editor.
if ( ( isset($parameters->hash) && $hash <> $parameters->hash ) || $aFields['EVN_ACTION'] == 'EXECUTE_TRIGGER' || $aFields['EVN_ACTION'] == 'EXECUTE_CONDITIONAL_TRIGGER' ) {
$oTriggerParams = unserialize($aTrigger['TRI_PARAM']);
// check again a hash, this time to check the trigger itself integrity
if ($oTriggerParams['hash']!=$hash){
// if has changed edit manually
G::LoadClass('xmlfield_InputPM');
$G_PUBLISH = new Publisher();
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'triggers/triggersNarrowEdit', '', $aTrigger, '../events/triggersSave');
G::RenderPage('publish', 'raw');
die;
} else {
// if not launch the wizard view.
$triUid = $aFields['TRI_UID'];
$_GET = $oTriggerParams['params'];
$_GET['TRI_UID'] = $triUid;
require_once(PATH_METHODS.'triggers/triggers_EditWizard.php');
die;
}
}
$aFields['EVN_MESSAGE_SUBJECT'] = (isset($parameters->SUBJECT) ? $parameters->SUBJECT : '');
if(isset($parameters->TO)){
$paramTO[] = Array('id'=>'char', 'name'=>'char');
//echo '<pre>';print_r($parameters->TO);
foreach($parameters->TO as $item){
$row = explode('|', $item);
switch($row[0]){
case 'usr':
require_once('classes/model/Users.php');
$user = new Users();
if($row[1] == '-1'){
$value = '(Current Task User)';
} else {
$rec = $user->load($row[1]);
$value = $rec['USR_FIRSTNAME'].' '.$rec['USR_LASTNAME'];
}
break;
case 'grp':
G::LoadClass('groups');
$group = new Groups();
$rec = $group->load($row[1]);
$value = strip_tags($rec->getGrpTitle());
break;
case 'ext':
$value = htmlentities($row[1]);
break;
case 'dyn':
$value = htmlentities('@#'.$row[1]);
break;
default:
echo '->'.$row[0];
}
$paramTO[] = Array('id'=>replaceQuotes($item), 'name'=>$value);
}
} else {
$paramTO[] = Array('id'=>'char', 'name'=>'char');
$paramTO[] = Array('id'=>'usr|-1', 'name'=>'(Current Task User)');
}
$_DBArray['eventomsgto'] = $paramTO;
if(isset($parameters->CC)){
$paramCC[] = Array('id'=>'char', 'name'=>'char');
foreach($parameters->CC as $item){
$row = explode('|', $item);
switch($row[0]){
case 'usr':
require_once('classes/model/Users.php');
$user = new Users();
if($row[1] == '-1'){
$value = '(Current Task User)';
} else {
$rec = $user->load($row[1]);
$value = $rec['USR_FIRSTNAME'].' '.$rec['USR_LASTNAME'];
}
break;
case 'grp':
G::LoadClass('groups');
$group = new Groups();
$rec = $group->load($row[1]);
$value = strip_tags($rec->getGrpTitle());
break;
case 'ext':
$value = htmlentities($row[1]);
break;
case 'dyn':
$value = htmlentities('@#'.$row[1]);
break;
}
$paramCC[] = Array('id'=>replaceQuotes($item), 'name'=>$value);
}
$_DBArray['eventomsgcc'] = $paramCC;
} else {
$_DBArray['eventomsgcc'] = Array();
}
if(isset($parameters->BCC)){
$paramBCC[] = Array('id'=>'char', 'name'=>'char');
foreach($parameters->BCC as $item){
$row = explode('|', $item);
switch($row[0]){
case 'usr':
require_once('classes/model/Users.php');
$user = new Users();
if($row[1] == '-1'){
$value = '(Current Task User)';
} else {
$rec = $user->load($row[1]);
$value = $rec['USR_FIRSTNAME'].' '.$rec['USR_LASTNAME'];
}
break;
case 'grp':
G::LoadClass('groups');
$group = new Groups();
$rec = $group->load($row[1]);
$value = strip_tags($rec->getGrpTitle());
break;
case 'ext':
$value = htmlentities($row[1]);
break;
case 'dyn':
$value = htmlentities('@#'.$row[1]);
break;
}
$paramBCC[] = Array('id'=>replaceQuotes($item), 'name'=>$value);
}
$_DBArray['eventomsgbcc'] = $paramBCC;
} else {
$_DBArray['eventomsgbcc'] = Array();
}
$aFields['EVN_MESSAGE_TO_TO'] = $paramTO;
$aFields['EVN_MESSAGE_TO_CC'] = (isset($parameters->CC) ? $paramCC : '');
$aFields['EVN_MESSAGE_TO_BCC'] = (isset($parameters->BCC) ? $paramBCC : '');
$aFields['EVN_MESSAGE_TEMPLATE'] = (isset($parameters->TEMPLATE) ? $parameters->TEMPLATE : '');
$aTemplates = array();
$aTemplates[] = array('TEMPLATE1' => 'char',
'TEMPLATE2' => 'char');
$sDirectory = PATH_DATA_MAILTEMPLATES . $aFields['PRO_UID'] . PATH_SEP;
G::verifyPath($sDirectory, true);
if (!file_exists($sDirectory . 'alert_message.html')) {
@copy(PATH_TPL . 'mails' . PATH_SEP . 'alert_message.html', $sDirectory . 'alert_message.html');
}
$oDirectory = dir($sDirectory);
while ($sObject = $oDirectory->read()) {
if (($sObject !== '.') && ($sObject !== '..') && ($sObject !== 'alert_message.html')) {
$aTemplates[] = array('TEMPLATE1' => $sObject,
'TEMPLATE2' => $sObject);
}
}
$_DBArray['templates'] = $aTemplates;
$aTriggers[] = array('TRI_UID' => 'char',
'TRI_TITLE' => 'char');
G::LoadClass('processMap');
$oProcessMap = new ProcessMap();
$oDataset = TriggersPeer::doSelectRS($oProcessMap->getTriggersCriteria($aFields['PRO_UID']));
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$oDataset->next();
while ($aRow = $oDataset->getRow()) {
$aTriggers[] = array('TRI_UID' => $aRow['TRI_UID'],
'TRI_TITLE' => $aRow['TRI_TITLE']);
$oDataset->next();
}
$_DBArray['triggers'] = $aTriggers;
$_SESSION['_DBArray'] = $_DBArray;
$G_PUBLISH = new Publisher();
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'events/eventsEditAction', '', $aFields, '../events/eventsSave');
//$G_PUBLISH->AddContent('xmlform', 'xmlform', 'events/eventsEditAction', '', $aFields, '../events/eventsSave');
G::RenderPage('publish', 'raw');
function replaceQuotes($aData){
return str_replace('"', '&quote;', $aData);
}

View File

@@ -0,0 +1,56 @@
<?php
/**
* cases_Events_Save.php
*
* ProcessMaker Open Source Edition
* Copyright (C) 2004 - 2010 Colosa Inc.23
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*
*/
try {
$oJSON = new Services_JSON();
if ( isset ($_POST['sData']) ) {
$oData = $oJSON->decode($_POST['sData']);
}
//Convert Object into Array
foreach($oData as $key=>$value)
{
$aData[$key] = $value;
}
require_once 'classes/model/Event.php';
$oEvent = new Event();
if (!isset($aData['EVN_UID']) && $aData['EVN_UID'] == '' ) {
$sEventUid = $oEvent->create($aData);
}
else
$sEventUid = $oEvent->update($aData);
$_SESSION['EVN_UID'] = $sEventUid;
echo "{success: true,data:'.$sEventUid.'}";
//G::header('location: cases_Scheduler_List');
}
catch (Exception $oException) {
die($oException->getMessage());
}
?>

View File

@@ -0,0 +1,170 @@
<?php
try
{
G::LoadClass('processMap');
$oProcessMap = new processMap(new DBConnection);
if ( isset($_GET['tid'] ) )
{
$rows = $oProcessMap->getExtStepsCriteria($_GET['tid']); //Getting all assigned steps on a task
array_shift($rows);
}
}
catch ( Exception $e ) {
print json_encode ( $e->getMessage() );
}
$steps = array();
//@@stepsChildren is an array that stores before and after triggers tree data for a step
$stepsChildren = array();
$assignChildren = array();
//@@assignTaskChildren is an array that stores Before Assignment,Before Derivation and After Derivation triggers tree data for assigned task
$assignTaskChildren = array();
//Creating steps array for populating tree depending on count of assigned steps to a task
for($i=0;$i<count($rows);$i++)
{
//Getting beforeTriggersCount for a step
$beforeTriggers = $oProcessMap->getStepTriggersCriteria($rows[$i]['STEP_UID'], $_GET['tid'], 'BEFORE');
$beforeTriggersCount = StepTriggerPeer::doCount($beforeTriggers);
//Getting afterTriggersCount for a step
$afterTriggers = $oProcessMap->getStepTriggersCriteria($rows[$i]['STEP_UID'], $_GET['tid'], 'AFTER');
$afterTriggersCount = StepTriggerPeer::doCount($afterTriggers);
$iTotal = $beforeTriggersCount + $afterTriggersCount;
//Tree level 3 nodes i.e. final nodes (Leaf Nodes)
$beforeTriggerChildren[0] = array(
'text' => 'Assign / Show Before Triggers',
'id' => $rows[$i]['STEP_UID'].'|BEFORE',
'leaf' => true,
);
$afterTriggerChildren[0] = array(
'text' => 'Assign / Show After Triggers',
'id' => $rows[$i]['STEP_UID'].'|AFTER',
'leaf' => true,
);
//Tree level 2 nodes i.e. Before and After Triggers for level 1 nodes
$stepsChildren[0] = array(
'text' => 'Before - Triggers ('.$beforeTriggersCount.')',
//'id' => $rows[$i]['STEP_UID'].'-BEFORE',
'children' => $beforeTriggerChildren
);
$stepsChildren[1] = array(
'text' => 'After - Triggers ('.$afterTriggersCount.')',
//'id' => $rows[$i]['STEP_UID'].'-AFTER',
'children' => $afterTriggerChildren
);
//Tree level 1 nodes (Main steps)
$steps[] = array(
'text' => $rows[$i]['STEP_TITLE'].' - Triggers ('.$iTotal.')',
//'id' => 'ssaas',
'children' => $stepsChildren
);
}
//Creating tree for Assign Task Step
$beforeAssignmentChildren[] = array(
'text' => 'Assign / Show Triggers',
'id' => '-1|BEFORE',
'leaf' => true,
);
$beforeDerivationChildren[] = array(
'text' => 'Assign / Show Triggers',
'id' => '-2|BEFORE',
'leaf' => true,
);
$afterDerivationChildren[] = array(
'text' => 'Assign / Show Triggers',
'id' => '-2|AFTER',
'leaf' => true,
);
//Getting counts for Before Assignment,Before Derivation and After Derivation triggers for a step
$beforeAssignmentTriggers = $oProcessMap->getStepTriggersCriteria('-1', $_GET['tid'], 'BEFORE');
$beforeAssignmentTriggersCount = StepTriggerPeer::doCount($beforeAssignmentTriggers);
$beforeDerivationTriggers = $oProcessMap->getStepTriggersCriteria('-2', $_GET['tid'], 'BEFORE');
$beforeDerivationTriggersCount = StepTriggerPeer::doCount($beforeDerivationTriggers);
$afterDerivationTriggers = $oProcessMap->getStepTriggersCriteria('-2', $_GET['tid'], 'AFTER');
$afterDerivationTriggersCount = StepTriggerPeer::doCount($afterDerivationTriggers);
$iTotal = $beforeAssignmentTriggersCount + $beforeDerivationTriggersCount + $afterDerivationTriggersCount;
$assignTaskChildren[] = array(
'text' => 'Before Assignment - Triggers ('.$beforeAssignmentTriggersCount.')',
'children' => $beforeAssignmentChildren
);
$assignTaskChildren[] = array(
'text' => 'Before Derivation - Triggers ('.$beforeDerivationTriggersCount.')',
'children' => $beforeDerivationChildren
);
$assignTaskChildren[] = array(
'text' => 'After Derivation - Triggers ('.$afterDerivationTriggersCount.')',
'children' => $afterDerivationChildren
);
//Adding last value in an array for "Assign Task"
$steps[] = array(
'text' => '[ Assign Task ] - Triggers ('.$iTotal.')',
//'id' => $rows[$i]['STEP_UID'],
'children' => $assignTaskChildren
);
/* $nodes = "[{
text: 'Step 1 - Triggers (0)',
cls: 'blank',
iconCls: 'blank',
children: [{
text: 'Before - Triggers (0)',
cls: 'blank',
iconCls: 'blank',
children: [{
text: 'Assign Before Trigger',
leaf: true,
}]
},{
text: 'After - Triggers (0)',
leaf: true,
cls: 'blank',
iconCls: 'blank',
}]
},{
text: 'Step 2 - Triggers (0)',
children: [{
text: 'Before - Triggers (0)',
leaf: true,
},{
text: 'After - Triggers (0)',
leaf: true,
}]
},{
text: 'Assign Task - Triggers(0)',
children: [{
text: 'Before Assigment - Triggers(0)',
leaf: true,
},{
text: 'Before Derivation - Triggers(0)',
leaf: true,
},{
text: 'After Derivation - Triggers(0)',
leaf: true,
}]
}]";*/
//echo $nodes;
echo json_encode($steps);

View File

@@ -0,0 +1,108 @@
<?php
/**
* openProcess.php
*
* ProcessMaker Open Source Edition
* Copyright (C) 2004 - 2008 Colosa Inc.23
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*
*/
G::LoadClass('xpdl');
$processUID = $_REQUEST['PRO_UID'];
$oProcess = new Xpdl();
$fields = $oProcess->serializeProcess($processUID);
$oData = unserialize($fields);
$arrayTasks = array();
$countTasks = 0;
$countSubProcess= 0;
$arrayEvents = array();
$arraySubProcess= array();
$count = 0;
$countRoutes = 0;
$arrayRoutes = array();
$process = array();
$process = $oProcess->createProcessPM($oData->process);
foreach($oData->tasks as $id => $value)
{
if($value['TAS_TYPE'] == 'SUBPROCESS')
{
$arraySubProcess[$countSubProcess]['0'] = $value['TAS_UID'];
$arraySubProcess[$countSubProcess]['1'] = $value['TAS_TITLE'];
$arraySubProcess[$countSubProcess]['2'] = $value['TAS_POSX'];
$arraySubProcess[$countSubProcess]['3'] = $value['TAS_POSY'];
$countSubProcess = $countSubProcess + 1;
}
else
{
$arrayTasks[$countTasks]['0'] = $value['TAS_UID'];
$arrayTasks[$countTasks]['1'] = $value['TAS_TITLE'];
$arrayTasks[$countTasks]['2'] = $value['TAS_POSX'];
$arrayTasks[$countTasks]['3'] = $value['TAS_POSY'];
$arrayTasks[$countTasks]['4'] = $value['TAS_WIDTH'];
$arrayTasks[$countTasks]['5'] = $value['TAS_HEIGHT'];
$arrayTasks[$countTasks]['6'] = $value['TAS_BOUNDARY'];
if($value['TAS_START'] == 'TRUE'){
$arrayEvents[$count]['0'] = G::generateUniqueID();
if($value['TAS_EVN_UID'] == '')
{
$arrayEvents[$count]['1'] = 'bpmnEventEmptyStart';
}
else
{
foreach($oData->event as $eventid => $val){
if($val['EVN_UID'] == $value['TAS_EVN_UID'])
{
$arrayEvents[$count]['0'] = $val['EVN_UID'];
$arrayEvents[$count]['1'] = $val['EVN_TYPE'];
break;
}
}
}
$arrayEvents[$count]['2'] = $value['TAS_POSX']+68;
$arrayEvents[$count]['3'] = $value['TAS_POSY']-50;
$arrayRoutes[$countRoutes]['0']= G::generateUniqueID();
$arrayRoutes[$countRoutes]['1']= $arrayEvents[$count]['0'];
$arrayRoutes[$countRoutes]['2']= $value['TAS_UID'];
$arrayRoutes[$countRoutes]['3']= '1';
$arrayRoutes[$countRoutes]['4']= '2';
$count = $count+ 1;
$countRoutes = $countRoutes+ 1;
}
$countTasks = $countTasks + 1;
}
}
$lanes = $oProcess->createLanesNewPM($oData->lanes);
$fields = $oProcess->createTransitionsPM($oData->tasks,$oData->routes,$arrayEvents,$count,$arrayRoutes,$countRoutes);
//$subProcess = $oProcess->createSubProcessesPM($oData->subProcess);
$arrayEvents = $fields['EVENTS'];
$arrayGateways = $fields['GATEWAYS'];
$arrayRoutes = $fields['TRANSITION'];
$result['TASKS'] = $arrayTasks;
$result['ROUTES'] = $arrayRoutes;
$result['EVENTS'] = $arrayEvents;
$result['GATEWAYS'] = $arrayGateways;
$aTasks = json_encode($arrayTasks);
$aSubProcess = json_encode($arraySubProcess);
$aRoutes = json_encode($arrayRoutes);
$aEvents = json_encode($arrayEvents);
$aGateways = json_encode($arrayGateways);
$aProcess = json_encode($process);
$aLanes = json_encode($lanes);
echo "tasks:$aTasks|gateways:$aGateways|events:$aEvents|annotations:$aLanes|process:$aProcess|subprocess:$aSubProcess|routes:$aRoutes";
?>

View File

@@ -0,0 +1,182 @@
<?php
/**
* patterns_Ajax.php
*
* ProcessMaker Open Source Edition
* Copyright (C) 2004 - 2008 Colosa Inc.23
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*
*/
G::LoadInclude('ajax');
$oJSON = new Services_JSON();
if(isset($_POST['mode']) && $_POST['mode'] != '')
{
$aData = $_POST;
$aData['TASK'] = $oJSON->decode($_POST['TASK']);
$aData['ROU_NEXT_TASK'] = $oJSON->decode($_POST['ROU_NEXT_TASK']);
}
G::LoadClass('tasks');
$oTasks = new Tasks();
$rou_id = 0;
switch ($aData['action']) {
case 'savePattern':
//if ($aData['ROU_TYPE'] != $aData['ROU_TYPE_OLD'])
//{
foreach ($aData['TASK'] as $iKey => $aRow)
{
$oTasks->deleteAllRoutesOfTask($aData['PROCESS'], $aRow);
}
//}
require_once 'classes/model/Route.php';
$oRoute = new Route();
switch ($aData['ROU_TYPE']) {
case 'SEQUENTIAL':
case 'SEC-JOIN':
/*if ($aData['ROU_UID'] != '')
{
$aFields['ROU_UID'] = $aData['ROU_UID'];
}*/
$aFields['PRO_UID'] = $aData['PROCESS'];
$aFields['TAS_UID'] = $aData['TASK'][0];
$aFields['ROU_NEXT_TASK'] = $aData['ROU_NEXT_TASK'][0];
$aFields['ROU_TYPE'] = $aData['ROU_TYPE'];
if(isset($aData['ROU_EVN_UID']))
$aFields['ROU_EVN_UID'] = $aData['ROU_EVN_UID'];
if(isset($aData['PORT_NUMBER_IP']))
$aFields['ROU_TO_PORT'] = $aData['PORT_NUMBER_IP'];
if(isset($aData['PORT_NUMBER_OP']))
$aFields['ROU_FROM_PORT'] = $aData['PORT_NUMBER_OP'];
//$aFields['ROU_TO_LAST_USER'] = $aData['ROU_TO_LAST_USER'];
$rou_id = $oRoute->create($aFields);
break;
case 'SELECT':
foreach ($aData['GRID_SELECT_TYPE'] as $iKey => $aRow)
{
/*if ($aRow['ROU_UID'] != '')
{
$aFields['ROU_UID'] = $aRow['ROU_UID'];
}*/
$aFields['PRO_UID'] = $aData['PROCESS'];
$aFields['TAS_UID'] = $aData['TASK'];
$aFields['ROU_NEXT_TASK'] = $aRow;
$aFields['ROU_CASE'] = $iKey;
$aFields['ROU_TYPE'] = $aData['ROU_TYPE'];
if(isset($aData['PORT_NUMBER_IP']))
$aFields['ROU_TO_PORT'] = $aData['PORT_NUMBER_IP'];
if(isset($aData['PORT_NUMBER_OP']))
$aFields['ROU_FROM_PORT'] = $aData['PORT_NUMBER_OP'];
// $aFields['ROU_CONDITION'] = $aRow['ROU_CONDITION'];
//$aFields['ROU_TO_LAST_USER'] = $aRow['ROU_TO_LAST_USER'];
$rou_id = $oRoute->create($aFields);
unset($aFields);
}
break;
case 'EVALUATE':
foreach ($aData['ROU_NEXT_TASK'] as $iKey => $aRow)
{
$aFields['PRO_UID'] = $aData['PROCESS'];
$aFields['TAS_UID'] = $aData['TASK'];
$aFields['ROU_NEXT_TASK'] = $aRow;
$aFields['ROU_CASE'] = $iKey;
$aFields['ROU_TYPE'] = $aData['ROU_TYPE'];
$aFields['ROU_CONDITION'] = $aRow['ROU_CONDITION'];
if(isset($aData['PORT_NUMBER_IP']))
$aFields['ROU_TO_PORT'] = $aData['PORT_NUMBER_IP'];
if(isset($aData['PORT_NUMBER_OP']))
$aFields['ROU_FROM_PORT'] = $aData['PORT_NUMBER_OP'];
//$aFields['ROU_TO_LAST_USER'] = $aRow['ROU_TO_LAST_USER'];
$rou_id = $oRoute->create($aFields);
unset($aFields);
}
break;
case 'PARALLEL':
foreach ($aData['ROU_NEXT_TASK'] as $iKey => $aRow)
{
/*if ($aRow['ROU_UID'] != '')
{
$aFields['ROU_UID'] = $aRow['ROU_UID'];
}*/
$aFields['PRO_UID'] = $aData['PROCESS'];
$aFields['TAS_UID'] = $aData['TASK'][0];
$aFields['ROU_NEXT_TASK'] = $aRow;
$aFields['ROU_CASE'] = $iKey;
$aFields['ROU_TYPE'] = $aData['ROU_TYPE'];
if(isset($aData['PORT_NUMBER_IP']))
$aFields['ROU_TO_PORT'] = $aData['PORT_NUMBER_IP'];
if(isset($aData['PORT_NUMBER_OP']))
$aFields['ROU_FROM_PORT']= $aData['PORT_NUMBER_OP'];
$rou_id = $oRoute->create($aFields);
unset($aFields);
}
break;
case 'PARALLEL-BY-EVALUATION':
foreach ($aData['ROU_NEXT_TASK'] as $iKey => $aRow)
{
/*if ($aRow['ROU_UID'] != '')
{
$aFields['ROU_UID'] = $aRow['ROU_UID'];
}*/
$aFields['PRO_UID'] = $aData['PROCESS'];
$aFields['TAS_UID'] = $aData['TASK'][0];
$aFields['ROU_NEXT_TASK'] = $aRow;
$aFields['ROU_CASE'] = $iKey;
$aFields['ROU_TYPE'] = $aData['ROU_TYPE'];
if(isset($aData['PORT_NUMBER_IP']))
$aFields['ROU_TO_PORT'] = $aData['PORT_NUMBER_IP'];
if(isset($aData['PORT_NUMBER_OP']))
$aFields['ROU_FROM_PORT']= $aData['PORT_NUMBER_OP'];
// $aFields['ROU_CONDITION'] = $aRow['ROU_CONDITION'];
// $aFields['ROU_OPTIONAL'] = $aRow['ROU_OPTIONAL'];
$rou_id = $oRoute->create($aFields);
unset($aFields);
}
break;
case 'DISCRIMINATOR': //Girish ->Added to save changes, while editing the route
foreach ($aData['TASK'] as $iKey => $aRow)
{
$aFields['PRO_UID'] = $aData['PROCESS'];
$aFields['TAS_UID'] = $aRow;
$aFields['ROU_NEXT_TASK'] = $aData['ROU_NEXT_TASK'][0];
$aFields['ROU_CASE'] = $iKey;
$aFields['ROU_TYPE'] = $aData['ROU_TYPE'];
if(isset($aData['PORT_NUMBER_IP']))
$aFields['ROU_TO_PORT'] = $aData['PORT_NUMBER_IP'];
if(isset($aData['PORT_NUMBER_OP']))
$aFields['ROU_FROM_PORT'] = $aData['PORT_NUMBER_OP'];
// $aFields['ROU_CONDITION'] = $aRow['ROU_CONDITION'];
// $aFields['ROU_OPTIONAL'] = $aRow['ROU_OPTIONAL'];
$routeData = $oTasks->getRouteByType($aData['PROCESS'], $aData['ROU_NEXT_TASK'][0], $aData['ROU_TYPE']);
foreach($routeData as $route)
{
$sFields['ROU_UID'] = $route['ROU_UID'];
// $sFields['ROU_CONDITION'] = $aRow['ROU_CONDITION'];
// $sFields['ROU_OPTIONAL'] = $aRow['ROU_OPTIONAL'];
$rou_id = $oRoute->update($sFields);
}
$rou_id =$oRoute->create($aFields);
unset($aFields);
}
break;
}
echo $rou_id;
}
?>

View File

@@ -0,0 +1,314 @@
<?php
/**
* processes_Ajax.php
*
* ProcessMaker Open Source Edition
* Copyright (C) 2004 - 2008 Colosa Inc.23
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*
*/
G::LoadInclude('ajax');
$oJSON = new Services_JSON();
if ( isset ($_REQUEST['data']) ) {
$oData = $oJSON->decode(stripslashes($_REQUEST['data']));
$sOutput = '';
}
else {
if (!isset($_POST['form'])) {
$aData = urldecode_values($_POST);
}
else {
$aData = urldecode_values($_POST['form']);
}
}
G::LoadClass('processMap');
$oProcessMap = new processMap(new DBConnection);
require_once 'classes/model/Task.php';
require_once 'classes/model/Event.php';
$oEvent = new Event();
$oTask = new Task();
if ( isset ($_REQUEST['action']) ) {
switch($_REQUEST['action'])
{
case 'load':
$sOutput = $oProcessMap->load($oData->uid);
echo $sOutput;
break;
case 'addTask':
$sOutput = $oProcessMap->addTask($oData->uid, $oData->position->x, $oData->position->y);
echo $sOutput;
break;
case 'saveTaskPosition':
$sOutput = $oProcessMap->saveTaskPosition($oData->uid, $oData->position->x, $oData->position->y);
echo $sOutput;
break;
case 'saveTaskCordinates':
$sOutput = $oProcessMap->saveTaskCordinates($oData->uid, $oData->position->x, $oData->position->y);
echo $sOutput;
break;
case 'saveAnnotationCordinates':
$sOutput = $oProcessMap->saveAnnotationCordinates($oData->uid, $oData->position->x, $oData->position->y);
echo $sOutput;
break;
case 'deleteTask':
$sOutput = $oProcessMap->deleteTask($oData->tas_uid);
echo $sOutput;
break;
case 'updateTaskName':
$aTask['TAS_UID'] = $oData->uid;
$aTask['TAS_TITLE'] = $oData->label;
$oTask->update($aTask);
break;
case 'updateTask':
$aTask['TAS_UID'] = $oData->uid;
$aTask['TAS_BOUNDARY'] = $oData->boundary;
$oTask->update($aTask);
$sOutput = $oJSON->encode($oData);
echo $sOutput;
break;
case 'addSubProcess':
$sOutput = $oProcessMap->addSubProcess($oData->uid, $oData->position->x, $oData->position->y);
echo $sOutput;
break;
case 'deleteSubProcess':
$sOutput = $oProcessMap->deleteSubProcess($oData->pro_uid, $oData->tas_uid);
break;
case 'addText':
$sOutput = $oProcessMap->addText($oData->uid, $oData->label, $oData->position->x, $oData->position->y);
//echo $sOutput;
break;
case 'updateText':
$sOutput = $oProcessMap->updateText($oData->uid, $oData->label);
echo $sOutput;
break;
case 'saveTextPosition':
$sOutput = $oProcessMap->saveTextPosition($oData->uid, $oData->position->x, $oData->position->y);
break;
case 'deleteText':
$sOutput = $oProcessMap->deleteText($oData->uid);
echo $sOutput;
break;
case 'getProcesses':
$sOutput = $oProcessMap->getAllProcesses();
echo $sOutput;
break;
case 'dynaforms':
$sOutput = $oProcessMap->getDynaformList($oData->uid);
$sOutput = $oJSON->encode($sOutput);
echo $sOutput;
break;
case 'webEntry_validate':
include(PATH_METHODS . 'processes/processes_webEntryValidate.php');
break;
case 'webEntry_generate':
include(PATH_METHODS . 'processes/processes_webEntryGenerate.php');
break;
case 'webEntry':
$sOutput = $oProcessMap->listNewWebEntry($oData->uid,$oData->evn_uid);
echo $sOutput;
break;
case 'loadTask':
$oOutput = $oTask->load($oData->uid);
$sOutput = $oJSON->encode($oOutput);
echo $sOutput;
break;
case 'saveInterMessageEvent':
$aData['TAS_UID'] = $oData->uid;
$aData['TAS_SEND_LAST_EMAIL'] = strtoupper($oData->tas_send);
$aData['TAS_DEF_MESSAGE'] = $oData->data;
if(isset($aData['TAS_SEND_LAST_EMAIL']) && $aData['TAS_SEND_LAST_EMAIL'] == 'FALSE')
{
$aData['TAS_DEF_MESSAGE'] = '';
}
else
{
$aData['TAS_DEF_MESSAGE'] = str_replace('@amp@', '&', $aData['TAS_DEF_MESSAGE']);
}
$sOutput = $oTask->update($aData);
echo $sOutput;
break;
case 'triggersList':
$sOutput = $oProcessMap->getTriggers($oData->pro_uid);
$sOutput = $oJSON->encode($sOutput);
echo $sOutput;
break;
case 'process_Edit':
$sOutput = $oProcessMap->editProcessNew($oData->pro_uid);
$sOutput = $oJSON->encode($sOutput);
echo $sOutput;
break;
case 'loadCategory':
$sOutput = $oProcessMap->loadProcessCategory();
$sOutput = $oJSON->encode($sOutput);
echo $sOutput;
break;
case 'saveProcess':
$aData['PRO_UID'] = $oData->PRO_UID;
$aData['PRO_CALENDAR'] = $oData->PRO_CALENDAR;
$aData['PRO_CATEGORY'] = $oData->PRO_CATEGORY;
$aData['PRO_DEBUG'] = $oData->PRO_DEBUG;
$aData['PRO_DESCRIPTION'] = $oData->PRO_DESCRIPTION;
$aData['PRO_TITLE'] = $oData->PRO_TITLE;
$sOutput = $oProcessMap->updateProcess($aData);
echo $sOutput;
break;
case 'saveStartEvent':
$aData['TAS_UID'] = $oData->tas_uid;
$aData['TAS_START'] = $oData->tas_start;
$aData['TAS_EVN_UID'] = '';
$oTask->update($aData);
break;
case 'updateEvent':
$aData['EVN_UID'] = $oData->evn_uid;
$aData['EVN_TYPE'] = $oData->evn_type;
$oEvent = EventPeer::retrieveByPK($aData['EVN_UID']);
if (!is_null($oEvent))
$oEvent->update($aData);
break;
case 'addEvent':
$aData['PRO_UID'] = $oData->uid;
$aData['EVN_TYPE'] = $oData->tas_type;
$aData['EVN_STATUS'] = 'ACTIVE';
$aData['EVN_WHEN'] = '1';
$aData['EVN_ACTION'] = '';
if(preg_match("/Inter/", $oData->tas_type))
{
$aData['EVN_RELATED_TO'] = 'MULTIPLE';
$aData['EVN_TAS_UID_FROM'] = $oData->tas_from;
$aData['EVN_TAS_UID_TO'] = $oData->tas_to;
$sOutput = $oEvent->create($aData);
echo $sOutput;
}
//Code for Start Events only
if(preg_match("/Start/", $oData->tas_type))
{
$aData['EVN_RELATED_TO'] = 'SINGLE';
$aTask['TAS_UID'] = $oData->tas_uid;
$oTaskData = $oTask->load($aTask['TAS_UID']);
if($oTaskData['TAS_EVN_UID'] == '')
{
$sOutput = $oEvent->create($aData);
}
else
{
$aData['EVN_UID'] = $oTaskData['TAS_EVN_UID'];
$oEvn_uid = $aData['EVN_UID'];
$oEvent->update($aData);
}
$aTask['TAS_UID'] = $oData->tas_uid;
$aTask['TAS_EVN_UID'] = $oEvn_uid;
$aTask['TAS_START'] = 'TRUE';
$oTask->update($aTask);
}
break;
case 'deleteRoute':
require_once 'classes/model/Route.php';
$oRoute = new Route();
$sOutput = $oRoute->remove($oData->uid);
echo $sOutput;
break;
case 'deleteEvent':
$sOutput = $oEvent->remove($oData->uid);
echo $sOutput;
break;
case 'assign':
G::LoadClass('tasks');
$oTasks = new Tasks();
switch ($oData->TU_RELATION) {
case 1:
echo $oTasks->assignUser($oData->TAS_UID, $oData->USR_UID, $oData->TU_TYPE);
break;
case 2:
echo $oTasks->assignGroup($oData->TAS_UID, $oData->USR_UID, $oData->TU_TYPE);
break;
}
break;
case 'ofToAssign':
G::LoadClass('tasks');
$oTasks = new Tasks();
switch ($oData->TU_RELATION) {
case 1:
echo $oTasks->ofToAssignUser($oData->TAS_UID, $oData->USR_UID, $oData->TU_TYPE);
break;
case 2:
echo $oTasks->ofToAssignGroup($oData->TAS_UID, $oData->USR_UID, $oData->TU_TYPE);
break;
}
break;
case 'saveSubProcessDetails':
//$aTask=$oTask->load($_POST['form']['TASKS']);
//$aTask=$oTask->load($_POST['form']['PRO_UID']);
if($_POST['VAR_OUT1'] != '')
{
$out = array();
$out[$_POST['VAR_OUT1']] = $_POST['VAR_OUT2'];
}
if($_POST['VAR_IN1'] != '')
{
$in = array();
$in[$_POST['VAR_IN1']] = $_POST['VAR_IN2'];
}
$aTask=($_POST['TASKS']!=0)?$oTask->load($_POST['TASKS']):0;
//$aTask['PRO_UID']=0;
if ( isset ( $_POST['SP_SYNCHRONOUS']) && $_POST['SP_SYNCHRONOUS'] == '' ) {
$_POST['SP_SYNCHRONOUS'] = '0';
}
if ( !isset ( $_POST['form']['SP_SYNCHRONOUS']) ) {
$_POST['SP_SYNCHRONOUS'] = '0';
}
require_once 'classes/model/SubProcess.php';
$oOP = new SubProcess();
$aData = array('SP_UID' => $_POST['SP_UID'],//G::generateUniqueID(),
'PRO_UID' => $aTask['PRO_UID'],
'TAS_UID' => $_POST['TASKS'],
'PRO_PARENT' => $_POST['PRO_PARENT'],
'TAS_PARENT' => $_POST['TAS_PARENT'],
'SP_TYPE' => 'SIMPLE',
'SP_SYNCHRONOUS' => $_POST['SP_SYNCHRONOUS'],
'SP_SYNCHRONOUS_TYPE' => 'ALL',
'SP_SYNCHRONOUS_WAIT' => 0,
'SP_VARIABLES_OUT' => serialize($out),
'SP_VARIABLES_IN' => serialize($in),
'SP_GRID_IN' => '');
$oOP->update($aData);
break;
case 'subprocessProperties':
require_once 'classes/model/Content.php';
$lang = defined ( 'SYS_LANG') ? SYS_LANG : 'en';
//$cont = Content::addContent( 'SP_TITLE', '', $_POST['form']['SP_UID'], $lang, $_POST['form']['SPROCESS_NAME'] );
$cont = Content::addContent( 'TAS_TITLE', '', $_POST['TAS_PARENT'], $lang, $_POST['SPROCESS_NAME'] );
break;
}
}
?>

View File

@@ -0,0 +1,179 @@
<?php
/*
Copyright (c) 2010, Andrew Rymarczyk
All rights reserved.
Redistribution and use in source and minified, compiled or otherwise obfuscated
form, with or without modification, are permitted provided that the following
conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in minified, compiled or otherwise obfuscated form must
reproduce the above copyright notice, this list of conditions and the
following disclaimer in the documentation and/or other materials
provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
//$save_path = PATH_DATA_MAILTEMPLATES . '4601910684c597eab4810e6037370402' . PATH_SEP ;
$save_path = $_SERVER['DOCUMENT_ROOT'].'/uploads/';
$valid_chars_regex = '.A-Z0-9_ !@#$%^&()+={}\[\]\',~`-'; // Characters allowed in the file name (in a Regular Expression format)
//$extension_whitelist = array('csv', 'gif', 'png','tif'); // Allowed file extensions
$MAX_FILENAME_LENGTH = 260;
$max_file_size_in_bytes = 2147483647; // 2GB in bytes
$upload_name = 'Filedata';
/*
This is an upload script for SWFUpload that attempts to properly handle uploaded files
in a secure way.
Notes:
SWFUpload doesn't send a MIME-TYPE. In my opinion this is ok since MIME-TYPE is no better than
file extension and is probably worse because it can vary from OS to OS and browser to browser (for the same file).
The best thing to do is content sniff the file but this can be resource intensive, is difficult, and can still be fooled or inaccurate.
Accepting uploads can never be 100% secure.
You can't guarantee that SWFUpload is really the source of the upload. A malicious user
will probably be uploading from a tool that sends invalid or false metadata about the file.
The script should properly handle this.
The script should not over-write existing files.
The script should strip away invalid characters from the file name or reject the file.
The script should not allow files to be saved that could then be executed on the webserver (such as .php files).
To keep things simple we will use an extension whitelist for allowed file extensions. Which files should be allowed
depends on your server configuration. The extension white-list is _not_ tied your SWFUpload file_types setting
For better security uploaded files should be stored outside the webserver's document root. Downloaded files
should be accessed via a download script that proxies from the file system to the webserver. This prevents
users from executing malicious uploaded files. It also gives the developer control over the outgoing mime-type,
access restrictions, etc. This, however, is outside the scope of this script.
SWFUpload sends each file as a separate POST rather than several files in a single post. This is a better
method in my opinions since it better handles file size limits, e.g., if post_max_size is 100 MB and I post two 60 MB files then
the post would fail (2x60MB = 120MB). In SWFupload each 60 MB is posted as separate post and we stay within the limits. This
also simplifies the upload script since we only have to handle a single file.
The script should properly handle situations where the post was too large or the posted file is larger than
our defined max. These values are not tied to your SWFUpload file_size_limit setting.
*/
// Check post_max_size (http://us3.php.net/manual/en/features.file-upload.php#73762)
$POST_MAX_SIZE = ini_get('post_max_size');
$unit = strtoupper(substr($POST_MAX_SIZE, -1));
$multiplier = ($unit == 'M' ? 1048576 : ($unit == 'K' ? 1024 : ($unit == 'G' ? 1073741824 : 1)));
if ((int)$_SERVER['CONTENT_LENGTH'] > $multiplier*(int)$POST_MAX_SIZE && $POST_MAX_SIZE) {
//header("HTTP/1.1 500 Internal Server Error"); // This will trigger an uploadError event in SWFUpload
//echo "POST exceeded maximum allowed size.";
HandleError('POST exceeded maximum allowed size.');
}
// Other variables
$file_name = '';
$file_extension = '';
$uploadErrors = array(
0=>'There is no error, the file uploaded with success',
1=>'The uploaded file exceeds the upload_max_filesize directive in php.ini',
2=>'The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form',
3=>'The uploaded file was only partially uploaded',
4=>'No file was uploaded',
6=>'Missing a temporary folder'
);
// Validate the upload
if (!isset($_FILES[$upload_name])) {
HandleError('No upload found in \$_FILES for ' . $upload_name);
} else if (isset($_FILES[$upload_name]["error"]) && $_FILES[$upload_name]["error"] != 0) {
HandleError($uploadErrors[$_FILES[$upload_name]["error"]]);
} else if (!isset($_FILES[$upload_name]["tmp_name"]) || !@is_uploaded_file($_FILES[$upload_name]["tmp_name"])) {
HandleError('Upload failed is_uploaded_file test.');
} else if (!isset($_FILES[$upload_name]['name'])) {
HandleError('File has no name.');
}
// Validate the file size (Warning: the largest files supported by this code is 2GB)
$file_size = @filesize($_FILES[$upload_name]["tmp_name"]);
if (!$file_size || $file_size > $max_file_size_in_bytes) {
HandleError('File exceeds the maximum allowed size');
}
if ($file_size <= 0) {
HandleError('File size outside allowed lower bound');
}
// Validate file name (for our purposes we'll just remove invalid characters)
$file_name = preg_replace('/[^'.$valid_chars_regex.']|\.+$/i', "", basename($_FILES[$upload_name]['name']));
if (strlen($file_name) == 0 || strlen($file_name) > $MAX_FILENAME_LENGTH) {
HandleError('Invalid file name');
}
// Validate that we won't over-write an existing file
if (file_exists($save_path . $file_name)) {
HandleError('A file with this name already exists');
}
/*
// Validate file extension
$path_info = pathinfo($_FILES[$upload_name]['name']);
$file_extension = $path_info["extension"];
$is_valid_extension = false;
foreach ($extension_whitelist as $extension) {
if (strcasecmp($file_extension, $extension) == 0) {
$is_valid_extension = true;
break;
}
}
if (!$is_valid_extension) {
HandleError("Invalid file extension");
exit(0);
}
*/
// Validate file contents (extension and mime-type can't be trusted)
/*
Validating the file contents is OS and web server configuration dependant. Also, it may not be reliable.
See the comments on this page: http://us2.php.net/fileinfo
Also see http://72.14.253.104/search?q=cache:3YGZfcnKDrYJ:www.scanit.be/uploads/php-file-upload.pdf+php+file+command&hl=en&ct=clnk&cd=8&gl=us&client=firefox-a
which describes how a PHP script can be embedded within a GIF image file.
Therefore, no sample code will be provided here. Research the issue, decide how much security is
needed, and implement a solution that meets the needs.
*/
// Process the file
/*
At this point we are ready to process the valid file. This sample code shows how to save the file. Other tasks
could be done such as creating an entry in a database or generating a thumbnail.
Depending on your server OS and needs you may need to set the Security Permissions on the file after it has
been saved.
*/
if (!@move_uploaded_file($_FILES[$upload_name]["tmp_name"], $save_path.$file_name)) {
HandleError("File could not be saved.");
}
die('{"success":true}');
/* Handles the error output. This error message will be sent to the uploadSuccess event handler. The event handler
will have to check for any error messages and react as needed. */
function HandleError($message) {
die('{success:false,error:'.json_encode($message).'}');
}
?>

View File

@@ -0,0 +1,67 @@
<?php
$oHeadPublisher =& headPublisher::getSingleton();
//$oHeadPublisher->setExtSkin( 'xtheme-gray');
$oHeadPublisher->usingExtJs('ux/RowEditor');
$oHeadPublisher->addExtJsScript('bpmn/bpmnZoom',true);
$oHeadPublisher->addExtJsScript('bpmn/MyWorkflow',true ); //adding a javascript file .js
$oHeadPublisher->addExtJsScript('bpmn/pmosExt', true ); //adding a javascript file .js
$oHeadPublisher->addExtJsScript('bpmn/TaskContext', true ); //adding a javascript file .js
$oHeadPublisher->addExtJsScript('bpmn/ProcessMapContext', true ); //adding a javascript file .js
$oHeadPublisher->addExtJsScript('bpmn/processmap', true ); //adding a javascript file .js
$oHeadPublisher->addExtJsScript('bpmn/Annotation' );
$oHeadPublisher->addExtJsScript('bpmn/FlowConnector');
$oHeadPublisher->addExtJsScript('bpmn/GroupFigure');
$oHeadPublisher->addExtJsScript('bpmn/bpmnShapes', true); //
$oHeadPublisher->addExtJsScript('bpmn/LoopingSubProcess'); //
$oHeadPublisher->addExtJsScript('bpmn/LoopingTask'); //
$oHeadPublisher->addExtJsScript('bpmn/Dataobject'); //
$oHeadPublisher->addExtJsScript('bpmn/Pool',true);
$oHeadPublisher->addExtJsScript('bpmn/Lane');
$oHeadPublisher->addExtJsScript('bpmn/EventEmptyStart');
$oHeadPublisher->addExtJsScript('bpmn/EventMessageStart');
$oHeadPublisher->addExtJsScript('bpmn/EventRuleStart');
$oHeadPublisher->addExtJsScript('bpmn/EventTimerStart');
$oHeadPublisher->addExtJsScript('bpmn/EventSignalStart');
$oHeadPublisher->addExtJsScript('bpmn/EventMulStart');
$oHeadPublisher->addExtJsScript('bpmn/EventLinkStart');
$oHeadPublisher->addExtJsScript('bpmn/EventEmptyInter');
$oHeadPublisher->addExtJsScript('bpmn/EventMessageRecInter');
$oHeadPublisher->addExtJsScript('bpmn/EventMessageSendInter');
$oHeadPublisher->addExtJsScript('bpmn/EventTimerInter');
$oHeadPublisher->addExtJsScript('bpmn/EventBoundaryTimerInter');
$oHeadPublisher->addExtJsScript('bpmn/EventErrorInter');
$oHeadPublisher->addExtJsScript('bpmn/EventCompInter');
$oHeadPublisher->addExtJsScript('bpmn/EventRuleInter');
$oHeadPublisher->addExtJsScript('bpmn/EventCancelInter');
$oHeadPublisher->addExtJsScript('bpmn/EventInterSignal');
$oHeadPublisher->addExtJsScript('bpmn/EventMultipleInter');
$oHeadPublisher->addExtJsScript('bpmn/EventLinkInter');
$oHeadPublisher->addExtJsScript('bpmn/EventEmptyEnd');
$oHeadPublisher->addExtJsScript('bpmn/EventMessageEnd');
$oHeadPublisher->addExtJsScript('bpmn/EventErrorEnd');
$oHeadPublisher->addExtJsScript('bpmn/EventCompEnd');
$oHeadPublisher->addExtJsScript('bpmn/EventTerminateEnd');
$oHeadPublisher->addExtJsScript('bpmn/EventEndSignal');
$oHeadPublisher->addExtJsScript('bpmn/EventMultipleEnd');
$oHeadPublisher->addExtJsScript('bpmn/EventCancelEnd');
$oHeadPublisher->addExtJsScript('bpmn/EventLinkEnd');
$oHeadPublisher->addExtJsScript('bpmn/GatewayInclusive' );
$oHeadPublisher->addExtJsScript('bpmn/GatewayExclusiveData' );
$oHeadPublisher->addExtJsScript('bpmn/GatewayExclusiveEvent' );
$oHeadPublisher->addExtJsScript('bpmn/GatewayParallel' );
$oHeadPublisher->addExtJsScript('bpmn/GatewayComplex' );
$oHeadPublisher->addExtJsScript('bpmn/GridPanel');
$oHeadPublisher->addExtJsScript('bpmn/SubProcess' );
$oHeadPublisher->addExtJsScript('bpmn/AwesomeUploader' );
$oHeadPublisher->addExtJsScript('bpmn/Ext.ux.form.FileUploadField' );
$oHeadPublisher->addExtJsScript('bpmn/Ext.ux.XHRUpload' );
$oHeadPublisher->addExtJsScript('bpmn/swfupload' );
$oHeadPublisher->addExtJsScript('bpmn/swfupload.swfobject' );
$oHeadPublisher->addExtJsScript('bpmn/ProcessOptions',true);
$oHeadPublisher->addContent( 'bpmn/processmap'); //adding a html file .html.
G::RenderPage('publish', 'extJs');

View File

@@ -0,0 +1,67 @@
<?php
try
{
G::LoadClass('processMap');
$oProcessMap = new processMap(new DBConnection);
if ( isset($_GET['eid'] ) )
{
//Getting available Steps Criteria that have been not selected for a particular task
require_once "classes/model/Event.php";
$oEvent = new Event();
$oData = $oEvent->load($_GET['eid']);
$sch_uid = $oData['EVN_ACTION'];
if($sch_uid != '')
{
$rows = $oProcessMap->caseNewSchedulerList($sch_uid);
if($rows['SCH_OPTION'] == '3')
{
$sch_start_day = explode('|',$rows['SCH_START_DAY']);
$count = count($sch_start_day);
switch($count){
case 1:
$rows['SCH_START_DAY'] = $sch_start_day[0];
break;
case 2:
$rows['SCH_START_DAY'] = $sch_start_day[0];
$rows['SCH_START_DAY_OPT_2_WEEKS'] = $sch_start_day[1];
break;
case 3:
$rows['SCH_START_DAY'] = $sch_start_day[0];
$rows['SCH_START_DAY_OPT_2_WEEKS'] = $sch_start_day[1];
$rows['SCH_START_DAY_OPT_2_DAYS_WEEK'] = $sch_start_day[2];
break;
}
}
if($rows['SCH_START_DATE'] != '')
{
$sch_str_dt = explode(' ',$rows['SCH_START_DATE']);
$rows['SCH_START_DATE'] = $sch_str_dt[0];
}
if($rows['SCH_END_DATE'] != '')
{
$sch_str_dt = explode(' ',$rows['SCH_END_DATE']);
$rows['SCH_END_DATE'] = $sch_str_dt[0];
}
$result = json_encode( $rows ) ;
$result = str_replace("\\/","/",'{success:true,data:'.$result.'}'); // unescape the slashes
}
else
{
$result = '{failure:true}'; // unescape the slashes
}
echo $result;
}
//print json_encode( $result ) ;
}
catch ( Exception $e ) {
print json_encode ( $e->getMessage() );
}
?>

View File

@@ -0,0 +1,39 @@
<?php
try
{
G::LoadClass('processMap');
$oProcessMap = new processMap(new DBConnection);
if ( isset($_GET['pid'] ) )
{
//Getting Dynaform List
$rows = $oProcessMap->getExtDynaformsList($_GET['pid']);
array_shift($rows);
}
else if(isset($_GET['tabId'])){
$oAdditionalTables = new AdditionalTables();
$aData = $oAdditionalTables->load($_GET['tabId'], true);
$addTabName = $aData['ADD_TAB_NAME'];
foreach ($aData['FIELDS'] as $iRow => $aRow) {
if ($aRow['FLD_KEY'] == 1) {
$rows[] = $aRow;
}
}
//echo json_encode( $rows ) ;
//die;
}
//Getting Additional PM tables list created by user for combobox
else
{
//Getting Dynaform List
$rows = $oProcessMap->getExtAdditionalTablesList();
}
$result['totalCount'] = count($rows);
$result['data'] = $rows;
print json_encode( $result ) ;
}
catch ( Exception $e ) {
print json_encode ( $e->getMessage() );
}

View File

@@ -0,0 +1,27 @@
<?php
try
{
G::LoadClass('processMap');
$oProcessMap = new processMap(new DBConnection);
if ( isset($_GET['startInterId'] ) )
{
//Getting available Steps Criteria that have been not selected for a particular task
require_once "classes/model/Event.php";
$oEvent = new Event();
$aRows = $oEvent->load($_GET['startInterId']);
//$sch_uid = $oData['EVN_ACTION'];
$result = json_encode( $aRows );
$result = str_replace("\\/","/",'{success:true,data:'.$result.'}'); // unescape the slashes
/*else
{
$result = '{failure:true}'; // unescape the slashes
}*/
echo $result;
}
//print json_encode( $result ) ;
}
catch ( Exception $e ) {
print json_encode ( $e->getMessage() );
}
?>

View File

@@ -0,0 +1,64 @@
<?php
/**
* processes_Export.php
*
* ProcessMaker Open Source Edition
* Copyright (C) 2004 - 2008 Colosa Inc.23
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*
*/
G::LoadThirdParty('pear/json','class.json');
try {
if ( isset($_GET['pro_uid']))
$sProUid = $_GET['pro_uid'];
else
throw ( new Exception ( 'the process uid is not defined!.' ) );
/* Includes */
G::LoadClass('processes');
G::LoadClass('xpdl');
$oProcess = new Processes();
$oXpdl = new Xpdl();
$proFields = $oProcess->serializeProcess( $sProUid );
$Fields = $oProcess->saveSerializedProcess ( $proFields );
$xpdlFields = $oXpdl->xmdlProcess($sProUid);
$Fields['FILENAMEXPDL'] = $xpdlFields['FILENAMEXPDL'];
$Fields['FILENAME_LINKXPDL'] = $xpdlFields['FILENAME_LINKXPDL'];
if (G::is_https ())
$http = 'https://';
else
$http = 'http://';
$Fields['FILENAME_LINK'] = $http . $_SERVER['HTTP_HOST'] . '/sys' . SYS_SYS . '/' . SYS_LANG . '/' . SYS_SKIN . '/processes/' . $Fields['FILENAME_LINK'];
$Fields['FILENAME_LINKXPDL'] = $http . $_SERVER['HTTP_HOST'] . '/sys' . SYS_SYS . '/' . SYS_LANG . '/' . SYS_SKIN . '/processes/' . $Fields['FILENAME_LINKXPDL'];
$result = json_encode( $Fields );
$result = str_replace("\\/","/",'{success:true,data:'.$result.'}'); // unescape the slashes
echo $result;
}
catch ( Exception $e ){
$G_PUBLISH = new Publisher;
$aMessage['MESSAGE'] = $e->getMessage();
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'login/showMessage', '', $aMessage );
G::RenderPage('publish', 'raw' );
}

View File

@@ -0,0 +1,40 @@
<?php
try
{
G::LoadClass('processMap');
$oProcessMap = new processMap(new DBConnection);
//$_GET['sid'] gets STEP_UID and sTYPE(i.e BEFORE and AFTER) in format STEP_UID-sTYPE
if(isset($_GET['stepid']))
{
$aStepTypeId = explode('|',$_GET['stepid']);
$_SESSION['stepUID'] = $_GET['stepid'];
//$aStepTypeId = explode('-','2517180104cd42c25cc39e4071099227-BEFORE');
$sStep = $aStepTypeId[0];
$sType = $aStepTypeId[1];
}
if (isset($_GET['pid'] ) && isset($_SESSION['stepUID']))
{
$aStepTypeId = explode('|',$_SESSION['stepUID']);
$sStep = $aStepTypeId[0];
$sType = $aStepTypeId[1];
//Getting available Steps Criteria that have been not selected for a particular task
$rows = $oProcessMap->getExtAvailableStepTriggersCriteria($_GET['pid'], $sStep, $_GET['tid'], $sType);
}
else
{
//Getting all Steps Criteria that have been selected for a particular task
$rows = $oProcessMap->getExtStepTriggersCriteria($sStep, $_GET['tid'], $sType);
}
$result['totalCount'] = count($rows);
$result['data'] = $rows;
print json_encode( $result ) ;
}
catch ( Exception $e ) {
print json_encode ( $e->getMessage() );
}
?>

View File

@@ -0,0 +1,31 @@
<?php
try
{
G::LoadClass('processMap');
$oProcessMap = new processMap(new DBConnection);
//array_shift($rows);
if($_GET['type'] == 2) //Loading sub process details
{
$rows = $oProcessMap->subProcessExtProperties($_GET['pid'], $_GET['tid'],'','0');
$tmpData = json_encode( $rows ) ;
$tmpData = str_replace("\\/","/",'{success:true,data:'.$tmpData.'}'); // unescape the slashes
$result = $tmpData;
print $result;
}
else
{
$rows = $oProcessMap->subProcessExtProperties($_GET['pid'], $_GET['tid'],'',$_GET['type']);
$result['totalCount'] = count($rows);
$result['data'] = $rows;
print json_encode( $result ) ;
}
}
catch ( Exception $e ) {
print json_encode ( $e->getMessage() );
}
?>

View File

@@ -0,0 +1,64 @@
<?php
try
{
require_once 'classes/model/Task.php';
$oTask = new Task();
$rows = $oTask->load($_GET['tid']);
while (list($key, $value) = each($rows)) {
if ($value == 'TRUE')
$rows[$key] = true;
else if($value == 'FALSE')
$rows[$key] = false;
if($key == 'TAS_TYPE_DAY' && $value == '1')
$rows[$key] = 'Work Days';
else if($key == 'TAS_TYPE_DAY' && $value == '2')
$rows[$key] = 'Calendar Days';
if($key == 'TAS_ASSIGN_TYPE')
{
switch($value)
{
case 'SELF_SERVICE':
$rows[$value] = 'true';
break;
case 'REPORT_TO':
$rows[$value] = 'true';
break;
case 'BALANCED':
$rows[$value] = 'true';
break;
case 'MANUAL':
$rows[$value] = 'true';
break;
case 'EVALUATE':
$rows[$value] = 'true';
$rows['hideEvaluateField'] = 'false';
break;
case 'STATIC_MI':
$rows[$value] = 'true';
$rows['hidePartialJoinField'] = 'false';
break;
case 'CANCEL_MI':
$rows[$value] = 'true';
$rows['hidePartialJoinField'] = 'false';
break;
}
}
}
$tmpData = json_encode( $rows ) ;
$tmpData = str_replace("\\/","/",'{success:true,data:'.$tmpData.'}'); // unescape the slashes
$result = $tmpData;
echo $result;
}
catch ( Exception $e ) {
print json_encode ( $e->getMessage() );
}
?>

View File

@@ -0,0 +1,28 @@
<?php
try
{
G::LoadClass('processMap');
$oProcessMap = new processMap(new DBConnection);
if ( isset($_GET['pid'] ) )
{
//Getting available Steps Criteria that have been not selected for a particular task
$rows = $oProcessMap->getExtAvailableBBCriteria($_GET['pid'], $_GET['tid']);
array_shift($rows);
}
else
{
//Getting all Steps Criteria that have been selected for a particular task
$rows = $oProcessMap->getExtStepsCriteria($_GET['tid']);
array_shift($rows);
}
$result['totalCount'] = count($rows);
$result['data'] = $rows;
print json_encode( $result ) ;
}
catch ( Exception $e ) {
print json_encode ( $e->getMessage() );
}
?>

View File

@@ -0,0 +1,52 @@
<?php
try
{
G::LoadClass('processMap');
$oProcessMap = new processMap(new DBConnection);
if ( isset($_GET['pid'] ) )
{
$rows = $oProcessMap->usersExtList($_GET['pid'], $_GET['tid']);
array_shift($rows);
}
else
{
$rows = $oProcessMap->getAvailableExtUsersCriteria($_GET['tid']);
}
/*else
{
require_once 'classes/model/Users.php';
$oCriteria = new Criteria('workflow');
$oCriteria->addSelectColumn(UsersPeer::USR_UID);
$sDataBase = 'database_' . strtolower(DB_ADAPTER);
if(G::LoadSystemExist($sDataBase)){
G::LoadSystem($sDataBase);
$oDataBase = new database();
$oCriteria->addAsColumn('USR_COMPLETENAME', $oDataBase->concatString("USR_LASTNAME", "' '", "USR_FIRSTNAME"));
}
$oCriteria->addSelectColumn(UsersPeer::USR_USERNAME);
$oDataset = UsersPeer::doSelectRS($oCriteria);
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$oDataset->next();
$result = array();
$rows = array();
$index = isset($start) ? $start : 0;
while($aRow = $oDataset->getRow()){
$aRow['index'] = ++$index;
$rows[] = $aRow;
$oDataset->next();
}
}
*/
$result['totalCount'] = count($rows);
$result['data'] = $rows;
print json_encode( $result ) ;
}
catch ( Exception $e ) {
print json_encode ( $e->getMessage() );
}

View File

@@ -0,0 +1,129 @@
<?php
/**
* saveProcess.php
*
* ProcessMaker Open Source Edition
* Copyright (C) 2004 - 2008 Colosa Inc.23
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*
*/
try{
G::LoadClass('xpdl');
G::LoadClass('processMap');
G::LoadClass('tasks');
$oProcessMap = new processMap(new DBConnection);
$oProcess = new Xpdl();
$oTask = new Task();
if(isset($_POST['PRO_UID'])){
$idProcess = $_POST['PRO_UID'];
if($oProcess->processExists ($idProcess)){
$process['ID'] = $idProcess;
}
else{
$result = array();
$result['status_code'] = $idProcess;
$result['message'] = "the process don't exists";
$result['timestamp'] = date('Y-m-d H:i:s');
echo json_encode($result);
die;
}
}
else{
$result = array();
$result['status_code'] = 1;
$result['message'] = "you don't send the process uid";
$result['timestamp'] = date('Y-m-d H:i:s');
echo json_encode($result);
die;
}
$aTasks = json_decode ( $_POST['tasks'] );
$aRoutes = json_decode ( $_POST['routes'] );
$aEvents = json_decode ( $_POST['events'] );
$aGateways = json_decode ( $_POST['gateways'] );
$aAnnotations = json_decode ( $_POST['annotations'] );
$aSubprocess = json_decode ( $_POST['subprocess'] );
$fields = $oProcess->serializeProcess($idProcess);
//$oData = unserialize($fields);
$aRoutes = $oProcess->super_unique($aRoutes);
$sOutput = '';
$subProcesses = array();
foreach($aTasks as $endBase => $valueEnd){
$tasks['ID_TASK'] = $valueEnd['0'];
$tasks['START'] = '';
foreach($aEvents as $id => $value){
if($value['1'] == 'bpmnEventEmptyStart' or $value['1'] == 'bpmnEventMessageStart' or $value['1'] == 'bpmnEventTimerStart' ){
foreach($aRoutes as $endR => $valueR){
if($tasks['ID_TASK'] == $valueR['2'] and $valueR['1'] == $value['0'] ){
$tasks['START'] = 'TRUE';
unset($aEvents[$id]);
unset($aRoutes[$endR]);
}
}
}
}
if( $tasks['START'] == ''){
$tasks['START'] = 'FALSE';
}
$tasks['TAS_TITLE'] = $valueEnd['1'];
$tasks['X'] = $valueEnd['2'];
$tasks['Y'] = $valueEnd['3'];
$tasks['TAS_TYPE'] = $valueEnd['6'];
$tasks['ID_PROCESS'] = $idProcess;
//$tasks['TASK_TYPE'] = 'NORMAL';
$tasks['DESCRIPTION']= '';
$oData->tasks[]= $oProcess->createDataTask($tasks);
}
$endArray = array();
$endArray = $oProcess->convertArrayEnd($aEvents,$idProcess);
$oData->lanes = $oProcess->createLanesPM($aAnnotations,$idProcess);
$transitions = $oProcess->createArrayRoutes($oData->tasks,$aRoutes,$aEvents,$aGateways,$aEvents,$idProcess);
$oData->routes = $transitions['ROUTES'];
$routeTransitions = $transitions['TRANSITIONS'];
$numberRoutes = $transitions['NUMBER'];
$oData->tasks = $transitions['TASKS'];
$taskHidden = $transitions['HIDDEN'];
foreach($aSubprocess as $key => $value){
//print_R($value['0']);
//$sOutput = $oTask->remove($value['0']);
$sOutput = $oProcessMap->addSubProcess($idProcess,$value['2'],$value['3']);
/*$subProcess[$key]['ID_PROCESS'] = $idProcess;
$subProcess[$key]['TAS_TITLE'] = $idProcess;
$subProcess[$key]['ID_TASK'] = $value['0'];
$subProcess[$key]['TAS_UID'] = $value['0'];
$subProcess[$key]['TASK_PARENT'] = '';
$subProcess[$key]['PROCESS_PARENT'] = '';
$subProcess[$key]['TASK_TYPE'] = 'SUBPROCESS';
$subProcess[$key]['DESCRIPTION'] = '';
$subProcess[$key]['X'] = $value['2'];
$subProcess[$key]['Y'] = $value['3'];
print_R($subProcess[$key]);
$subProcesses[] = $oProcess->createSubProcess($subProcess);
$oData->tasks[] = $oProcess->createTask($subProcess[$key]);*/
}
$numberTransitions = sizeof($routeTransitions);
if($numberTransitions > 0){
$routesArray = $oProcess->createGateways($routeTransitions,$endArray,$oData->routes,$numberRoutes,$idProcess,$taskHidden);
$oData->routes = $routesArray;
}
$oProcess->updateProcessFromDataXpdl($oData,$oData->tasks);
}
catch (Exception $oException) {
die($oException->getMessage());
}

View File

@@ -0,0 +1,195 @@
bpmnAnnotation = function (_30ab) {
VectorFigure.call(this);
if(typeof _30ab.anno_width != 'undefined' && typeof _30ab.anno_height != 'undefined')
this.setDimension(_30ab.anno_width, _30ab.anno_height);
else
this.setDimension(110, 60);
this.setAnnotationName(_30ab.annotationName); //It will set the Default Task Name with appropriate count While dragging a task on the canvas
};
bpmnAnnotation.prototype = new VectorFigure;
bpmnAnnotation.prototype.type = "bpmnAnnotation";
bpmnAnnotation.prototype.setAnnotationName = function (name) {
if(typeof name != 'undefined')
this.annotationName = name;
else
this.annotationName = 'Annotation';
};
bpmnAnnotation.prototype.coord_converter = function (bound_width, bound_height, text_length) {
//bound_width = this.workflow.currentSelection.width;
//bound_height = this.workflow.currentSelection.height;
input_width = text_length * 6
input_height = 10
temp_width = bound_width - input_width;
temp_width /= 2;
temp_x = temp_width;
temp_height = bound_height - 10;
temp_height /= 2;
temp_y = temp_height;
var temp_coord = new Object();
temp_coord.temp_x = temp_x;
temp_coord.temp_y = temp_y;
return temp_coord;
};
bpmnAnnotation.prototype.paint = function () {
VectorFigure.prototype.paint.call(this);
//Set the Task Limitation
if(this.getWidth() > 200 || this.getHeight() > 100)
{
this.setDimension(200, 100);
}
if(this.getWidth() < 110 || this.getHeight() < 60)
{
this.setDimension(110, 60);
}
this.graphics.setColor("#ffffff");
this.graphics.fillRect(0,0, this.getWidth(), this.getHeight());
this.graphics.setColor("#000000");
this.graphics.drawLine(this.getWidth()/4,0,0,0);
this.graphics.drawLine(0,0,0,this.getHeight());
this.graphics.drawLine(0,this.getHeight(),this.getWidth()/4,this.getHeight());
this.graphics.paint();
/*var x = new Array(6, this.getWidth() - 3, this.getWidth(), this.getWidth(), this.getWidth() - 3, 6, 3, 3, 6);
var y = new Array(3, 3, 6, this.getHeight() - 3, this.getHeight(), this.getHeight(), this.getHeight() - 3, 6, 3);
this.graphics.setStroke(this.stroke);
this.graphics.setColor("#c0c0c0");
this.graphics.fillPolygon(x, y);
for (var i = 0; i < x.length; i++) {
x[i] = x[i] - 3;
y[i] = y[i] - 3;
}
this.graphics.setColor("#ffffff");
this.graphics.fillPolygon(x, y);
this.graphics.setColor("#ff0f0f");
this.graphics.drawPolygon(x, y);
this.graphics.paint();
this.x_text = this.workflow.getAbsoluteX(); //Get x co-ordinate from figure
this.y_text = this.workflow.getAbsoluteY(); //Get x co-ordinate from figure
*/
/* New object is created to implement changing of Text functionality
*/
var bpmnText = new jsGraphics(this.id);
var padleft = 0.10*this.getWidth();
var padtop = 0.18*this.getHeight();
var rectwidth = this.getWidth() - padleft;
var rectheight = this.getHeight() - 2*padtop;
bpmnText.drawStringRect(this.annotationName,0,padtop,rectwidth,rectheight,'center');
//bpmnText.drawStringRect(this.taskName,this.getWidth()/2-20,this.getHeight()/2-11,200,'left');
//tempcoord = this.coord_converter(this.getWidth(), this.getHeight(), this.taskName.length);
//bpmnText.drawTextString(this.taskName, this.getWidth(), this.getHeight(), tempcoord.temp_x, tempcoord.temp_y);
bpmnText.paint();
this.bpmnNewText = bpmnText;
if(this.input1!=null){
this.input1.setPosition(0,this.height/2);
}
};
jsGraphics.prototype.drawTextString = function (txt, x, y, dx, dy) {
this.htm += '<div style="position:absolute; display:table-cell; vertical-align:middle; height:' + y + '; width:' + x + ';' + 'margin-left:' + dx + 'px;' + 'margin-top:' + dy + 'px;' + 'font-family:' + this.ftFam + ';' + 'font-size:' + this.ftSz + ';' + 'color:' + this.color + ';' + this.ftSty + '">' + txt + '<\/div>';
};
bpmnAnnotation.prototype.setWorkflow=function(_40c5){
VectorFigure.prototype.setWorkflow.call(this,_40c5);
if(_40c5!=null){
this.input1=new InputPort();
this.input1.setWorkflow(_40c5);
this.input1.setName('input1');
this.input1.setZOrder(-1);
this.input1.setBackgroundColor(new Color(255, 255, 255));
this.input1.setColor(new Color(255, 255, 255));
this.addPort(this.input1,0,this.height/2);
};
};
bpmnAnnotationDialog = function (_2e5e) {
this.figure = _2e5e;
var title = 'Annotation';
Dialog.call(this, title);
this.setDimension(400, 150); //Set the width and height of the Dialog box
}
bpmnAnnotationDialog.prototype = new Dialog();
bpmnAnnotationDialog.prototype.createHTMLElement = function () {
var item = Dialog.prototype.createHTMLElement.call(this);
var inputDiv = document.createElement("form");
inputDiv.style.position = "absolute";
inputDiv.style.left = "10px";
inputDiv.style.top = "30px";
inputDiv.style.width = "375px";
inputDiv.style.font = "normal 10px verdana";
item.appendChild(inputDiv);
this.label = document.createTextNode("Annotation Name");
inputDiv.appendChild(this.label);
this.input = document.createElement("textarea");
this.input.style.border = "1px solid gray";
this.input.style.font = "normal 10px verdana";
//this.input.type = "text";
this.input.maxLength = "500";
this.input.cols = "50";
this.input.rows = "3";
var value = bpmnTask.prototype.trim(this.figure.workflow.currentSelection.annotationName);
if (value) this.input.value = value;
else this.input.value = "";
this.input.style.width = "100%";
inputDiv.appendChild(this.input);
this.input.focus();
return item;
};
/*Double Click Event for opening the dialog Box*/
bpmnAnnotation.prototype.onDoubleClick = function () {
var _409d = new bpmnAnnotationDialog(this);
this.workflow.showDialog(_409d, this.workflow.currentSelection.x, this.workflow.currentSelection.y);
};
/**
* This method will be called if the user pressed the OK button in buttonbar of the dialog.<br>
* The string is first cleared and new string is painted.<br><br>
**/
bpmnAnnotationDialog.prototype.onOk = function () {
this.figure.bpmnNewText.clear();
len = Math.ceil(this.input.value.length/16);
if(this.input.value.length < 19)
{
len = 1.5;
if(this.input.value.length > 9)
this.figure.rectWidth = this.input.value.length*8;
else
this.figure.rectWidth = 48;
}
else
this.figure.rectWidth = 150;
//tempcoord = this.workflow.currentSelection.coord_converter(this.workflow.currentSelection.width, this.workflow.currentSelection.height, this.input.value.length)
this.figure.bpmnNewText.drawStringRect(this.input.value,20,20,this.figure.rectWidth,'left');
// this.figure.bpmnNewText.drawTextString(this.input.value, this.workflow.currentSelection.width, this.workflow.currentSelection.height, tempcoord.temp_x, tempcoord.temp_y);
this.figure.bpmnNewText.paint();
this.figure.annotationName = this.input.value; //Set Updated Text value
//Updating Annotation Text Async into the DB
this.figure.actiontype = 'updateText';
this.workflow.saveShape(this.figure);
if(this.figure.rectWidth<80)
tempW = 110;
else
tempW = this.figure.rectWidth+35;
this.workflow.currentSelection.setDimension(tempW, len*13+40);
this.workflow.removeFigure(this);
};

View File

@@ -0,0 +1,540 @@
/*
Awesome Uploader
AwesomeUploader JavaScript Class
Copyright (c) 2010, Andrew Rymarczyk
All rights reserved.
Redistribution and use in source and minified, compiled or otherwise obfuscated
form, with or without modification, are permitted provided that the following
conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in minified, compiled or otherwise obfuscated form must
reproduce the above copyright notice, this list of conditions and the
following disclaimer in the documentation and/or other materials
provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/*
if(SWFUpload !== undefined){
SWFUpload.UPLOAD_ERROR_DESC = {
'-200': 'HTTP ERROR'
,'-210': 'MISSING UPLOAD URL'
,'-220': 'IO ERROR'
,'-230': 'SECURITY ERROR'
,'-240': 'UPLOAD LIMIT EXCEEDED'
,'-250': 'UPLOAD FAILED'
,'-260': 'SPECIFIED FILE ID NOT FOUND'
,'-270': 'FILE VALIDATION FAILED'
,'-280': 'FILE CANCELLED'
,'-290': 'UPLOAD STOPPED'
};
SWFUpload.QUEUE_ERROR_DESC = {
'-100': 'QUEUE LIMIT EXCEEDED'
,'-110': 'FILE EXCEEDS SIZE LIMIT'
,'-120': 'ZERO BYTE FILE'
,'-130': 'INVALID FILETYPE'
};
}
*/
AwesomeUploader = Ext.extend(Ext.Panel, {
jsonUrl:'/test/router/fileMan/'
,jsonUrlUpload:'processes_doUpload'
,swfUploadItems:[]
,doLayout:function(){
AwesomeUploader.superclass.doLayout.apply(this, arguments);
this.fileGrid.getView().refresh();
}
,initComponent:function(){
this.addEvents(
'fileupload'
// fireEvent('fileupload', Obj thisUploader, Bool uploadSuccessful, Obj serverResponse);
//server response object will at minimum have a property "error" describing the error.
,'fileselectionerror'
// fireEvent('fileselectionerror', String message)
//fired by drag and drop and swfuploader if a file that is too large is selected.
//Swfupload also fires this even if a 0-byte file is selected or the file type does not match the "flashSwfUploadFileTypes" mask
);
var fields = ['id', 'name', 'size', 'status', 'progress'];
this.fileRecord = Ext.data.Record.create(fields);
this.initialConfig = this.initialConfig || {};
this.initialConfig.awesomeUploaderRoot = this.initialConfig.awesomeUploaderRoot || '/skins/ext/images/gray/shapes/';
Ext.apply(this, this.initialConfig, {
flashButtonSprite:this.initialConfig.awesomeUploaderRoot+ 'swfupload_browse_button_trans_56x22.PNG'
,flashButtonWidth:'56'
,flashButtonHeight:'22'
,flashUploadFilePostName:'Filedata'
,disableFlash:false
,flashSwfUploadPath:this.initialConfig.awesomeUploaderRoot+'swfupload.swf'
//,flashSwfUploadFileSizeLimit:'3 MB' //deprecated
,flashSwfUploadFileTypes:'*.*'
,flashSwfUploadFileTypesDescription:'All Files'
,flashUploadUrl:'processes_doUpload.php'
,xhrUploadUrl:'xhrupload.php'
,xhrFileNameHeader:'X-File-Name'
,xhrExtraPostDataPrefix:'extraPostData_'
,xhrFilePostName:'Filedata'
,xhrSendMultiPartFormData:false
,maxFileSizeBytes: 3145728 // 3 * 1024 * 1024 = 3 MiB
,standardUploadFilePostName:'Filedata'
,standardUploadUrl:'processes_doUpload.php'
,iconStatusPending:this.initialConfig.awesomeUploaderRoot+'hourglass.png'
,iconStatusSending:this.initialConfig.awesomeUploaderRoot+'loading.gif'
,iconStatusAborted:this.initialConfig.awesomeUploaderRoot+'cross.png'
,iconStatusError:this.initialConfig.awesomeUploaderRoot+'cross.png'
,iconStatusDone:this.initialConfig.awesomeUploaderRoot+'tick.png'
,supressPopups:false
,extraPostData:{}
,width:440
,height:250
,autoScroll: true
,border:true
,frame:true
,layout:'absolute'
,fileId:0
,items:[
{
//swfupload and upload button container
},{
xtype:'grid'
,x:0
,y:30
,width:this.initialConfig.gridWidth || 420
,height:this.initialConfig.gridHeight || 200
,enableHdMenu:false
,store:new Ext.data.ArrayStore({
fields: fields
,reader: new Ext.data.ArrayReader({idIndex: 0}, this.fileRecord)
})
,columns:[
{header:'File Name',dataIndex:'name', width:150}
,{header:'Size',dataIndex:'size', width:60, renderer:Ext.util.Format.fileSize}
,{header:'&nbsp;',dataIndex:'status', width:30, scope:this, renderer:this.statusIconRenderer}
,{header:'Status',dataIndex:'status', width:60}
,{header:'Progress',dataIndex:'progress',scope:this, renderer:this.progressBarColumnRenderer}
]
,listeners:{
render:{
scope:this
,fn:function(){
this.fileGrid = this.items.items[1];
this.initFlashUploader();
this.initDnDUploader();
}
}
}
}]
});
AwesomeUploader.superclass.initComponent.apply(this, arguments);
}
,fileAlert:function(text){
if(this.supressPopups){
return true;
}
if(this.fileAlertMsg === undefined || !this.fileAlertMsg.isVisible()){
this.fileAlertMsgText = 'Error uploading:<BR>'+text;
this.fileAlertMsg = Ext.MessageBox.show({
title:'Upload Error',
msg: this.fileAlertMsgText,
buttons: Ext.Msg.OK,
modal:false,
icon: Ext.MessageBox.ERROR
});
}else{
this.fileAlertMsgText += text;
this.fileAlertMsg.updateText(this.fileAlertMsgText);
this.fileAlertMsg.getDialog().focus();
}
}
,statusIconRenderer:function(value){
switch(value){
default:
return value;
case 'Pending':
return '<img src="'+this.iconStatusPending+'" width=16 height=16>';
case 'Sending':
return '<img src="'+this.iconStatusSending+'" width=16 height=16>';
case 'Aborted':
return '<img src="'+this.iconStatusAborted+'" width=16 height=16>';
case 'Error':
return '<img src="'+this.iconStatusError+'" width=16 height=16>';
case 'Done':
return '<img src="'+this.iconStatusDone+'" width=16 height=16>';
}
}
,progressBarColumnTemplate: new Ext.XTemplate(
'<div class="ux-progress-cell-inner ux-progress-cell-inner-center ux-progress-cell-foreground">',
'<div>{value} %</div>',
'</div>',
'<div class="ux-progress-cell-inner ux-progress-cell-inner-center ux-progress-cell-background" style="left:{value}%">',
'<div style="left:-{value}%">{value} %</div>',
'</div>'
)
,progressBarColumnRenderer:function(value, meta, record, rowIndex, colIndex, store){
meta.css += ' x-grid3-td-progress-cell';
return this.progressBarColumnTemplate.apply({
value: value
});
}
,addFile:function(file){
var fileRec = new this.fileRecord(
Ext.apply(file,{
id: ++this.fileId
,status: 'Pending'
,progress: '0'
,complete: '0'
})
);
this.fileGrid.store.add(fileRec);
return fileRec;
}
,updateFile:function(fileRec, key, value){
fileRec.set(key, value);
fileRec.commit();
}
,initStdUpload:function(param){
if(this.uploader){
this.uploader.fileInput = null; //remove reference to file field. necessary to prevent destroying file field during upload.
Ext.destroy(this.uploader);
}else{
Ext.destroy(this.items.items[0]);
}
this.uploader = new Ext.ux.form.FileUploadField({
renderTo:this.body
,buttonText:'Browse...'
,x:0
,y:0
,style:'position:absolute;'
,buttonOnly:true
,name:this.standardUploadFilePostName
,listeners:{
scope:this
,fileselected:this.stdUploadFileSelected
}
});
}
,initFlashUploader:function(){
if(this.disableFlash){
this.initStdUpload();
return true;
}
var settings = {
flash_url: this.flashSwfUploadPath
,upload_url: this.flashUploadUrl
,file_size_limit: this.maxFileSizeBytes + ' B'
,file_types: this.flashSwfUploadFileTypes
,file_types_description: this.flashSwfUploadFileTypesDescription
,file_upload_limit: 100
,file_queue_limit: 0
,debug: false
,post_params: this.extraPostData
,button_image_url: this.flashButtonSprite
,button_width: this.flashButtonWidth
,button_height: this.flashButtonHeight
,button_window_mode: 'opaque'
,file_post_name: this.flashUploadFilePostName
,button_placeholder: this.items.items[0].body.dom
,file_queued_handler: this.swfUploadfileQueued.createDelegate(this)
,file_dialog_complete_handler: this.swfUploadFileDialogComplete.createDelegate(this)
,upload_start_handler: this.swfUploadUploadStart.createDelegate(this)
,upload_error_handler: this.swfUploadUploadError.createDelegate(this)
,upload_progress_handler: this.swfUploadUploadProgress.createDelegate(this)
,upload_success_handler: this.swfUploadSuccess.createDelegate(this)
,upload_complete_handler: this.swfUploadComplete.createDelegate(this)
,file_queue_error_handler: this.swfUploadFileQueError.createDelegate(this)
,minimum_flash_version: '9.0.28'
,swfupload_load_failed_handler: this.initStdUpload.createDelegate(this)
};
this.swfUploader = new SWFUpload(settings);
}
,initDnDUploader:function(){
//==================
// Attach drag and drop listeners to document body
// this prevents incorrect drops, reloading the page with the dropped item
// This may or may not be helpful
if(!document.body.BodyDragSinker){
document.body.BodyDragSinker = true;
var body = Ext.fly(document.body);
body.on({
dragenter:function(event){
return true;
}
,dragleave:function(event){
return true;
}
,dragover:function(event){
event.stopEvent();
return true;
}
,drop:function(event){
event.stopEvent();
return true;
}
});
}
// end body events
//==================
this.el.on({
dragenter:function(event){
event.browserEvent.dataTransfer.dropEffect = 'move';
return true;
}
,dragover:function(event){
event.browserEvent.dataTransfer.dropEffect = 'move';
event.stopEvent();
return true;
}
,drop:{
scope:this
,fn:function(event){
event.stopEvent();
var files = event.browserEvent.dataTransfer.files;
if(files === undefined){
return true;
}
var len = files.length;
while(--len >= 0){
this.processDnDFileUpload(files[len]);
}
}
}
});
}
,processDnDFileUpload:function(file){
var fileRec = this.addFile({
name: file.name
,size: file.size
});
if(file.size > this.maxFileSizeBytes){
this.updateFile(fileRec, 'status', 'Error');
this.fileAlert('<BR>'+file.name+'<BR><b>File size exceeds allowed limit.</b><BR>');
this.fireEvent('fileselectionerror', 'File size exceeds allowed limit.');
return true;
}
var upload = new Ext.ux.XHRUpload({
url:this.xhrUploadUrl
,filePostName:this.xhrFilePostName
,fileNameHeader:this.xhrFileNameHeader
,extraPostData:this.extraPostData
,sendMultiPartFormData:this.xhrSendMultiPartFormData
,file:file
,listeners:{
scope:this
,uploadloadstart:function(event){
this.updateFile(fileRec, 'status', 'Sending');
}
,uploadprogress:function(event){
this.updateFile(fileRec, 'progress', Math.round((event.loaded / event.total)*100));
}
// XHR Events
,loadstart:function(event){
this.updateFile(fileRec, 'status', 'Sending');
}
,progress:function(event){
fileRec.set('progress', Math.round((event.loaded / event.total)*100) );
fileRec.commit();
}
,abort:function(event){
this.updateFile(fileRec, 'status', 'Aborted');
this.fireEvent('fileupload', this, false, {error:'XHR upload aborted'});
}
,error:function(event){
this.updateFile(fileRec, 'status', 'Error');
this.fireEvent('fileupload', this, false, {error:'XHR upload error'});
}
,load:function(event){
try{
var result = Ext.util.JSON.decode(upload.xhr.responseText);//throws a SyntaxError.
}catch(e){
Ext.MessageBox.show({
buttons: Ext.MessageBox.OK
,icon: Ext.MessageBox.ERROR
,modal:false
,title:'Upload Error!'
,msg:'Invalid JSON Data Returned!<BR><BR>Please refresh the page to try again.'
});
this.updateFile(fileRec, 'status', 'Error');
this.fireEvent('fileupload', this, false, {error:'Invalid JSON returned'});
return true;
}
if( result.success ){
fileRec.set('progress', 100 );
fileRec.set('status', 'Done');
fileRec.commit();
this.fireEvent('fileupload', this, true, result);
}else{
this.fileAlert('<BR>'+file.name+'<BR><b>'+result.error+'</b><BR>');
this.updateFile(fileRec, 'status', 'Error');
this.fireEvent('fileupload', this, false, result);
}
}
}
});
upload.send();
}
,swfUploadUploadProgress:function(file, bytesComplete, bytesTotal){
this.updateFile(this.swfUploadItems[file.index], 'progress', Math.round((bytesComplete / bytesTotal)*100));
}
,swfUploadFileDialogComplete:function(){
this.swfUploader.startUpload();
}
,swfUploadUploadStart:function(file){
this.swfUploader.setPostParams(this.extraPostData); //sync post data with flash
this.updateFile(this.swfUploadItems[file.index], 'status', 'Sending');
}
,swfUploadComplete:function(file){ //called if the file is errored out or on success
this.swfUploader.startUpload(); //as per the swfupload docs, start the next upload!
}
,swfUploadUploadError:function(file, errorCode, message){
this.fileAlert('<BR>'+file.name+'<BR><b>'+message+'</b><BR>');//SWFUpload.UPLOAD_ERROR_DESC[errorCode.toString()]
this.updateFile(this.swfUploadItems[file.index], 'status', 'Error');
this.fireEvent('fileupload', this, false, {error:message});
}
,swfUploadSuccess:function(file, serverData){ //called when the file is done
try{
var result = Ext.util.JSON.decode(serverData);//throws a SyntaxError.
}catch(e){
Ext.MessageBox.show({
buttons: Ext.MessageBox.OK
,icon: Ext.MessageBox.ERROR
,modal:false
,title:'Upload Error!'
,msg:'Invalid JSON Data Returned!<BR><BR>Please refresh the page to try again.'
});
this.updateFile(this.swfUploadItems[file.index], 'status', 'Error');
this.fireEvent('fileupload', this, false, {error:'Invalid JSON returned'});
return true;
}
if( result.success ){
this.swfUploadItems[file.index].set('progress',100);
this.swfUploadItems[file.index].set('status', 'Done');
this.swfUploadItems[file.index].commit();
this.fireEvent('fileupload', this, true, result);
}else{
this.fileAlert('<BR>'+file.name+'<BR><b>'+result.error+'</b><BR>');
this.updateFile(this.swfUploadItems[file.index], 'status', 'Error');
this.fireEvent('fileupload', this, false, result);
}
}
,swfUploadfileQueued:function(file){
this.swfUploadItems[file.index] = this.addFile({
name: file.name
,size: file.size
});
return true;
}
,swfUploadFileQueError:function(file, error, message){
this.swfUploadItems[file.index] = this.addFile({
name: file.name
,size: file.size
});
this.updateFile(this.swfUploadItems[file.index], 'status', 'Error');
this.fileAlert('<BR>'+file.name+'<BR><b>'+message+'</b><BR>');
this.fireEvent('fileselectionerror', message);
}
,stdUploadSuccess:function(form, action){
form.el.fileRec.set('progress',100);
form.el.fileRec.set('status', 'Done');
form.el.fileRec.commit();
this.fireEvent('fileupload', this, true, action.result);
}
,stdUploadFail:function(form, action){
this.updateFile(form.el.fileRec, 'status', 'Error');
this.fireEvent('fileupload', this, false, action.result);
this.fileAlert('<BR>'+form.el.fileRec.get('name')+'<BR><b>'+action.result.error+'</b><BR>');
}
,stdUploadFileSelected:function(fileBrowser, fileName){
var lastSlash = fileName.lastIndexOf('/'); //check for *nix full file path
if( lastSlash < 0 ){
lastSlash = fileName.lastIndexOf('\\'); //check for win full file path
}
if(lastSlash > 0){
fileName = fileName.substr(lastSlash+1);
}
var file = {
name:fileName
,size:'0'
};
if(Ext.isDefined(fileBrowser.fileInput.dom.files) ){
file.size = fileBrowser.fileInput.dom.files[0].size;
};
var fileRec = this.addFile(file);
if( file.size > this.maxFileSizeBytes){
this.updateFile(fileRec, 'status', 'Error');
this.fileAlert('<BR>'+file.name+'<BR><b>File size exceeds allowed limit.</b><BR>');
this.fireEvent('fileselectionerror', 'File size exceeds allowed limit.');
return true;
}
var formEl = document.createElement('form'),
extraPost;
for( attr in this.extraPostData){
extraPost = document.createElement('input'),
extraPost.type = 'hidden';
extraPost.name = attr;
extraPost.value = this.extraPostData[attr];
formEl.appendChild(extraPost);
}
formEl = this.el.appendChild(formEl);
formEl.fileRec = fileRec;
fileBrowser.fileInput.addClass('au-hidden');
formEl.appendChild(fileBrowser.fileInput);
formEl.addClass('au-hidden');
var formSubmit = new Ext.form.BasicForm(formEl,{
method:'POST'
,fileUpload:true
});
formSubmit.submit({
url:this.standardUploadUrl
,scope:this
,success:this.stdUploadSuccess
,failure:this.stdUploadFail
});
this.updateFile(fileRec, 'status', 'Sending');
this.initStdUpload(); //re-init uploader for multiple simultaneous uploads
}
});
Ext.reg('awesomeuploader', AwesomeUploader);

View File

@@ -0,0 +1,33 @@
bpmnDataobject = function (_30ab) {
VectorFigure.call(this);
this.setDimension(50, 80);
this.setTaskName(_30ab.taskNo); //It will set the Default Task Name with appropriate count While dragging a task on the canvas
};
bpmnDataobject.prototype = new VectorFigure;
bpmnDataobject.prototype.type = "bpmnDataobject";
bpmnDataobject.prototype.setTaskName = function (name) {
this.taskName = 'Data Object ' + name;
};
bpmnDataobject.prototype.paint = function () {
VectorFigure.prototype.paint.call(this);
var x = new Array(0, this.getWidth()-10, this.getWidth(), this.getWidth()-10, this.getWidth()-10, this.getWidth(), this.getWidth(), 0);
var y = new Array(0, 0, 10, 10, 0, 10, this.getHeight(), this.getHeight());
this.graphics.setStroke(this.stroke);
this.graphics.setColor("#c0c0c0");
this.graphics.fillPolygon(x, y);
for (var i = 0; i < x.length; i++) {
x[i] = x[i] - 3;
y[i] = y[i] - 3;
}
this.graphics.setColor("#ffffff");
this.graphics.fillPolygon(x, y);
this.graphics.setColor("#ff0f0f");
this.graphics.drawPolygon(x, y);
this.graphics.paint();
this.x_text = this.workflow.getAbsoluteX(); //Get x co-ordinate from figure
this.y_text = this.workflow.getAbsoluteY(); //Get x co-ordinate from figure
}

View File

@@ -0,0 +1,97 @@
bpmnEventBoundaryTimerInter=function(){
VectorFigure.call(this);
this.setDimension(30,30);
this.stroke = 2;
};
bpmnEventBoundaryTimerInter.prototype=new VectorFigure;
bpmnEventBoundaryTimerInter.prototype.type="bpmnEventBoundaryTimerInter";
bpmnEventBoundaryTimerInter.prototype.paint=function(){
VectorFigure.prototype.paint.call(this);
var x_cir1=0;
var y_cir1=0;
this.graphics.setColor("#c0c0c0");
this.graphics.fillEllipse(x_cir1+3,y_cir1+3,this.getWidth(),this.getHeight());
this.graphics.setStroke(this.stroke);
this.graphics.setColor( "#f9faf2" );
this.graphics.fillEllipse(x_cir1,y_cir1,this.getWidth(),this.getHeight());
this.graphics.setColor("#adae5e");
this.graphics.drawEllipse(x_cir1,y_cir1,this.getWidth(),this.getHeight());
var x_cir2=3;
var y_cir2=3;
this.graphics.setColor( "#f9faf2" );
this.graphics.fillEllipse(x_cir2,y_cir2,this.getWidth()-6,this.getHeight()-6);
this.graphics.setColor("#adae5e");
this.graphics.drawEllipse(x_cir2,y_cir2,this.getWidth()-6,this.getHeight()-6);
/*
//drawing clock's minutes lines
this.graphics.setColor("#adae5e");
//this.graphics.drawEllipse(x_cir3,y_cir3,this.getWidth()-20,this.getHeight()-20);
this.graphics.drawLine(this.getWidth()/2,this.getHeight()/2,this.getWidth()/1.3,this.getHeight()/2);
this.graphics.drawLine(this.getWidth()/2,this.getHeight()/2,this.getWidth()/2,this.getHeight()/4.5);
*/
//var x_cir3=10;
//var y_cir3=10;
//this.graphics.setColor( "#f9faf2" );
//this.graphics.fillEllipse(x_cir3,y_cir3,this.getWidth()-20,this.getHeight()-20);
this.graphics.setColor("#adae5e");
//this.graphics.drawEllipse(x_cir3,y_cir3,this.getWidth()-20,this.getHeight()-20);
this.graphics.drawLine(this.getWidth()/2.2,this.getHeight()/2,this.getWidth()/1.6,this.getHeight()/2); //horizontal line
this.graphics.drawLine(this.getWidth()/2.2,this.getHeight()/2,this.getWidth()/2.2,this.getHeight()/3.7); //vertical line
this.graphics.drawLine(24,8,20,11); //10th min line
this.graphics.drawLine(22,15,25,15); //15th min line
this.graphics.drawLine(24,22,19,20); //25th min line
this.graphics.drawLine(15,22,15,25); //30th min line
this.graphics.drawLine(8,22,12,19); //40th min line
this.graphics.drawLine(5,15,8,15); //45th min line
this.graphics.drawLine(8,8,11,11); //50th min line
this.graphics.drawLine(15,5,15,8); //60th min line
this.graphics.paint();
/*Code Added to Dynamically shift Ports on resizing of shapes
**/
if(this.input1!=null){
this.input1.setPosition(0,this.height/2);
}
if(this.output1!=null){
this.output1.setPosition(this.width/2,this.height);
}
if(this.input2!=null){
this.input2.setPosition(this.width/2,0);
}
if(this.output2!=null){
this.output2.setPosition(this.width,this.height/2);
}
};
bpmnEventBoundaryTimerInter.prototype.setWorkflow=function(_40c5){
VectorFigure.prototype.setWorkflow.call(this,_40c5);
if(_40c5!=null){
var eventPortName = ['input2','output2'];
var eventPortType = ['InputPort','OutputPort'];
var eventPositionX= [this.width/2,this.width/2];
var eventPositionY= [0,this.height];
for(var i=0; i< eventPortName.length ; i++){
eval('this.'+eventPortName[i]+' = new '+eventPortType[i]+'()'); //Create New Port
eval('this.'+eventPortName[i]+'.setWorkflow(_40c5)'); //Add port to the workflow
eval('this.'+eventPortName[i]+'.setName("'+eventPortName[i]+'")'); //Set PortName
eval('this.'+eventPortName[i]+'.setZOrder(-1)'); //Set Z-Order of the port to -1. It will be below all the figure
eval('this.'+eventPortName[i]+'.setBackgroundColor(new Color(255, 255, 255))'); //Setting Background of the port to white
eval('this.'+eventPortName[i]+'.setColor(new Color(255, 255, 255))'); //Setting Border of the port to white
eval('this.addPort(this.'+eventPortName[i]+','+eventPositionX[i]+', '+eventPositionY[i]+')'); //Setting Position of the port
}
}
};
bpmnEventBoundaryTimerInter.prototype.getContextMenu=function(){
if(this.id != null){
this.workflow.handleContextMenu(this);
}
};

View File

@@ -0,0 +1,76 @@
bpmnEventCancelEnd=function(){
VectorFigure.call(this);
this.setDimension(30,30);
this.stroke=3;
};
bpmnEventCancelEnd.prototype=new VectorFigure;
bpmnEventCancelEnd.prototype.type="bpmnEventCancelEnd";
bpmnEventCancelEnd.prototype.paint=function(){
VectorFigure.prototype.paint.call(this);
//Set the Task Limitation
if (this.getWidth() < 30 || this.getHeight() < 30) {
this.setDimension(30, 30);
}
this.graphics.setStroke(this.stroke);
var x_cir = 0;
var y_cir = 0;
this.graphics.setColor("#c0c0c0");
this.graphics.fillEllipse(x_cir+5,y_cir+5,this.getWidth(),this.getHeight());
this.graphics.setColor("#f7f1e5");
this.graphics.fillEllipse(x_cir,y_cir,this.getWidth(),this.getHeight());
this.graphics.setColor("#c46508");
this.graphics.drawEllipse(x_cir,y_cir,this.getWidth(),this.getHeight());
this.graphics.setStroke(2);
//var x=new Array(16,23,31,36,29,37,32,23,16,11,18,11);
//var y=new Array(35,27,33,29,22,14,9,16,9,14,22,29);
var x=new Array(this.getWidth()/2.8,this.getWidth()/1.95,this.getWidth()/1.45,this.getWidth()/1.25,this.getWidth()/1.55,this.getWidth()/1.21,this.getWidth()/1.4,this.getWidth()/1.95,this.getWidth()/2.8,this.getWidth()/4.1,this.getWidth()/2.5,this.getWidth()/4.1);
var y=new Array(this.getHeight()/1.28,this.getHeight()/1.66,this.getHeight()/1.36,this.getHeight()/1.55,this.getHeight()/2.04,this.getHeight()/3.21,this.getHeight()/5.6,this.getHeight()/2.81,this.getHeight()/5.6,this.getHeight()/3.21,this.getHeight()/2.04,this.getHeight()/1.55);
this.graphics.setColor("#c46508");
this.graphics.fillPolygon(x,y);
this.graphics.setColor("#c46508");
//this.graphics.drawPolygon(x,y);
this.graphics.paint();
/*Code Added to Dynamically shift Ports on resizing of shapes
**/
if(this.input1!=null){
this.input1.setPosition(0,this.height/2);
}
if(this.output1!=null){
this.output1.setPosition(this.width/2,this.height);
}
if(this.input2!=null){
this.input2.setPosition(this.width/2,0);
}
if(this.output2!=null){
this.output2.setPosition(this.width,this.height/2);
}
};
bpmnEventCancelEnd.prototype.setWorkflow=function(_40c5){
VectorFigure.prototype.setWorkflow.call(this,_40c5);
if(_40c5!=null){
var eventPortName = ['input1','input2'];
var eventPortType = ['InputPort','InputPort'];
var eventPositionX= [this.width/2,0];
var eventPositionY= [0,this.height/2];
for(var i=0; i< eventPortName.length ; i++){
eval('this.'+eventPortName[i]+' = new '+eventPortType[i]+'()'); //Create New Port
eval('this.'+eventPortName[i]+'.setWorkflow(_40c5)'); //Add port to the workflow
eval('this.'+eventPortName[i]+'.setName("'+eventPortName[i]+'")'); //Set PortName
eval('this.'+eventPortName[i]+'.setZOrder(-1)'); //Set Z-Order of the port to -1. It will be below all the figure
eval('this.'+eventPortName[i]+'.setBackgroundColor(new Color(255, 255, 255))'); //Setting Background of the port to white
eval('this.'+eventPortName[i]+'.setColor(new Color(255, 255, 255))'); //Setting Border of the port to white
eval('this.addPort(this.'+eventPortName[i]+','+eventPositionX[i]+', '+eventPositionY[i]+')'); //Setting Position of the port
}
}
};
bpmnEventCancelEnd.prototype.getContextMenu=function(){
if(this.id != null){
this.workflow.handleContextMenu(this);
}
};

View File

@@ -0,0 +1,30 @@
bpmnEventCancelInter=function(){
VectorFigure.call(this);
this.setDimension(45,45);
this.stroke=2;
};
bpmnEventCancelInter.prototype=new VectorFigure;
bpmnEventCancelInter.prototype.type="bpmnEventCancelInter";
bpmnEventCancelInter.prototype.paint=function(){
VectorFigure.prototype.paint.call(this);
this.graphics.setStroke(this.stroke);
var x_cir = 0;
var y_cir = 0;
this.graphics.setColor("#000000");
this.graphics.drawEllipse(x_cir,y_cir,this.getWidth(),this.getHeight());
var x_cir2=5;
var y_cir2=5;
this.graphics.setColor("#000000");
this.graphics.drawEllipse(x_cir2,y_cir2,this.getWidth()-10,this.getHeight()-10);
//var x=new Array(16,23,31,36,29,37,32,23,16,11,18,11);
//var y=new Array(35,27,33,29,22,14,9,16,9,14,22,29);
var x=new Array(this.getWidth()/2.8,this.getWidth()/1.95,this.getWidth()/1.45,this.getWidth()/1.25,this.getWidth()/1.55,this.getWidth()/1.21,this.getWidth()/1.4,this.getWidth()/1.95,this.getWidth()/2.8,this.getWidth()/4.1,this.getWidth()/2.5,this.getWidth()/4.1);
var y=new Array(this.getHeight()/1.28,this.getHeight()/1.66,this.getHeight()/1.36,this.getHeight()/1.55,this.getHeight()/2.04,this.getHeight()/3.21,this.getHeight()/5.6,this.getHeight()/2.81,this.getHeight()/5.6,this.getHeight()/3.21,this.getHeight()/2.04,this.getHeight()/1.55);
this.graphics.setColor("#ffffff");
this.graphics.fillPolygon(x,y);
this.graphics.setColor("#000000");
this.graphics.drawPolygon(x,y);
this.graphics.paint();
};

View File

@@ -0,0 +1,70 @@
bpmnEventCompEnd=function(){
VectorFigure.call(this);
this.setDimension(30,30);
this.stroke=3
};
bpmnEventCompEnd.prototype=new VectorFigure;
bpmnEventCompEnd.prototype.type="bpmnEventCompEnd";
bpmnEventCompEnd.prototype.paint=function(){
VectorFigure.prototype.paint.call(this);
this.graphics.setStroke(this.stroke);
var x_cir = 0;
var y_cir = 0;
this.graphics.setColor("#c0c0c0");
this.graphics.fillEllipse(x_cir+5,y_cir+5,this.getWidth(),this.getHeight());
this.graphics.setColor("#f7f1e5");
this.graphics.fillEllipse(x_cir,y_cir,this.getWidth(),this.getHeight());
this.graphics.setColor("#c46508");
this.graphics.drawEllipse(x_cir,y_cir,this.getWidth(),this.getHeight());
//var x_arrow=new Array(6,19,19,32,32,19,19);
//var y_arrow=new Array(22,33,22,33,11,22,11);
var x_arrow=new Array(this.getWidth()/7,this.getWidth()/2.36,this.getWidth()/2.36,this.getWidth()/1.4,this.getWidth()/1.42,this.getWidth()/2.36,this.getWidth()/2.36);
var y_arrow=new Array(this.getHeight()/2,this.getHeight()/1.36,this.getHeight()/2,this.getHeight()/1.36,this.getHeight()/4,this.getHeight()/2,this.getHeight()/4);
this.graphics.setColor( "#c46508" );
this.graphics.fillPolygon(x_arrow,y_arrow);
this.graphics.setColor("#c46508");
//this.graphics.drawPolygon(x_arrow,y_arrow);
this.graphics.paint();/*Code Added to Dynamically shift Ports on resizing of shapes
**/
if(this.input1!=null){
this.input1.setPosition(0,this.height/2);
}
if(this.output1!=null){
this.output1.setPosition(this.width/2,this.height);
}
if(this.input2!=null){
this.input2.setPosition(this.width/2,0);
}
if(this.output2!=null){
this.output2.setPosition(this.width,this.height/2);
}
};
bpmnEventCompEnd.prototype.setWorkflow=function(_40c5){
VectorFigure.prototype.setWorkflow.call(this,_40c5);
if(_40c5!=null){
var eventPortName = ['input1','input2'];
var eventPortType = ['InputPort','InputPort'];
var eventPositionX= [this.width/2,0];
var eventPositionY= [0,this.height/2];
for(var i=0; i< eventPortName.length ; i++){
eval('this.'+eventPortName[i]+' = new '+eventPortType[i]+'()'); //Create New Port
eval('this.'+eventPortName[i]+'.setWorkflow(_40c5)'); //Add port to the workflow
eval('this.'+eventPortName[i]+'.setName("'+eventPortName[i]+'")'); //Set PortName
eval('this.'+eventPortName[i]+'.setZOrder(-1)'); //Set Z-Order of the port to -1. It will be below all the figure
eval('this.'+eventPortName[i]+'.setBackgroundColor(new Color(255, 255, 255))'); //Setting Background of the port to white
eval('this.'+eventPortName[i]+'.setColor(new Color(255, 255, 255))'); //Setting Border of the port to white
eval('this.addPort(this.'+eventPortName[i]+','+eventPositionX[i]+', '+eventPositionY[i]+')'); //Setting Position of the port
}
}
};
bpmnEventCompEnd.prototype.getContextMenu=function(){
if(this.id != null){
this.workflow.handleContextMenu(this);
}
};

View File

@@ -0,0 +1,102 @@
bpmnEventCompInter=function(){
VectorFigure.call(this);
this.setDimension(30,30);
this.stroke=2
};
bpmnEventCompInter.prototype=new VectorFigure;
bpmnEventCompInter.prototype.type="bpmnEventCompInter";
bpmnEventCompInter.prototype.paint=function(){
VectorFigure.prototype.paint.call(this);
this.graphics.setStroke(this.stroke);
var x_cir =0;
var y_cir =0;
this.graphics.setColor("#c0c0c0");
this.graphics.fillEllipse(x_cir+3,y_cir+3,this.getWidth(),this.getHeight());
this.graphics.setColor("#f9faf2")
this.graphics.fillEllipse(x_cir,y_cir,this.getWidth(),this.getHeight())
this.graphics.setColor("#adae5e");
this.graphics.drawEllipse(x_cir,y_cir,this.getWidth(),this.getHeight());
var x_cir2=3;
var y_cir2=3;
this.graphics.setColor("#adae5e");
this.graphics.drawEllipse(x_cir2,y_cir2,this.getWidth()-6,this.getHeight()-6);
//var x_arrow=new Array(6,19,19,32,32,19,19);
//var y_arrow=new Array(22,33,22,33,11,22,11);
var x_arrow=new Array(this.getWidth()/7.5,this.getWidth()/2.36,this.getWidth()/2.36,this.getWidth()/1.4,this.getWidth()/1.42,this.getWidth()/2.36,this.getWidth()/2.36);
var y_arrow=new Array(this.getHeight()/2,this.getHeight()/1.36,this.getHeight()/2,this.getHeight()/1.36,this.getHeight()/4,this.getHeight()/2,this.getHeight()/4);
this.graphics.setColor( "#adae5e" );
this.graphics.fillPolygon(x_arrow,y_arrow);
this.graphics.setColor("#adae5e");
this.graphics.drawPolygon(x_arrow,y_arrow);
this.graphics.paint();
/*Code Added to Dynamically shift Ports on resizing of shapes
**/
if(this.input1!=null){
this.input1.setPosition(0,this.height/2);
}
if(this.output1!=null){
this.output1.setPosition(this.width/2,this.height);
}
if(this.input2!=null){
this.input2.setPosition(this.width/2,0);
}
if(this.output2!=null){
this.output2.setPosition(this.width,this.height/2);
}
};
bpmnEventCompInter.prototype.setWorkflow=function(_40c5){
VectorFigure.prototype.setWorkflow.call(this,_40c5);
if(_40c5!=null){
var eventPortName = ['input1','input2','output1','output2'];
var eventPortType = ['InputPort','InputPort','OutputPort','OutputPort'];
var eventPositionX= [0,this.width/2,this.width,this.width/2];
var eventPositionY= [this.height/2,0,this.height/2,this.height];
for(var i=0; i< eventPortName.length ; i++){
eval('this.'+eventPortName[i]+' = new '+eventPortType[i]+'()'); //Create New Port
eval('this.'+eventPortName[i]+'.setWorkflow(_40c5)'); //Add port to the workflow
eval('this.'+eventPortName[i]+'.setName("'+eventPortName[i]+'")'); //Set PortName
eval('this.'+eventPortName[i]+'.setZOrder(-1)'); //Set Z-Order of the port to -1. It will be below all the figure
eval('this.'+eventPortName[i]+'.setBackgroundColor(new Color(255, 255, 255))'); //Setting Background of the port to white
eval('this.'+eventPortName[i]+'.setColor(new Color(255, 255, 255))'); //Setting Border of the port to white
eval('this.addPort(this.'+eventPortName[i]+','+eventPositionX[i]+', '+eventPositionY[i]+')'); //Setting Position of the port
}
/*
this.output1=new OutputPort();
this.output1.setWorkflow(_40c5);
this.output1.setName("output1");
this.output1.setBackgroundColor(new Color(115, 115, 245));
this.addPort(this.output1,this.width/2,this.height);
this.output2=new OutputPort();
this.output2.setWorkflow(_40c5);
this.output2.setName("output2");
this.output2.setBackgroundColor(new Color(115, 115, 245));
this.addPort(this.output2,this.width,this.height/2);
this.input1=new InputPort();
this.input1.setWorkflow(_40c5);
this.input1.setName("input1");
this.input1.setBackgroundColor(new Color(245,115,115));
this.addPort(this.input1,0,this.height/2);
this.input2=new InputPort();
this.input2.setWorkflow(_40c5);
this.input2.setName("input2");
this.input2.setBackgroundColor(new Color(245,115,115));
this.addPort(this.input2,this.width/2,0);*/
}
};
bpmnEventCompInter.prototype.getContextMenu=function(){
if(this.id != null){
this.workflow.handleContextMenu(this);
}
};

View File

@@ -0,0 +1,78 @@
bpmnEventEmptyEnd=function(){
VectorFigure.call(this);
this.setDimension(30,30);
this.stroke=3;
};
bpmnEventEmptyEnd.prototype=new VectorFigure;
bpmnEventEmptyEnd.prototype.type="bpmnEventEmptyEnd";
bpmnEventEmptyEnd.prototype.paint=function(){
VectorFigure.prototype.paint.call(this);
if (this.getWidth() < 30 || this.getHeight() < 30) {
this.setDimension(30, 30);
}
var x=0;
var y=0;
this.graphics.setColor("#c0c0c0");
this.graphics.fillEllipse(x+5,y+5,this.getWidth(),this.getHeight());
this.graphics.setStroke(this.stroke);
this.graphics.setColor( "#f7f1e5" );
this.graphics.fillEllipse(x,y,this.getWidth(),this.getHeight());
this.graphics.setColor("#c46508");
this.graphics.drawEllipse(x,y,this.getWidth(),this.getHeight());
this.graphics.paint();
/*Code Added to Dynamically shift Ports on resizing of shapes
**/
if(this.input1!=null){
this.input1.setPosition(0,this.height/2);
}
if(this.output1!=null){
this.output1.setPosition(this.width/2,this.height);
}
if(this.input2!=null){
this.input2.setPosition(this.width/2,0);
}
if(this.output2!=null){
this.output2.setPosition(this.width,this.height/2);
}
};
bpmnEventEmptyEnd.prototype.setWorkflow=function(_40c5){
VectorFigure.prototype.setWorkflow.call(this,_40c5);
if(_40c5!=null){
var eventPortName = ['input1','input2'];
var eventPortType = ['InputPort','InputPort'];
var eventPositionX= [this.width/2,0];
var eventPositionY= [0,this.height/2];
for(var i=0; i< eventPortName.length ; i++){
eval('this.'+eventPortName[i]+' = new '+eventPortType[i]+'()'); //Create New Port
eval('this.'+eventPortName[i]+'.setWorkflow(_40c5)'); //Add port to the workflow
eval('this.'+eventPortName[i]+'.setName("'+eventPortName[i]+'")'); //Set PortName
eval('this.'+eventPortName[i]+'.setZOrder(-1)'); //Set Z-Order of the port to -1. It will be below all the figure
eval('this.'+eventPortName[i]+'.setBackgroundColor(new Color(255, 255, 255))'); //Setting Background of the port to white
eval('this.'+eventPortName[i]+'.setColor(new Color(255, 255, 255))'); //Setting Border of the port to white
eval('this.addPort(this.'+eventPortName[i]+','+eventPositionX[i]+', '+eventPositionY[i]+')'); //Setting Position of the port
}
/*
this.input1=new InputPort();
this.input1.setWorkflow(_40c5);
this.input1.setName("input1");
this.input1.setBackgroundColor(new Color(245,115,115));
this.addPort(this.input1,this.width/2,0);
this.input2=new InputPort();
this.input2.setWorkflow(_40c5);
this.input2.setName("input2");
this.input2.setBackgroundColor(new Color(245,115,115));
this.addPort(this.input2,0,this.height/2);*/
}
};
bpmnEventEmptyEnd.prototype.getContextMenu=function(){
if(this.id != null){
this.workflow.handleContextMenu(this);
}
};

View File

@@ -0,0 +1,78 @@
bpmnEventEmptyInter=function(width,_30ab){
VectorFigure.call(this);
this.setDimension(30,30);
this.stroke=2;
};
bpmnEventEmptyInter.prototype=new VectorFigure;
bpmnEventEmptyInter.prototype.type="bpmnEventEmptyInter";
bpmnEventEmptyInter.prototype.paint=function(){
VectorFigure.prototype.paint.call(this);
if (this.getWidth() < 30 || this.getHeight() < 30) {
this.setDimension(30, 30);
}
this.graphics.setStroke(this.stroke);
var x_cir1 = 0;
var y_cir1 = 0;
this.graphics.setColor("#c0c0c0");
this.graphics.fillEllipse(x_cir1+3,y_cir1+3,this.getWidth(),this.getHeight());
this.graphics.setColor( "#f9faf2" );
this.graphics.fillEllipse(x_cir1,y_cir1,this.getWidth(),this.getHeight());
this.graphics.setColor("#adae5e");
this.graphics.drawEllipse(x_cir1,y_cir1,this.getWidth(),this.getHeight());
var x_cir2=3;
var y_cir2=3;
this.graphics.setColor( "#f9faf2" );
this.graphics.fillEllipse(x_cir2,y_cir2,this.getWidth()-6,this.getHeight()-6);
this.graphics.setColor("#adae5e");
this.graphics.drawEllipse(x_cir2,y_cir2,this.getWidth()-6,this.getHeight()-6);
this.graphics.paint();
/*Code Added to Dynamically shift Ports on resizing of shapes
**/
if(this.input1!=null){
this.input1.setPosition(0,this.height/2);
}
if(this.output1!=null){
this.output1.setPosition(this.width/2,this.height);
}
if(this.input2!=null){
this.input2.setPosition(this.width/2,0);
}
if(this.output2!=null){
this.output2.setPosition(this.width,this.height/2);
}
};
bpmnEventEmptyInter.prototype.setWorkflow=function(_40c5){
VectorFigure.prototype.setWorkflow.call(this,_40c5);
if(_40c5!=null){
var eventPortName = ['input1','input2','output1','output2'];
var eventPortType = ['InputPort','InputPort','OutputPort','OutputPort'];
var eventPositionX= [0,this.width/2,this.width,this.width/2];
var eventPositionY= [this.height/2,0,this.height/2,this.height];
for(var i=0; i< eventPortName.length ; i++){
eval('this.'+eventPortName[i]+' = new '+eventPortType[i]+'()'); //Create New Port
eval('this.'+eventPortName[i]+'.setWorkflow(_40c5)'); //Add port to the workflow
eval('this.'+eventPortName[i]+'.setName("'+eventPortName[i]+'")'); //Set PortName
eval('this.'+eventPortName[i]+'.setZOrder(-1)'); //Set Z-Order of the port to -1. It will be below all the figure
eval('this.'+eventPortName[i]+'.setBackgroundColor(new Color(255, 255, 255))'); //Setting Background of the port to white
eval('this.'+eventPortName[i]+'.setColor(new Color(255, 255, 255))'); //Setting Border of the port to white
eval('this.addPort(this.'+eventPortName[i]+','+eventPositionX[i]+', '+eventPositionY[i]+')'); //Setting Position of the port
}
}
};
bpmnEventEmptyInter.prototype.getContextMenu=function(){
if(this.id != null){
this.workflow.handleContextMenu(this);
}
};

View File

@@ -0,0 +1,70 @@
bpmnEventEmptyStart=function(){
VectorFigure.call(this);
this.setDimension(30,30);
this.stroke=2;
};
bpmnEventEmptyStart.prototype=new VectorFigure;
bpmnEventEmptyStart.prototype.type="bpmnEventEmptyStart";
bpmnEventEmptyStart.prototype.paint=function(){
VectorFigure.prototype.paint.call(this);
if (this.getWidth() < 30 || this.getHeight() < 30) {
this.setDimension(30, 30);
}
var x_cir = 0;
var y_cir = 0;
this.graphics.setColor("#c0c0c0");
this.graphics.fillEllipse(x_cir+4,y_cir+4,this.getWidth(),this.getHeight());
this.graphics.setStroke(this.stroke);
this.graphics.setColor( "#e4f7df" );
this.graphics.fillEllipse(x_cir,y_cir,this.getWidth(),this.getHeight());
this.graphics.setColor("#4aa533");
this.graphics.drawEllipse(x_cir,y_cir,this.getWidth(),this.getHeight());
this.graphics.paint();
/*Code Added to Dynamically shift Ports on resizing of shapes
**/
if(this.input1!=null){
this.input1.setPosition(0,this.height/2);
}
if(this.output1!=null){
this.output1.setPosition(this.width/2,this.height);
}
if(this.input2!=null){
this.input2.setPosition(this.width/2,0);
}
if(this.output2!=null){
this.output2.setPosition(this.width,this.height/2);
}
};
bpmnEventEmptyStart.prototype.setWorkflow=function(_40c5){
VectorFigure.prototype.setWorkflow.call(this,_40c5);
if(_40c5!=null){
var eventPortName = ['output1','output2'];
var eventPortType = ['OutputPort','OutputPort'];
var eventPositionX= [this.width/2,this.width];
var eventPositionY= [this.height,this.height/2];
for(var i=0; i< eventPortName.length ; i++){
eval('this.'+eventPortName[i]+' = new '+eventPortType[i]+'()'); //Create New Port
eval('this.'+eventPortName[i]+'.setWorkflow(_40c5)'); //Add port to the workflow
eval('this.'+eventPortName[i]+'.setName("'+eventPortName[i]+'")'); //Set PortName
eval('this.'+eventPortName[i]+'.setZOrder(-1)'); //Set Z-Order of the port to -1. It will be below all the figure
eval('this.'+eventPortName[i]+'.setBackgroundColor(new Color(255, 255, 255))'); //Setting Background of the port to white
eval('this.'+eventPortName[i]+'.setColor(new Color(255, 255, 255))'); //Setting Border of the port to white
eval('this.addPort(this.'+eventPortName[i]+','+eventPositionX[i]+', '+eventPositionY[i]+')'); //Setting Position of the port
}
}
};
bpmnEventEmptyStart.prototype.getContextMenu=function(){
if(this.id != null){
this.workflow.handleContextMenu(this);
}
};

View File

@@ -0,0 +1,70 @@
bpmnEventEndSignal=function(){
VectorFigure.call(this);
this.setDimension(30,30);
this.stroke=2;
};
bpmnEventEndSignal.prototype=new VectorFigure;
bpmnEventEndSignal.prototype.type="bpmnEventEndSignal";
bpmnEventEndSignal.prototype.paint=function(){
VectorFigure.prototype.paint.call(this);
var x=0;
var y=0;
this.graphics.setColor("#c0c0c0");
this.graphics.fillEllipse(x+5,y+5,this.getWidth(),this.getHeight());
this.graphics.setStroke(this.stroke);
this.graphics.setColor( "#f7f1e5" );
this.graphics.fillEllipse(x,y,this.getWidth(),this.getHeight());
this.graphics.setColor("#c46508");
this.graphics.drawEllipse(x,y,this.getWidth(),this.getHeight());
//var x=new Array(5,41,23);
//var y=new Array(35,35,0);
var x=new Array(5,this.getWidth()-4,this.getWidth()/2);
var y=new Array(this.getHeight()-10,this.getHeight()-10,2);
this.graphics.setColor("#c46508");
this.graphics.fillPolygon(x,y);
this.graphics.setColor("#000000");
//this.graphics.drawPolygon(x,y);
this.graphics.paint();
/*Code Added to Dynamically shift Ports on resizing of shapes
**/
if(this.input1!=null){
this.input1.setPosition(0,this.height/2);
}
if(this.output1!=null){
this.output1.setPosition(this.width/2,this.height);
}
if(this.input2!=null){
this.input2.setPosition(this.width/2,0);
}
if(this.output2!=null){
this.output2.setPosition(this.width,this.height/2);
}
};
bpmnEventEndSignal.prototype.setWorkflow=function(_40c5){
VectorFigure.prototype.setWorkflow.call(this,_40c5);
if(_40c5!=null){
var eventPortName = ['input1','input2'];
var eventPortType = ['InputPort','InputPort'];
var eventPositionX= [this.width/2,0];
var eventPositionY= [0,this.height/2];
for(var i=0; i< eventPortName.length ; i++){
eval('this.'+eventPortName[i]+' = new '+eventPortType[i]+'()'); //Create New Port
eval('this.'+eventPortName[i]+'.setWorkflow(_40c5)'); //Add port to the workflow
eval('this.'+eventPortName[i]+'.setName("'+eventPortName[i]+'")'); //Set PortName
eval('this.'+eventPortName[i]+'.setZOrder(-1)'); //Set Z-Order of the port to -1. It will be below all the figure
eval('this.'+eventPortName[i]+'.setBackgroundColor(new Color(255, 255, 255))'); //Setting Background of the port to white
eval('this.'+eventPortName[i]+'.setColor(new Color(255, 255, 255))'); //Setting Border of the port to white
eval('this.addPort(this.'+eventPortName[i]+','+eventPositionX[i]+', '+eventPositionY[i]+')'); //Setting Position of the port
}
}
};
bpmnEventEndSignal.prototype.getContextMenu=function(){
if(this.id != null){
this.workflow.handleContextMenu(this);
}
};

View File

@@ -0,0 +1,33 @@
bpmnEventEndSignal=function(){
VectorFigure.call(this);
this.setDimension(30,30);
this.stroke=3;
};
bpmnEventEndSignal.prototype=new VectorFigure;
bpmnEventEndSignal.prototype.type="bpmnEventEndSignal";
bpmnEventEndSignal.prototype.paint=function(){
VectorFigure.prototype.paint.call(this);
var x=0;
var y=0;
this.graphics.setStroke(this.stroke);
this.graphics.setColor( "#ffffff" );
this.graphics.fillEllipse(x,y,this.getWidth(),this.getHeight());
this.graphics.setColor("#000000");
this.graphics.drawEllipse(x,y,this.getWidth(),this.getHeight());
//var x=new Array(8,38,22);
//var y=new Array(30,30,4);
var x=new Array(this.getWidth()/5.62,this.getWidth()/1.18,this.getWidth()/2.04);
var y=new Array(this.getHeight()/1.5,this.getHeight()/1.5,this.getHeight()/11.25);
this.graphics.setColor("#000000");
this.graphics.fillPolygon(x,y);
this.graphics.setColor("#000000");
this.graphics.drawPolygon(x,y);
this.graphics.paint();
};
bpmnEventEndSignal.prototype.getContextMenu=function(){
if(this.id != null){
this.workflow.AddEventContextMenu(this.id);
}
};

View File

@@ -0,0 +1,73 @@
bpmnEventErrorEnd=function(){
VectorFigure.call(this);
this.setDimension(30,30);
this.stroke=4;
};
bpmnEventErrorEnd.prototype=new VectorFigure;
bpmnEventErrorEnd.prototype.type="bpmnEventErrorEnd";
bpmnEventErrorEnd.prototype.paint=function(){
VectorFigure.prototype.paint.call(this);
this.graphics.setStroke(this.stroke);
var x_cir = 0;
var y_cir = 0;
this.graphics.setColor("#c0c0c0");
this.graphics.fillEllipse(x_cir+5,y_cir+5,this.getWidth(),this.getHeight());
this.graphics.setColor("#f7f1e5");
this.graphics.fillEllipse(x_cir,y_cir,this.getWidth(),this.getHeight());
this.graphics.setColor("#c46508");
this.graphics.drawEllipse(x_cir,y_cir,this.getWidth(),this.getHeight());
//var x=new Array(7,17,24,34,24,17);
//var y=new Array(33,23,33,13,26,16);
var x=new Array(this.getWidth()/6.4,this.getWidth()/2.6,this.getWidth()/1.87,this.getWidth()/1.32,this.getWidth()/1.87,this.getWidth()/2.6);
var y=new Array(this.getHeight()/1.36,this.getHeight()/1.95,this.getHeight()/1.36,this.getHeight()/3.46,this.getHeight()/1.73,this.getHeight()/2.8);
this.graphics.setStroke(2);
this.graphics.setColor("#c46508");
this.graphics.fillPolygon(x,y);
this.graphics.setColor("#c46508");
this.graphics.drawPolygon(x,y);
this.graphics.paint();
/*Code Added to Dynamically shift Ports on resizing of shapes
**/
if(this.input1!=null){
this.input1.setPosition(0,this.height/2);
}
if(this.output1!=null){
this.output1.setPosition(this.width/2,this.height);
}
if(this.input2!=null){
this.input2.setPosition(this.width/2,0);
}
if(this.output2!=null){
this.output2.setPosition(this.width,this.height/2);
}
};
bpmnEventErrorEnd.prototype.setWorkflow=function(_40c5){
VectorFigure.prototype.setWorkflow.call(this,_40c5);
if(_40c5!=null){
var eventPortName = ['input1','input2'];
var eventPortType = ['InputPort','InputPort'];
var eventPositionX= [this.width/2,0];
var eventPositionY= [0,this.height/2];
for(var i=0; i< eventPortName.length ; i++){
eval('this.'+eventPortName[i]+' = new '+eventPortType[i]+'()'); //Create New Port
eval('this.'+eventPortName[i]+'.setWorkflow(_40c5)'); //Add port to the workflow
eval('this.'+eventPortName[i]+'.setName("'+eventPortName[i]+'")'); //Set PortName
eval('this.'+eventPortName[i]+'.setZOrder(-1)'); //Set Z-Order of the port to -1. It will be below all the figure
eval('this.'+eventPortName[i]+'.setBackgroundColor(new Color(255, 255, 255))'); //Setting Background of the port to white
eval('this.'+eventPortName[i]+'.setColor(new Color(255, 255, 255))'); //Setting Border of the port to white
eval('this.addPort(this.'+eventPortName[i]+','+eventPositionX[i]+', '+eventPositionY[i]+')'); //Setting Position of the port
}
}
};
bpmnEventErrorEnd.prototype.getContextMenu=function(){
if(this.id != null){
this.workflow.handleContextMenu(this);
}
};

View File

@@ -0,0 +1,30 @@
bpmnEventErrorInter=function(){
VectorFigure.call(this);
this.setDimension(45,45);
this.stroke=2;
};
bpmnEventErrorInter.prototype=new VectorFigure;
bpmnEventErrorInter.prototype.type="bpmnEventErrorInter";
bpmnEventErrorInter.prototype.paint=function(){
VectorFigure.prototype.paint.call(this);
this.graphics.setStroke(this.stroke);
var x_cir = 0;
var y_cir = 0;
this.graphics.setColor("#000000");
this.graphics.drawEllipse(x_cir,y_cir,this.getWidth(),this.getHeight());
var x_cir2=5;
var y_cir2=5;
this.graphics.setColor("#000000");
this.graphics.drawEllipse(x_cir2,y_cir2,this.getWidth()-10,this.getHeight()-10);
//var x=new Array(7,17,24,34,24,17);
//var y=new Array(33,23,33,13,26,16);
var x=new Array(this.getWidth()/6.4,this.getWidth()/2.6,this.getWidth()/1.87,this.getWidth()/1.32,this.getWidth()/1.87,this.getWidth()/2.6);
var y=new Array(this.getHeight()/1.36,this.getHeight()/1.95,this.getHeight()/1.36,this.getHeight()/3.46,this.getHeight()/1.73,this.getHeight()/2.8);
this.graphics.setColor("#ffffff");
this.graphics.fillPolygon(x,y);
this.graphics.setColor("#000000");
this.graphics.drawPolygon(x,y);
this.graphics.paint();
};

View File

@@ -0,0 +1,78 @@
bpmnEventInterSignal=function(){
VectorFigure.call(this);
this.setDimension(30,30);
this.stroke=2;
};
bpmnEventInterSignal.prototype=new VectorFigure;
bpmnEventInterSignal.prototype.type="bpmnEventInterSignal";
bpmnEventInterSignal.prototype.paint=function(){
VectorFigure.prototype.paint.call(this);
this.graphics.setStroke(this.stroke);
var x_cir = 0;
var y_cir = 0;
this.graphics.setColor("#c0c0c0");
this.graphics.fillEllipse(x_cir+3,y_cir+3,this.getWidth(),this.getHeight());
this.graphics.setColor("#f9faf2");
this.graphics.fillEllipse(x_cir,y_cir,this.getWidth(),this.getHeight());
this.graphics.setColor("#adae5e");
this.graphics.drawEllipse(x_cir,y_cir,this.getWidth(),this.getHeight());
var x_cir2=5;
var y_cir2=5;
this.graphics.setColor("#f9faf2");
this.graphics.fillEllipse(x_cir2,y_cir2,this.getWidth()-10,this.getHeight()-10);
this.graphics.setColor("#adae5e");
this.graphics.drawEllipse(x_cir2,y_cir2,this.getWidth()-10,this.getHeight()-10);
//var x=new Array(12,32,22);
//var y=new Array(32,32,9);
var x=new Array(this.getWidth()/3.75,this.getWidth()/1.4,this.getWidth()/2.04);
var y=new Array(this.getHeight()/1.4,this.getHeight()/1.4,this.getHeight()/5);
this.graphics.setColor("#adae5e");
this.graphics.fillPolygon(x,y);
this.graphics.setColor("#adae5e");
this.graphics.drawPolygon(x,y);
this.graphics.paint();
/*Code Added to Dynamically shift Ports on resizing of shapes
**/
if(this.input1!=null){
this.input1.setPosition(0,this.height/2);
}
if(this.output1!=null){
this.output1.setPosition(this.width/2,this.height);
}
if(this.input2!=null){
this.input2.setPosition(this.width/2,0);
}
if(this.output2!=null){
this.output2.setPosition(this.width,this.height/2);
}
};
bpmnEventInterSignal.prototype.setWorkflow=function(_40c5){
VectorFigure.prototype.setWorkflow.call(this,_40c5);
if(_40c5!=null){
var eventPortName = ['input1','input2','output1','output2'];
var eventPortType = ['InputPort','InputPort','OutputPort','OutputPort'];
var eventPositionX= [0,this.width/2,this.width,this.width/2];
var eventPositionY= [this.height/2,0,this.height/2,this.height];
for(var i=0; i< eventPortName.length ; i++){
eval('this.'+eventPortName[i]+' = new '+eventPortType[i]+'()'); //Create New Port
eval('this.'+eventPortName[i]+'.setWorkflow(_40c5)'); //Add port to the workflow
eval('this.'+eventPortName[i]+'.setName("'+eventPortName[i]+'")'); //Set PortName
eval('this.'+eventPortName[i]+'.setZOrder(-1)'); //Set Z-Order of the port to -1. It will be below all the figure
eval('this.'+eventPortName[i]+'.setBackgroundColor(new Color(255, 255, 255))'); //Setting Background of the port to white
eval('this.'+eventPortName[i]+'.setColor(new Color(255, 255, 255))'); //Setting Border of the port to white
eval('this.addPort(this.'+eventPortName[i]+','+eventPositionX[i]+', '+eventPositionY[i]+')'); //Setting Position of the port
}
}
};
bpmnEventInterSignal.prototype.getContextMenu=function(){
if(this.id != null){
this.workflow.handleContextMenu(this);
}
};

View File

@@ -0,0 +1,26 @@
bpmnEventLinkEnd=function(){
VectorFigure.call(this);
this.setDimension(45,45);
this.stroke=3;
};
bpmnEventLinkEnd.prototype=new VectorFigure;
bpmnEventLinkEnd.prototype.type="bpmnEventLinkEnd";
bpmnEventLinkEnd.prototype.paint=function(){
VectorFigure.prototype.paint.call(this);
var x_cir = -4;
var y_cir = -4;
this.graphics.setStroke(this.stroke);
this.graphics.setColor("#000000");
this.graphics.drawEllipse(x_cir,y_cir,this.getWidth(),this.getHeight());
//var x_arrow=new Array(4,4,22,22,37,22,22); //Arrow working
//var y_arrow=new Array(11,26,26,31,18.5,6,11);
var x_arrow=new Array(4,4,this.getWidth()/2,this.getWidth()/2,this.getWidth()/1.2,this.getWidth()/2,this.getWidth()/2);
var y_arrow=new Array(this.getHeight()/4,this.getHeight()/1.7,this.getHeight()/1.7,this.getHeight()/1.5,this.getHeight()/2.5,this.getHeight()/7,this.getHeight()/4);
this.graphics.setColor( "#000000" );
this.graphics.fillPolygon(x_arrow,y_arrow);
this.graphics.setColor("#000000");
this.graphics.drawPolygon(x_arrow,y_arrow);
this.graphics.paint();
};

View File

@@ -0,0 +1,74 @@
bpmnEventLinkInter=function(){
VectorFigure.call(this);
this.setDimension(30,30);
this.stroke=2;
};
bpmnEventLinkInter.prototype=new VectorFigure;
bpmnEventLinkInter.prototype.type="bpmnEventLinkInter";
bpmnEventLinkInter.prototype.paint=function(){
VectorFigure.prototype.paint.call(this);
var x_cir = -4;
var y_cir = -4;
this.graphics.setColor("#c0c0c0");
this.graphics.fillEllipse(x_cir+3,y_cir+3,this.getWidth(),this.getHeight());
this.graphics.setColor("#f9faf2");
this.graphics.fillEllipse(x_cir,y_cir,this.getWidth(),this.getHeight());
this.graphics.setStroke(this.stroke);
this.graphics.setColor("#adae5e");
this.graphics.drawEllipse(x_cir,y_cir,this.getWidth(),this.getHeight());
var x_cir2=-1;
var y_cir2=-1;
this.graphics.setColor("#adae5e");
this.graphics.drawEllipse(x_cir2,y_cir2,this.getWidth()-6,this.getHeight()-6);
//var x_arrow=new Array(4,4,22,22,37,22,22); //Arrow working
//var y_arrow=new Array(11,26,26,31,18.5,6,11);
var x_arrow=new Array(4,4,this.getWidth()/2,this.getWidth()/2,this.getWidth()/1.2,this.getWidth()/2,this.getWidth()/2);
var y_arrow=new Array(this.getHeight()/4,this.getHeight()/1.7,this.getHeight()/1.7,this.getHeight()/1.5,this.getHeight()/2.5,this.getHeight()/7,this.getHeight()/4);
this.graphics.setColor( "#adae5e" );
this.graphics.fillPolygon(x_arrow,y_arrow);
this.graphics.setColor("#adae5e");
this.graphics.drawPolygon(x_arrow,y_arrow);
this.graphics.paint();
/*Code Added to Dynamically shift Ports on resizing of shapes
**/
if(this.input1!=null){
this.input1.setPosition(0,this.height/2);
}
if(this.output1!=null){
this.output1.setPosition(this.width/2,this.height);
}
if(this.input2!=null){
this.input2.setPosition(this.width/2,0);
}
if(this.output2!=null){
this.output2.setPosition(this.width,this.height/2);
}
};
bpmnEventLinkInter.prototype.setWorkflow=function(_40c5){
VectorFigure.prototype.setWorkflow.call(this,_40c5);
if(_40c5!=null){
var eventPortName = ['input1','input2','output1','output2'];
var eventPortType = ['InputPort','InputPort','OutputPort','OutputPort'];
var eventPositionX= [0,this.width/2,this.width,this.width/2];
var eventPositionY= [this.height/2,0,this.height/2,this.height];
for(var i=0; i< eventPortName.length ; i++){
eval('this.'+eventPortName[i]+' = new '+eventPortType[i]+'()'); //Create New Port
eval('this.'+eventPortName[i]+'.setWorkflow(_40c5)'); //Add port to the workflow
eval('this.'+eventPortName[i]+'.setName("'+eventPortName[i]+'")'); //Set PortName
eval('this.'+eventPortName[i]+'.setZOrder(-1)'); //Set Z-Order of the port to -1. It will be below all the figure
eval('this.'+eventPortName[i]+'.setBackgroundColor(new Color(255, 255, 255))'); //Setting Background of the port to white
eval('this.'+eventPortName[i]+'.setColor(new Color(255, 255, 255))'); //Setting Border of the port to white
eval('this.addPort(this.'+eventPortName[i]+','+eventPositionX[i]+', '+eventPositionY[i]+')'); //Setting Position of the port
}
}
};
bpmnEventLinkInter.prototype.getContextMenu=function(){
if(this.id != null){
this.workflow.handleContextMenu(this);
}
};

View File

@@ -0,0 +1,32 @@
bpmnEventLinkStart=function(){
VectorFigure.call(this);
this.setDimension(45,45);
this.stroke=2
};
bpmnEventLinkStart.prototype=new VectorFigure;
bpmnEventLinkStart.prototype.type="bpmnEventLinkStart";
bpmnEventLinkStart.prototype.paint=function(){
VectorFigure.prototype.paint.call(this);
var x_cir = -4;
var y_cir = -4;
this.graphics.setStroke(this.stroke);
this.graphics.setColor("#000000");
this.graphics.drawEllipse(x_cir,y_cir,this.getWidth(),this.getHeight());
//var x_arrow=new Array(4,4,22,22,37,22,22); //Arrow working
//var y_arrow=new Array(11,26,26,31,18.5,6,11);
var x_arrow=new Array(4,4,this.getWidth()/2,this.getWidth()/2,this.getWidth()/1.2,this.getWidth()/2,this.getWidth()/2);
var y_arrow=new Array(this.getHeight()/4,this.getHeight()/1.7,this.getHeight()/1.7,this.getHeight()/1.5,this.getHeight()/2.5,this.getHeight()/7,this.getHeight()/4);
this.graphics.setColor( "#ffffff" );
this.graphics.fillPolygon(x_arrow,y_arrow);
this.graphics.setColor("#000000");
this.graphics.drawPolygon(x_arrow,y_arrow);
this.graphics.paint();
};

View File

@@ -0,0 +1,83 @@
bpmnEventMessageEnd=function(){
VectorFigure.call(this);
this.setDimension(30,30);
this.stroke = 3;
};
bpmnEventMessageEnd.prototype=new VectorFigure;
bpmnEventMessageEnd.prototype.type="bpmnEventMessageEnd";
bpmnEventMessageEnd.prototype.paint=function(){
VectorFigure.prototype.paint.call(this);
if (this.getWidth() < 30 || this.getHeight() < 30) {
this.setDimension(30, 30);
}
var x_cir = 0;
var y_cir = 0;
this.graphics.setColor("#c0c0c0");
this.graphics.fillEllipse(x_cir+5,y_cir+5,this.getWidth(),this.getHeight());
this.graphics.setStroke(this.stroke);
this.graphics.setColor( "#f7f1e5");
this.graphics.fillEllipse(x_cir,y_cir,this.getWidth(),this.getHeight());
this.graphics.setColor("#c46508");
this.graphics.drawEllipse(x_cir,y_cir,this.getWidth(),this.getHeight());
this.graphics.setStroke(2);
//var x=new Array(12,12,35,35,23.5,12);
//var y=new Array(16,33,33,17,26,17);
var x=new Array(this.getWidth()/3.75,this.getWidth()/3.75,this.getWidth()/1.28,this.getWidth()/1.28,this.getWidth()/2,this.getWidth()/3.75,this.getWidth()/3.75);
var y=new Array(this.getHeight()/3.21,this.getHeight()/1.36,this.getHeight()/1.36,this.getHeight()/2.64,this.getHeight()/1.73,this.getHeight()/2.64);
this.graphics.setColor( "#c46508" );
this.graphics.fillPolygon(x,y);
this.graphics.setColor("#c46508");
//this.graphics.drawPolygon(x,y);
//var x_tri=new Array(12,23.5,35);
//var y_tri=new Array(13,22,13);
var x_tri=new Array(this.getWidth()/3.75,this.getWidth()/1.91,this.getWidth()/1.28);
var y_tri=new Array(this.getHeight()/3.46,this.getHeight()/2.04,this.getHeight()/3.46);
this.graphics.setColor( "#c46508" );
this.graphics.fillPolygon(x_tri,y_tri);
this.graphics.setColor("#c46508");
//this.graphics.drawPolygon(x_tri,y_tri);
this.graphics.paint();
/*Code Added to Dynamically shift Ports on resizing of shapes
**/
if(this.input1!=null){
this.input1.setPosition(0,this.height/2);
}
if(this.output1!=null){
this.output1.setPosition(this.width/2,this.height);
}
if(this.input2!=null){
this.input2.setPosition(this.width/2,0);
}
if(this.output2!=null){
this.output2.setPosition(this.width,this.height/2);
}
};
bpmnEventMessageEnd.prototype.setWorkflow=function(_40c5){
VectorFigure.prototype.setWorkflow.call(this,_40c5);
if(_40c5!=null){
var eventPortName = ['input1','input2'];
var eventPortType = ['InputPort','InputPort'];
var eventPositionX= [this.width/2,0];
var eventPositionY= [0,this.height/2];
for(var i=0; i< eventPortName.length ; i++){
eval('this.'+eventPortName[i]+' = new '+eventPortType[i]+'()'); //Create New Port
eval('this.'+eventPortName[i]+'.setWorkflow(_40c5)'); //Add port to the workflow
eval('this.'+eventPortName[i]+'.setName("'+eventPortName[i]+'")'); //Set PortName
eval('this.'+eventPortName[i]+'.setZOrder(-1)'); //Set Z-Order of the port to -1. It will be below all the figure
eval('this.'+eventPortName[i]+'.setBackgroundColor(new Color(255, 255, 255))'); //Setting Background of the port to white
eval('this.'+eventPortName[i]+'.setColor(new Color(255, 255, 255))'); //Setting Border of the port to white
eval('this.addPort(this.'+eventPortName[i]+','+eventPositionX[i]+', '+eventPositionY[i]+')'); //Setting Position of the port
}
}
};
bpmnEventMessageEnd.prototype.getContextMenu=function(){
if(this.id != null){
this.workflow.handleContextMenu(this);
}
};

View File

@@ -0,0 +1,55 @@
bpmnEventMessageInter=function(){
VectorFigure.call(this);
this.setDimension(30,30);
this.stroke=2;
};
bpmnEventMessageInter.prototype=new VectorFigure;
bpmnEventMessageInter.prototype.type="bpmnEventMessageInter";
bpmnEventMessageInter.prototype.paint=function(){
VectorFigure.prototype.paint.call(this);
var x_cir = 0;
var y_cir = 0;
this.graphics.setColor("#c0c0c0");
this.graphics.fillEllipse(x_cir+3,y_cir+3,this.getWidth(),this.getHeight());
this.graphics.setStroke(this.stroke);
this.graphics.setColor( "#f9faf2");
this.graphics.fillEllipse(x_cir,y_cir,this.getWidth(),this.getHeight());
this.graphics.setColor("#adae5e");
this.graphics.drawEllipse(x_cir,y_cir,this.getWidth(),this.getHeight());
var x_cir2=3;
var y_cir2=3;
this.graphics.setColor( "#f9faf2" );
this.graphics.fillEllipse(x_cir2,y_cir2,this.getWidth()-6,this.getHeight()-6);
this.graphics.setColor("#adae5e");
this.graphics.drawEllipse(x_cir2,y_cir2,this.getWidth()-6,this.getHeight()-6);
//var x=new Array(12,12,32,32,22,12,32);
//var y=new Array(14,31,31,14,23,14,14);
var x=new Array(this.getWidth()/3.75,this.getWidth()/3.75,this.getWidth()/1.28,this.getWidth()/1.28,this.getWidth()/2,this.getWidth()/3.75,this.getWidth()/3.75);
var y=new Array(this.getHeight()/3.21,this.getHeight()/1.36,this.getHeight()/1.36,this.getHeight()/2.64,this.getHeight()/1.73,this.getHeight()/2.64);
this.graphics.setStroke(1);
this.graphics.setColor( "#adae5e" );
//this.graphics.fillPolygon(x,y);
this.graphics.setColor("#adae5e");
this.graphics.drawPolygon(x,y);
//var x_tri=new Array(12,23.5,35);
//var y_tri=new Array(13,22,13);
var x_tri=new Array(this.getWidth()/3.75,this.getWidth()/1.91,this.getWidth()/1.28);
var y_tri=new Array(this.getHeight()/3.46,this.getHeight()/2.04,this.getHeight()/3.46);
this.graphics.setColor( "#adae5e" );
//this.graphics.fillPolygon(x_tri,y_tri);
this.graphics.setColor("#adae5e");
this.graphics.drawPolygon(x_tri,y_tri);
this.graphics.paint();
};
bpmnEventMessageInter.prototype.getContextMenu=function(){
if(this.id != null){
this.workflow.handleContextMenu(this);
}
};

View File

@@ -0,0 +1,90 @@
bpmnEventMessageRecInter=function(){
VectorFigure.call(this);
this.setDimension(30,30);
this.stroke=2;
};
bpmnEventMessageRecInter.prototype=new VectorFigure;
bpmnEventMessageRecInter.prototype.type="bpmnEventMessageRecInter";
bpmnEventMessageRecInter.prototype.paint=function(){
VectorFigure.prototype.paint.call(this);
var x_cir = 0;
var y_cir = 0;
this.graphics.setColor("#c0c0c0");
this.graphics.fillEllipse(x_cir+3,y_cir+3,this.getWidth(),this.getHeight());
this.graphics.setStroke(this.stroke);
this.graphics.setColor( "#f9faf2");
this.graphics.fillEllipse(x_cir,y_cir,this.getWidth(),this.getHeight());
this.graphics.setColor("#adae5e");
this.graphics.drawEllipse(x_cir,y_cir,this.getWidth(),this.getHeight());
var x_cir2=3;
var y_cir2=3;
this.graphics.setColor( "#f9faf2" );
this.graphics.fillEllipse(x_cir2,y_cir2,this.getWidth()-6,this.getHeight()-6);
this.graphics.setColor("#adae5e");
this.graphics.drawEllipse(x_cir2,y_cir2,this.getWidth()-6,this.getHeight()-6);
//var x=new Array(12,12,32,32,22,12,32);
//var y=new Array(14,31,31,14,23,14,14);
var x=new Array(this.getWidth()/3.75,this.getWidth()/3.75,this.getWidth()/1.28,this.getWidth()/1.28,this.getWidth()/1.95,this.getWidth()/3.75);
var y=new Array(this.getHeight()/2.64,this.getHeight()/1.36,this.getHeight()/1.36,this.getHeight()/2.64,this.getHeight()/1.73,this.getHeight()/2.64);
this.graphics.setStroke(1);
this.graphics.setColor( "#adae5e" );
//this.graphics.fillPolygon(x,y);
this.graphics.setColor("#adae5e");
this.graphics.drawPolygon(x,y);
//var x_tri=new Array(12,23.5,35);
//var y_tri=new Array(13,22,13);
var x_tri=new Array(this.getWidth()/3.75,this.getWidth()/1.91,this.getWidth()/1.28);
var y_tri=new Array(this.getHeight()/3.46,this.getHeight()/2.04,this.getHeight()/3.46);
this.graphics.setColor( "#adae5e" );
//this.graphics.fillPolygon(x_tri,y_tri);
this.graphics.setColor("#adae5e");
this.graphics.drawPolygon(x_tri,y_tri);
this.graphics.paint();
/*Code Added to Dynamically shift Ports on resizing of shapes
**/
if(this.input1!=null){
this.input1.setPosition(0,this.height/2);
}
if(this.output1!=null){
this.output1.setPosition(this.width/2,this.height);
}
if(this.input2!=null){
this.input2.setPosition(this.width/2,0);
}
if(this.output2!=null){
this.output2.setPosition(this.width,this.height/2);
}
};
bpmnEventMessageRecInter.prototype.setWorkflow=function(_40c5){
VectorFigure.prototype.setWorkflow.call(this,_40c5);
if(_40c5!=null){
var eventPortName = ['input1','input2','output1','output2'];
var eventPortType = ['InputPort','InputPort','OutputPort','OutputPort'];
var eventPositionX= [0,this.width/2,this.width,this.width/2];
var eventPositionY= [this.height/2,0,this.height/2,this.height];
for(var i=0; i< eventPortName.length ; i++){
eval('this.'+eventPortName[i]+' = new '+eventPortType[i]+'()'); //Create New Port
eval('this.'+eventPortName[i]+'.setWorkflow(_40c5)'); //Add port to the workflow
eval('this.'+eventPortName[i]+'.setName("'+eventPortName[i]+'")'); //Set PortName
eval('this.'+eventPortName[i]+'.setZOrder(-1)'); //Set Z-Order of the port to -1. It will be below all the figure
eval('this.'+eventPortName[i]+'.setBackgroundColor(new Color(255, 255, 255))'); //Setting Background of the port to white
eval('this.'+eventPortName[i]+'.setColor(new Color(255, 255, 255))'); //Setting Border of the port to white
eval('this.addPort(this.'+eventPortName[i]+','+eventPositionX[i]+', '+eventPositionY[i]+')'); //Setting Position of the port
}
}
};
bpmnEventMessageRecInter.prototype.getContextMenu=function(){
if(this.id != null){
this.workflow.handleContextMenu(this);
}
};

View File

@@ -0,0 +1,91 @@
bpmnEventMessageSendInter=function(){
VectorFigure.call(this);
this.setDimension(30,30);
this.stroke=2;
};
bpmnEventMessageSendInter.prototype=new VectorFigure;
bpmnEventMessageSendInter.prototype.type="bpmnEventMessageSendInter";
bpmnEventMessageSendInter.prototype.paint=function(){
VectorFigure.prototype.paint.call(this);
var x_cir = 0;
var y_cir = 0;
this.graphics.setColor("#c0c0c0");
this.graphics.fillEllipse(x_cir+3,y_cir+3,this.getWidth(),this.getHeight());
this.graphics.setStroke(this.stroke);
this.graphics.setColor( "#f9faf2");
this.graphics.fillEllipse(x_cir,y_cir,this.getWidth(),this.getHeight());
this.graphics.setColor("#adae5e");
this.graphics.drawEllipse(x_cir,y_cir,this.getWidth(),this.getHeight());
var x_cir2=3;
var y_cir2=3;
this.graphics.setColor( "#f9faf2" );
this.graphics.fillEllipse(x_cir2,y_cir2,this.getWidth()-6,this.getHeight()-6);
this.graphics.setColor("#adae5e");
this.graphics.drawEllipse(x_cir2,y_cir2,this.getWidth()-6,this.getHeight()-6);
//var x=new Array(12,12,32,32,22,12,32);
//var y=new Array(14,31,31,14,23,14,14);
var x=new Array(this.getWidth()/3.75,this.getWidth()/3.75,this.getWidth()/1.28,this.getWidth()/1.28,this.getWidth()/1.95,this.getWidth()/3.75);
var y=new Array(this.getHeight()/2.64,this.getHeight()/1.36,this.getHeight()/1.36,this.getHeight()/2.64,this.getHeight()/1.73,this.getHeight()/2.64);
this.graphics.setStroke(1);
this.graphics.setColor( "#adae5e" );
this.graphics.fillPolygon(x,y);
this.graphics.setColor("#adae5e");
//this.graphics.drawPolygon(x,y);
//var x_tri=new Array(12,23.5,35);
//var y_tri=new Array(13,22,13);
var x_tri=new Array(this.getWidth()/3.75,this.getWidth()/1.91,this.getWidth()/1.28);
var y_tri=new Array(this.getHeight()/3.46,this.getHeight()/2.04,this.getHeight()/3.46);
this.graphics.setColor( "#adae5e" );
this.graphics.fillPolygon(x_tri,y_tri);
this.graphics.setColor("#adae5e");
//this.graphics.drawPolygon(x_tri,y_tri);
this.graphics.paint();
/*Code Added to Dynamically shift Ports on resizing of shapes
**/
if(this.input1!=null){
this.input1.setPosition(0,this.height/2);
}
if(this.output1!=null){
this.output1.setPosition(this.width/2,this.height);
}
if(this.input2!=null){
this.input2.setPosition(this.width/2,0);
}
if(this.output2!=null){
this.output2.setPosition(this.width,this.height/2);
}
};
bpmnEventMessageSendInter.prototype.setWorkflow=function(_40c5){
VectorFigure.prototype.setWorkflow.call(this,_40c5);
if(_40c5!=null){
var eventPortName = ['input1','input2','output1','output2'];
var eventPortType = ['InputPort','InputPort','OutputPort','OutputPort'];
var eventPositionX= [0,this.width/2,this.width,this.width/2];
var eventPositionY= [this.height/2,0,this.height/2,this.height];
for(var i=0; i< eventPortName.length ; i++){
eval('this.'+eventPortName[i]+' = new '+eventPortType[i]+'()'); //Create New Port
eval('this.'+eventPortName[i]+'.setWorkflow(_40c5)'); //Add port to the workflow
eval('this.'+eventPortName[i]+'.setName("'+eventPortName[i]+'")'); //Set PortName
eval('this.'+eventPortName[i]+'.setZOrder(-1)'); //Set Z-Order of the port to -1. It will be below all the figure
eval('this.'+eventPortName[i]+'.setBackgroundColor(new Color(255, 255, 255))'); //Setting Background of the port to white
eval('this.'+eventPortName[i]+'.setColor(new Color(255, 255, 255))'); //Setting Border of the port to white
eval('this.addPort(this.'+eventPortName[i]+','+eventPositionX[i]+', '+eventPositionY[i]+')'); //Setting Position of the port
}
}
};
bpmnEventMessageSendInter.prototype.getContextMenu=function(){
if(this.id != null){
this.workflow.handleContextMenu(this);
}
};

View File

@@ -0,0 +1,84 @@
bpmnEventMessageStart=function(){
VectorFigure.call(this);
this.setDimension(30,30);
this.stroke = 3;
};
bpmnEventMessageStart.prototype=new VectorFigure;
bpmnEventMessageStart.prototype.type="bpmnEventMessageStart";
bpmnEventMessageStart.prototype.paint=function(){
VectorFigure.prototype.paint.call(this);
if (this.getWidth() < 30 || this.getHeight() < 30) {
this.setDimension(30, 30);
}
var x_cir = 0;
var y_cir = 0;
this.graphics.setColor("#c0c0c0");
this.graphics.fillEllipse(x_cir+5,y_cir+5,this.getWidth(),this.getHeight());
this.graphics.setStroke(this.stroke);
this.graphics.setColor( "#e4f7df");
this.graphics.fillEllipse(x_cir,y_cir,this.getWidth(),this.getHeight());
this.graphics.setColor("#4aa533");
this.graphics.drawEllipse(x_cir,y_cir,this.getWidth(),this.getHeight());
this.graphics.setStroke(0);
//var x=new Array(12,12,35,35,23.5,12);
//var y=new Array(16,33,33,17,26,17);
var x=new Array(this.getWidth()/3.75,this.getWidth()/3.75,this.getWidth()/1.28,this.getWidth()/1.28,this.getWidth()/1.91,this.getWidth()/3.75);
var y=new Array(this.getHeight()/2.64,this.getHeight()/1.36,this.getHeight()/1.36,this.getHeight()/2.8,this.getHeight()/1.7,this.getHeight()/2.8);
this.graphics.setColor( "#4aa533" );
//this.graphics.fillPolygon(x,y);
this.graphics.setColor("#4aa533");
this.graphics.drawPolygon(x,y);
//var x_tri=new Array(12,23.5,35);
//var y_tri=new Array(13,22,13);
var x_tri=new Array(this.getWidth()/3.75,this.getWidth()/1.91,this.getWidth()/1.28);
var y_tri=new Array(this.getHeight()/3.46,this.getHeight()/2.04,this.getHeight()/3.46);
this.graphics.setColor( "#e4f7df" );
//this.graphics.fillPolygon(x_tri,y_tri);
this.graphics.setColor("#4aa533");
this.graphics.drawPolygon(x_tri,y_tri);
this.graphics.paint();
/*Code Added to Dynamically shift Ports on resizing of shapes
**/
if(this.input1!=null){
this.input1.setPosition(0,this.height/2);
}
if(this.output1!=null){
this.output1.setPosition(this.width/2,this.height);
}
if(this.input2!=null){
this.input2.setPosition(this.width/2,0);
}
if(this.output2!=null){
this.output2.setPosition(this.width,this.height/2);
}
};
bpmnEventMessageStart.prototype.setWorkflow=function(_40c5){
VectorFigure.prototype.setWorkflow.call(this,_40c5);
if(_40c5!=null){
var eventPortName = ['output1','output2'];
var eventPortType = ['OutputPort','OutputPort'];
var eventPositionX= [this.width/2,this.width];
var eventPositionY= [this.height,this.height/2];
for(var i=0; i< eventPortName.length ; i++){
eval('this.'+eventPortName[i]+' = new '+eventPortType[i]+'()'); //Create New Port
eval('this.'+eventPortName[i]+'.setWorkflow(_40c5)'); //Add port to the workflow
eval('this.'+eventPortName[i]+'.setName("'+eventPortName[i]+'")'); //Set PortName
eval('this.'+eventPortName[i]+'.setZOrder(-1)'); //Set Z-Order of the port to -1. It will be below all the figure
eval('this.'+eventPortName[i]+'.setBackgroundColor(new Color(255, 255, 255))'); //Setting Background of the port to white
eval('this.'+eventPortName[i]+'.setColor(new Color(255, 255, 255))'); //Setting Border of the port to white
eval('this.addPort(this.'+eventPortName[i]+','+eventPositionX[i]+', '+eventPositionY[i]+')'); //Setting Position of the port
}
}
};
bpmnEventMessageStart.prototype.getContextMenu=function(){
if(this.id != null){
this.workflow.handleContextMenu(this);
}
};

View File

@@ -0,0 +1,70 @@
bpmnEventMulStart=function(){
VectorFigure.call(this);
this.setDimension(30,30);
this.stroke= 2;
};
bpmnEventMulStart.prototype=new VectorFigure;
bpmnEventMulStart.prototype.type="bpmnEventMulStart";
bpmnEventMulStart.prototype.paint=function(){
VectorFigure.prototype.paint.call(this);
var x=0;
var y=0;
this.graphics.setStroke(this.stroke);
this.graphics.setColor("#c0c0c0");
this.graphics.fillEllipse(x+3,y+3,this.getWidth(),this.getHeight());
this.graphics.setColor( "#e4f7df" );
this.graphics.fillEllipse(x,y,this.getWidth(),this.getHeight());
this.graphics.setColor("#4aa533");
this.graphics.drawEllipse(x,y,this.getWidth(),this.getHeight());
//var x_penta=new Array(13,28,36,22,8);(8.5,18.5,24,14.5,5
//var y_penta=new Array(33,33,18,8,18);(22,22,12,5,12
var x_penta=new Array(this.getWidth()/3.5,this.getWidth()/1.6,this.getWidth()/1.25,this.getWidth()/2,this.getWidth()/5.6);
var y_penta=new Array(this.getHeight()/1.36,this.getHeight()/1.36,this.getHeight()/2.5,this.getHeight()/5.6,this.getHeight()/2.5);
//this.graphics.setStroke(1);
this.graphics.setColor( "#4aa533" );
this.graphics.fillPolygon(x_penta,y_penta);
this.graphics.setColor("#4aa533");
this.graphics.drawPolygon(x_penta,y_penta);
this.graphics.paint();
/*Code Added to Dynamically shift Ports on resizing of shapes
**/
if(this.input1!=null){
this.input1.setPosition(0,this.height/2);
}
if(this.output1!=null){
this.output1.setPosition(this.width/2,this.height);
}
if(this.input2!=null){
this.input2.setPosition(this.width/2,0);
}
if(this.output2!=null){
this.output2.setPosition(this.width,this.height/2);
}
};
bpmnEventMulStart.prototype.setWorkflow=function(_40c5){
VectorFigure.prototype.setWorkflow.call(this,_40c5);
if(_40c5!=null){
var eventPortName = ['output1','output2'];
var eventPortType = ['OutputPort','OutputPort'];
var eventPositionX= [this.width/2,this.width];
var eventPositionY= [this.height,this.height/2];
for(var i=0; i< eventPortName.length ; i++){
eval('this.'+eventPortName[i]+' = new '+eventPortType[i]+'()'); //Create New Port
eval('this.'+eventPortName[i]+'.setWorkflow(_40c5)'); //Add port to the workflow
eval('this.'+eventPortName[i]+'.setName("'+eventPortName[i]+'")'); //Set PortName
eval('this.'+eventPortName[i]+'.setZOrder(-1)'); //Set Z-Order of the port to -1. It will be below all the figure
eval('this.'+eventPortName[i]+'.setBackgroundColor(new Color(255, 255, 255))'); //Setting Background of the port to white
eval('this.'+eventPortName[i]+'.setColor(new Color(255, 255, 255))'); //Setting Border of the port to white
eval('this.addPort(this.'+eventPortName[i]+','+eventPositionX[i]+', '+eventPositionY[i]+')'); //Setting Position of the port
}
}
};
bpmnEventMulStart.prototype.getContextMenu=function(){
if(this.id != null){
this.workflow.handleContextMenu(this);
}
};

View File

@@ -0,0 +1,72 @@
bpmnEventMultipleEnd=function(){
VectorFigure.call(this);
this.setDimension(30,30);
this.stroke=2;
};
bpmnEventMultipleEnd.prototype=new VectorFigure;
bpmnEventMultipleEnd.prototype.type="bpmnEventMultipleEnd";
bpmnEventMultipleEnd.prototype.paint=function(){
VectorFigure.prototype.paint.call(this);
VectorFigure.prototype.paint.call(this);
this.graphics.setStroke(this.stroke);
var x_cir = 0;
var y_cir = 0;
this.graphics.setColor("#c0c0c0");
this.graphics.fillEllipse(x_cir+5,y_cir+5,this.getWidth(),this.getHeight());
this.graphics.setStroke(this.stroke);
this.graphics.setColor( "#f7f1e5" );
this.graphics.fillEllipse(x_cir,y_cir,this.getWidth(),this.getHeight());
this.graphics.setColor("#c46508");
this.graphics.drawEllipse(x_cir,y_cir,this.getWidth(),this.getHeight());
//var x_penta=new Array(12.5,27.5,35.5,21.5,8);
//var y_penta=new Array(33,33,18,8,18);
var x_penta=new Array(this.getWidth()/3.6,this.getWidth()/1.63,this.getWidth()/1.26,this.getWidth()/2.14,this.getWidth()/5.6);
var y_penta=new Array(this.getHeight()/1.36,this.getHeight()/1.36,this.getHeight()/2.5,this.getHeight()/5.6,this.getHeight()/2.5);
this.graphics.setColor( "#c46508" );
this.graphics.fillPolygon(x_penta,y_penta);
this.graphics.setColor("#c46508");
//this.graphics.drawPolygon(x_penta,y_penta);
this.graphics.paint();
/*Code Added to Dynamically shift Ports on resizing of shapes
**/
if(this.input1!=null){
this.input1.setPosition(0,this.height/2);
}
if(this.output1!=null){
this.output1.setPosition(this.width/2,this.height);
}
if(this.input2!=null){
this.input2.setPosition(this.width/2,0);
}
if(this.output2!=null){
this.output2.setPosition(this.width,this.height/2);
}
};
bpmnEventMultipleEnd.prototype.setWorkflow=function(_40c5){
VectorFigure.prototype.setWorkflow.call(this,_40c5);
if(_40c5!=null){
var eventPortName = ['input1','input2'];
var eventPortType = ['InputPort','InputPort'];
var eventPositionX= [this.width/2,0];
var eventPositionY= [0,this.height/2];
for(var i=0; i< eventPortName.length ; i++){
eval('this.'+eventPortName[i]+' = new '+eventPortType[i]+'()'); //Create New Port
eval('this.'+eventPortName[i]+'.setWorkflow(_40c5)'); //Add port to the workflow
eval('this.'+eventPortName[i]+'.setName("'+eventPortName[i]+'")'); //Set PortName
eval('this.'+eventPortName[i]+'.setZOrder(-1)'); //Set Z-Order of the port to -1. It will be below all the figure
eval('this.'+eventPortName[i]+'.setBackgroundColor(new Color(255, 255, 255))'); //Setting Background of the port to white
eval('this.'+eventPortName[i]+'.setColor(new Color(255, 255, 255))'); //Setting Border of the port to white
eval('this.addPort(this.'+eventPortName[i]+','+eventPositionX[i]+', '+eventPositionY[i]+')'); //Setting Position of the port
}
}
};
bpmnEventMultipleEnd.prototype.getContextMenu=function(){
if(this.id != null){
this.workflow.handleContextMenu(this);
}
};

View File

@@ -0,0 +1,77 @@
bpmnEventMultipleInter=function(){
VectorFigure.call(this);
this.setDimension(30,30);
this.stroke=2
};
bpmnEventMultipleInter.prototype=new VectorFigure;
bpmnEventMultipleInter.prototype.type="bpmnEventMultipleInter";
bpmnEventMultipleInter.prototype.paint=function(){
VectorFigure.prototype.paint.call(this);
this.graphics.setStroke(this.stroke);
var x_cir = 0;
var y_cir = 0;
this.graphics.setColor("#c0c0c0");
this.graphics.fillEllipse(x_cir+3,y_cir+3,this.getWidth(),this.getHeight());
this.graphics.setColor("#f9faf2");
this.graphics.fillEllipse(x_cir,y_cir,this.getWidth(),this.getHeight());
this.graphics.setColor("#adae5e");
this.graphics.drawEllipse(x_cir,y_cir,this.getWidth(),this.getHeight());
var x_cir2=3;
var y_cir2=3;
this.graphics.setColor("#f9faf2");
this.graphics.fillEllipse(x_cir2,y_cir2,this.getWidth()-6,this.getHeight()-6);
this.graphics.setColor("#adae5e");
this.graphics.drawEllipse(x_cir2,y_cir2,this.getWidth()-6,this.getHeight()-6);
//var x_penta=new Array(13.5,28.5,37.5,23.1,9);
//var y_penta=new Array(33,33,18,8,18);
var x_penta=new Array(this.getWidth()/3.46,this.getWidth()/1.57,this.getWidth()/1.2,this.getWidth()/1.95,this.getWidth()/5);
var y_penta=new Array(this.getHeight()/1.36,this.getHeight()/1.36,this.getHeight()/2.5,this.getHeight()/5,this.getHeight()/2.5);
this.graphics.setColor( "#adae5e" );
this.graphics.fillPolygon(x_penta,y_penta);
this.graphics.setColor("#adae5e");
this.graphics.drawPolygon(x_penta,y_penta);
this.graphics.paint();
/*Code Added to Dynamically shift Ports on resizing of shapes
**/
if(this.input1!=null){
this.input1.setPosition(0,this.height/2);
}
if(this.output1!=null){
this.output1.setPosition(this.width/2,this.height);
}
if(this.input2!=null){
this.input2.setPosition(this.width/2,0);
}
if(this.output2!=null){
this.output2.setPosition(this.width,this.height/2);
}
};
bpmnEventMultipleInter.prototype.setWorkflow=function(_40c5){
VectorFigure.prototype.setWorkflow.call(this,_40c5);
if(_40c5!=null){
var eventPortName = ['input1','input2','output1','output2'];
var eventPortType = ['InputPort','InputPort','OutputPort','OutputPort'];
var eventPositionX= [0,this.width/2,this.width,this.width/2];
var eventPositionY= [this.height/2,0,this.height/2,this.height];
for(var i=0; i< eventPortName.length ; i++){
eval('this.'+eventPortName[i]+' = new '+eventPortType[i]+'()'); //Create New Port
eval('this.'+eventPortName[i]+'.setWorkflow(_40c5)'); //Add port to the workflow
eval('this.'+eventPortName[i]+'.setName("'+eventPortName[i]+'")'); //Set PortName
eval('this.'+eventPortName[i]+'.setZOrder(-1)'); //Set Z-Order of the port to -1. It will be below all the figure
eval('this.'+eventPortName[i]+'.setBackgroundColor(new Color(255, 255, 255))'); //Setting Background of the port to white
eval('this.'+eventPortName[i]+'.setColor(new Color(255, 255, 255))'); //Setting Border of the port to white
eval('this.addPort(this.'+eventPortName[i]+','+eventPositionX[i]+', '+eventPositionY[i]+')'); //Setting Position of the port
}
}
};
bpmnEventMultipleInter.prototype.getContextMenu=function(){
if(this.id != null){
this.workflow.handleContextMenu(this);
}
};

View File

@@ -0,0 +1,79 @@
bpmnEventRuleInter=function(){
VectorFigure.call(this);
this.setDimension(30,30);
this.stroke = 2;
};
bpmnEventRuleInter.prototype=new VectorFigure;
bpmnEventRuleInter.prototype.type="bpmnEventRuleInter";
bpmnEventRuleInter.prototype.paint=function(){
VectorFigure.prototype.paint.call(this);
var x_cir1=0;
var y_cir1=0;
this.graphics.setColor("#c0c0c0");
this.graphics.fillEllipse(x_cir1+3,y_cir1+3,this.getWidth(),this.getHeight());
this.graphics.setStroke(this.stroke);
this.graphics.setColor( "#f9faf2" );
this.graphics.fillEllipse(x_cir1,y_cir1,this.getWidth(),this.getHeight());
this.graphics.setColor("#adae5e");
this.graphics.drawEllipse(x_cir1,y_cir1,this.getWidth(),this.getHeight());
var x_cir2=3;
var y_cir2=3;
this.graphics.setColor( "#f9faf2" );
this.graphics.fillEllipse(x_cir2,y_cir2,this.getWidth()-6,this.getHeight()-6);
this.graphics.setColor("#adae5e");
this.graphics.drawEllipse(x_cir2,y_cir2,this.getWidth()-6,this.getHeight()-6);
var x=new Array(12,12,this.getWidth()-10,this.getWidth()-10);
var y=new Array(10,this.getHeight()-10,this.getHeight()-10,10);
//this.graphics.setColor("#adae5e");
//this.graphics.fillPolygon(x,y);
this.graphics.setColor("#adae5e");
this.graphics.drawPolygon(x,y);
this.graphics.drawLine(14,this.getHeight()/1.5,this.getWidth()-10,this.getHeight()/1.5);
this.graphics.drawLine(14,this.getHeight()/2,this.getWidth()-10,this.getHeight()/2);
this.graphics.drawLine(14,this.getHeight()/3,this.getWidth()-10,this.getHeight()/3);
this.graphics.drawLine(14,this.getHeight()/4,this.getWidth()-10,this.getHeight()/4);
this.graphics.paint();
/*Code Added to Dynamically shift Ports on resizing of shapes
**/
if(this.input1!=null){
this.input1.setPosition(0,this.height/2);
}
if(this.output1!=null){
this.output1.setPosition(this.width/2,this.height);
}
if(this.input2!=null){
this.input2.setPosition(this.width/2,0);
}
if(this.output2!=null){
this.output2.setPosition(this.width,this.height/2);
}
};
bpmnEventRuleInter.prototype.setWorkflow=function(_40c5){
VectorFigure.prototype.setWorkflow.call(this,_40c5);
if(_40c5!=null){
var eventPortName = ['input1','input2','output1','output2'];
var eventPortType = ['InputPort','InputPort','OutputPort','OutputPort'];
var eventPositionX= [0,this.width/2,this.width,this.width/2];
var eventPositionY= [this.height/2,0,this.height/2,this.height];
for(var i=0; i< eventPortName.length ; i++){
eval('this.'+eventPortName[i]+' = new '+eventPortType[i]+'()'); //Create New Port
eval('this.'+eventPortName[i]+'.setWorkflow(_40c5)'); //Add port to the workflow
eval('this.'+eventPortName[i]+'.setName("'+eventPortName[i]+'")'); //Set PortName
eval('this.'+eventPortName[i]+'.setZOrder(-1)'); //Set Z-Order of the port to -1. It will be below all the figure
eval('this.'+eventPortName[i]+'.setBackgroundColor(new Color(255, 255, 255))'); //Setting Background of the port to white
eval('this.'+eventPortName[i]+'.setColor(new Color(255, 255, 255))'); //Setting Border of the port to white
eval('this.addPort(this.'+eventPortName[i]+','+eventPositionX[i]+', '+eventPositionY[i]+')'); //Setting Position of the port
}
}
};
bpmnEventRuleInter.prototype.getContextMenu=function(){
if(this.id != null){
this.workflow.handleContextMenu(this);
}
};

View File

@@ -0,0 +1,73 @@
bpmnEventRuleStart=function(){
VectorFigure.call(this);
this.setDimension(30,30);
this.stroke = 2;
};
bpmnEventRuleStart.prototype=new VectorFigure;
bpmnEventRuleStart.prototype.type="bpmnEventRuleStart";
bpmnEventRuleStart.prototype.paint=function(){
VectorFigure.prototype.paint.call(this);
var x_cir = 0;
var y_cir = 0;
this.graphics.setColor("#c0c0c0");
this.graphics.fillEllipse(x_cir+5,y_cir+5,this.getWidth(),this.getHeight());
this.graphics.setStroke(this.stroke);
this.graphics.setColor( "#e4f7df");
this.graphics.fillEllipse(x_cir,y_cir,this.getWidth(),this.getHeight());
this.graphics.setColor("#4aa533");
this.graphics.drawEllipse(x_cir,y_cir,this.getWidth(),this.getHeight());
this.graphics.setStroke(1);
var x=new Array(12,12,this.getWidth()-10,this.getWidth()-10);
var y=new Array(10,this.getHeight()-10,this.getHeight()-10,10);
//this.graphics.setColor("#adae5e");
//this.graphics.fillPolygon(x,y);
this.graphics.setColor("#4aa533");
this.graphics.drawPolygon(x,y);
this.graphics.drawLine(14,this.getHeight()/1.5,this.getWidth()-10,this.getHeight()/1.5);
this.graphics.drawLine(14,this.getHeight()/2,this.getWidth()-10,this.getHeight()/2);
this.graphics.drawLine(14,this.getHeight()/3,this.getWidth()-10,this.getHeight()/3);
this.graphics.drawLine(14,this.getHeight()/4,this.getWidth()-10,this.getHeight()/4);
this.graphics.paint();
/*Code Added to Dynamically shift Ports on resizing of shapes
**/
if(this.input1!=null){
this.input1.setPosition(0,this.height/2);
}
if(this.output1!=null){
this.output1.setPosition(this.width/2,this.height);
}
if(this.input2!=null){
this.input2.setPosition(this.width/2,0);
}
if(this.output2!=null){
this.output2.setPosition(this.width,this.height/2);
}
};
bpmnEventRuleStart.prototype.setWorkflow=function(_40c5){
VectorFigure.prototype.setWorkflow.call(this,_40c5);
if(_40c5!=null){
var eventPortName = ['output1','output2'];
var eventPortType = ['OutputPort','OutputPort'];
var eventPositionX= [this.width/2,this.width];
var eventPositionY= [this.height,this.height/2];
for(var i=0; i< eventPortName.length ; i++){
eval('this.'+eventPortName[i]+' = new '+eventPortType[i]+'()'); //Create New Port
eval('this.'+eventPortName[i]+'.setWorkflow(_40c5)'); //Add port to the workflow
eval('this.'+eventPortName[i]+'.setName("'+eventPortName[i]+'")'); //Set PortName
eval('this.'+eventPortName[i]+'.setZOrder(-1)'); //Set Z-Order of the port to -1. It will be below all the figure
eval('this.'+eventPortName[i]+'.setBackgroundColor(new Color(255, 255, 255))'); //Setting Background of the port to white
eval('this.'+eventPortName[i]+'.setColor(new Color(255, 255, 255))'); //Setting Border of the port to white
eval('this.addPort(this.'+eventPortName[i]+','+eventPositionX[i]+', '+eventPositionY[i]+')'); //Setting Position of the port
}
}
};
bpmnEventRuleStart.prototype.getContextMenu=function(){
if(this.id != null){
this.workflow.handleContextMenu(this);
}
};

View File

@@ -0,0 +1,70 @@
bpmnEventSignalStart=function(){
VectorFigure.call(this);
this.setDimension(30,30);
this.stroke=2;
};
bpmnEventSignalStart.prototype=new VectorFigure;
bpmnEventSignalStart.prototype.type="bpmnEventSignalStart";
bpmnEventSignalStart.prototype.paint=function(){
VectorFigure.prototype.paint.call(this);
var x=0;
var y=0;
this.graphics.setColor("#c0c0c0");
this.graphics.fillEllipse(x+5,y+5,this.getWidth(),this.getHeight());
this.graphics.setStroke(this.stroke);
this.graphics.setColor( "#e4f7df" );
this.graphics.fillEllipse(x,y,this.getWidth(),this.getHeight());
this.graphics.setColor("#4aa533");
this.graphics.drawEllipse(x,y,this.getWidth(),this.getHeight());
//var x=new Array(5,41,23);
//var y=new Array(35,35,0);
var x=new Array(5,this.getWidth()-4,this.getWidth()/2);
var y=new Array(this.getHeight()-10,this.getHeight()-10,2);
this.graphics.setColor("#4aa533");
//this.graphics.fillPolygon(x,y);
this.graphics.setColor("#4aa533");
this.graphics.drawPolygon(x,y);
this.graphics.paint();
/*Code Added to Dynamically shift Ports on resizing of shapes
**/
if(this.input1!=null){
this.input1.setPosition(0,this.height/2);
}
if(this.output1!=null){
this.output1.setPosition(this.width/2,this.height);
}
if(this.input2!=null){
this.input2.setPosition(this.width/2,0);
}
if(this.output2!=null){
this.output2.setPosition(this.width,this.height/2);
}
};
bpmnEventSignalStart.prototype.setWorkflow=function(_40c5){
VectorFigure.prototype.setWorkflow.call(this,_40c5);
if(_40c5!=null){
var eventPortName = ['output1','output2'];
var eventPortType = ['OutputPort','OutputPort'];
var eventPositionX= [this.width/2,this.width];
var eventPositionY= [this.height,this.height/2];
for(var i=0; i< eventPortName.length ; i++){
eval('this.'+eventPortName[i]+' = new '+eventPortType[i]+'()'); //Create New Port
eval('this.'+eventPortName[i]+'.setWorkflow(_40c5)'); //Add port to the workflow
eval('this.'+eventPortName[i]+'.setName("'+eventPortName[i]+'")'); //Set PortName
eval('this.'+eventPortName[i]+'.setZOrder(-1)'); //Set Z-Order of the port to -1. It will be below all the figure
eval('this.'+eventPortName[i]+'.setBackgroundColor(new Color(255, 255, 255))'); //Setting Background of the port to white
eval('this.'+eventPortName[i]+'.setColor(new Color(255, 255, 255))'); //Setting Border of the port to white
eval('this.addPort(this.'+eventPortName[i]+','+eventPositionX[i]+', '+eventPositionY[i]+')'); //Setting Position of the port
}
}
};
bpmnEventSignalStart.prototype.getContextMenu=function(){
if(this.id != null){
this.workflow.handleContextMenu(this);
}
};

View File

@@ -0,0 +1,70 @@
bpmnEventTerminate=function(){
VectorFigure.call(this);
this.setDimension(30,30);
this.stroke=2;
};
bpmnEventTerminate.prototype=new VectorFigure;
bpmnEventTerminate.prototype.type="bpmnEventTerminateEnd";
bpmnEventTerminate.prototype.paint=function(){
VectorFigure.prototype.paint.call(this);
VectorFigure.prototype.paint.call(this);
this.graphics.setStroke(this.stroke);
var x_cir = 0;
var y_cir = 0;
this.graphics.setColor("#c0c0c0");
this.graphics.fillEllipse(x_cir+5,y_cir+5,this.getWidth(),this.getHeight());
this.graphics.setStroke(this.stroke);
this.graphics.setColor( "#f7f1e5" );
this.graphics.fillEllipse(x_cir,y_cir,this.getWidth(),this.getHeight());
this.graphics.setColor("#c46508");
this.graphics.drawEllipse(x_cir,y_cir,this.getWidth(),this.getHeight());
var x_cir2=5;
var y_cir2=5;
this.graphics.setColor("#c46508");
this.graphics.fillEllipse(x_cir2,y_cir2,this.getWidth()-10,this.getHeight()-10);
this.graphics.setColor("#c46508");
this.graphics.drawEllipse(x_cir2,y_cir2,this.getWidth()-10,this.getHeight()-10);
this.graphics.paint();
/*Code Added to Dynamically shift Ports on resizing of shapes
**/
if(this.input1!=null){
this.input1.setPosition(0,this.height/2);
}
if(this.output1!=null){
this.output1.setPosition(this.width/2,this.height);
}
if(this.input2!=null){
this.input2.setPosition(this.width/2,0);
}
if(this.output2!=null){
this.output2.setPosition(this.width,this.height/2);
}
};
bpmnEventTerminate.prototype.setWorkflow=function(_40c5){
VectorFigure.prototype.setWorkflow.call(this,_40c5);
if(_40c5!=null){
var eventPortName = ['input1','input2'];
var eventPortType = ['InputPort','InputPort'];
var eventPositionX= [this.width/2,0];
var eventPositionY= [0,this.height/2];
for(var i=0; i< eventPortName.length ; i++){
eval('this.'+eventPortName[i]+' = new '+eventPortType[i]+'()'); //Create New Port
eval('this.'+eventPortName[i]+'.setWorkflow(_40c5)'); //Add port to the workflow
eval('this.'+eventPortName[i]+'.setName("'+eventPortName[i]+'")'); //Set PortName
eval('this.'+eventPortName[i]+'.setZOrder(-1)'); //Set Z-Order of the port to -1. It will be below all the figure
eval('this.'+eventPortName[i]+'.setBackgroundColor(new Color(255, 255, 255))'); //Setting Background of the port to white
eval('this.'+eventPortName[i]+'.setColor(new Color(255, 255, 255))'); //Setting Border of the port to white
eval('this.addPort(this.'+eventPortName[i]+','+eventPositionX[i]+', '+eventPositionY[i]+')'); //Setting Position of the port
}
}
};
bpmnEventTerminate.prototype.getContextMenu=function(){
if(this.id != null){
this.workflow.handleContextMenu(this);
}
};

View File

@@ -0,0 +1,77 @@
bpmnEventTimerInter=function(){
VectorFigure.call(this);
this.setDimension(30,30);
this.stroke = 2;
};
bpmnEventTimerInter.prototype=new VectorFigure;
bpmnEventTimerInter.prototype.type="bpmnEventTimerInter";
bpmnEventTimerInter.prototype.paint=function(){
VectorFigure.prototype.paint.call(this);
var x_cir1=0;
var y_cir1=0;
this.graphics.setColor("#c0c0c0");
this.graphics.fillEllipse(x_cir1+3,y_cir1+3,this.getWidth(),this.getHeight());
this.graphics.setStroke(this.stroke);
this.graphics.setColor( "#f9faf2" );
this.graphics.fillEllipse(x_cir1,y_cir1,this.getWidth(),this.getHeight());
this.graphics.setColor("#adae5e");
this.graphics.drawEllipse(x_cir1,y_cir1,this.getWidth(),this.getHeight());
var x_cir2=3;
var y_cir2=3;
this.graphics.setColor( "#f9faf2" );
this.graphics.fillEllipse(x_cir2,y_cir2,this.getWidth()-6,this.getHeight()-6);
this.graphics.setColor("#adae5e");
this.graphics.drawEllipse(x_cir2,y_cir2,this.getWidth()-6,this.getHeight()-6);
//var x_cir3=10;
//var y_cir3=10;
//this.graphics.setColor( "#f9faf2" );
//this.graphics.fillEllipse(x_cir3,y_cir3,this.getWidth()-20,this.getHeight()-20);
this.graphics.setColor("#adae5e");
//this.graphics.drawEllipse(x_cir3,y_cir3,this.getWidth()-20,this.getHeight()-20);
this.graphics.drawLine(this.getWidth()/2,this.getHeight()/2,this.getWidth()/1.3,this.getHeight()/2);
this.graphics.drawLine(this.getWidth()/2,this.getHeight()/2,this.getWidth()/2,this.getHeight()/4.5);
this.graphics.paint();
/*Code Added to Dynamically shift Ports on resizing of shapes
**/
if(this.input1!=null){
this.input1.setPosition(0,this.height/2);
}
if(this.output1!=null){
this.output1.setPosition(this.width/2,this.height);
}
if(this.input2!=null){
this.input2.setPosition(this.width/2,0);
}
if(this.output2!=null){
this.output2.setPosition(this.width,this.height/2);
}
};
bpmnEventTimerInter.prototype.setWorkflow=function(_40c5){
VectorFigure.prototype.setWorkflow.call(this,_40c5);
if(_40c5!=null){
var eventPortName = ['input1','input2','output1','output2'];
var eventPortType = ['InputPort','InputPort','OutputPort','OutputPort'];
var eventPositionX= [0,this.width/2,this.width,this.width/2];
var eventPositionY= [this.height/2,0,this.height/2,this.height];
for(var i=0; i< eventPortName.length ; i++){
eval('this.'+eventPortName[i]+' = new '+eventPortType[i]+'()'); //Create New Port
eval('this.'+eventPortName[i]+'.setWorkflow(_40c5)'); //Add port to the workflow
eval('this.'+eventPortName[i]+'.setName("'+eventPortName[i]+'")'); //Set PortName
eval('this.'+eventPortName[i]+'.setZOrder(-1)'); //Set Z-Order of the port to -1. It will be below all the figure
eval('this.'+eventPortName[i]+'.setBackgroundColor(new Color(255, 255, 255))'); //Setting Background of the port to white
eval('this.'+eventPortName[i]+'.setColor(new Color(255, 255, 255))'); //Setting Border of the port to white
eval('this.addPort(this.'+eventPortName[i]+','+eventPositionX[i]+', '+eventPositionY[i]+')'); //Setting Position of the port
}
}
};
bpmnEventTimerInter.prototype.getContextMenu=function(){
if(this.id != null){
this.workflow.handleContextMenu(this);
}
};

View File

@@ -0,0 +1,70 @@
bpmnEventTimerStart=function(){
VectorFigure.call(this);
this.setDimension(30,30);
this.stroke = 2;
};
bpmnEventTimerStart.prototype=new VectorFigure;
bpmnEventTimerStart.prototype.type="bpmnEventTimerStart";
bpmnEventTimerStart.prototype.paint=function(){
VectorFigure.prototype.paint.call(this);
var x_cir1=0;
var y_cir1=0;
this.graphics.setColor("#c0c0c0");
this.graphics.fillEllipse(x_cir1+5,y_cir1+5,this.getWidth(),this.getHeight());
this.graphics.setStroke(this.stroke);
this.graphics.setColor( "#e4f7df" );
this.graphics.fillEllipse(x_cir1,y_cir1,this.getWidth(),this.getHeight());
this.graphics.setColor("#4aa533");
this.graphics.drawEllipse(x_cir1,y_cir1,this.getWidth(),this.getHeight());
var x_cir2=5;
var y_cir2=5;
this.graphics.setColor( "#e4f7df" );
this.graphics.fillEllipse(x_cir2,y_cir2,this.getWidth()-10,this.getHeight()-10);
this.graphics.setColor("#4aa533");
this.graphics.drawEllipse(x_cir2,y_cir2,this.getWidth()-10,this.getHeight()-10);
this.graphics.drawLine(this.getWidth()/2,this.getHeight()/2,this.getWidth()/1.3,this.getHeight()/2); //horizontal line
this.graphics.drawLine(this.getWidth()/2,this.getHeight()/2,this.getWidth()/2,this.getHeight()/4.5); //vertical line
this.graphics.paint();
/*Code Added to Dynamically shift Ports on resizing of shapes
**/
if(this.input1!=null){
this.input1.setPosition(0,this.height/2);
}
if(this.output1!=null){
this.output1.setPosition(this.width/2,this.height);
}
if(this.input2!=null){
this.input2.setPosition(this.width/2,0);
}
if(this.output2!=null){
this.output2.setPosition(this.width,this.height/2);
}
};
bpmnEventTimerStart.prototype.setWorkflow=function(_40c5){
VectorFigure.prototype.setWorkflow.call(this,_40c5);
if(_40c5!=null){
var eventPortName = ['output1','output2'];
var eventPortType = ['OutputPort','OutputPort'];
var eventPositionX= [this.width/2,this.width];
var eventPositionY= [this.height,this.height/2];
for(var i=0; i< eventPortName.length ; i++){
eval('this.'+eventPortName[i]+' = new '+eventPortType[i]+'()'); //Create New Port
eval('this.'+eventPortName[i]+'.setWorkflow(_40c5)'); //Add port to the workflow
eval('this.'+eventPortName[i]+'.setName("'+eventPortName[i]+'")'); //Set PortName
eval('this.'+eventPortName[i]+'.setZOrder(-1)'); //Set Z-Order of the port to -1. It will be below all the figure
eval('this.'+eventPortName[i]+'.setBackgroundColor(new Color(255, 255, 255))'); //Setting Background of the port to white
eval('this.'+eventPortName[i]+'.setColor(new Color(255, 255, 255))'); //Setting Border of the port to white
eval('this.addPort(this.'+eventPortName[i]+','+eventPositionX[i]+', '+eventPositionY[i]+')'); //Setting Position of the port
}
}
};
bpmnEventTimerStart.prototype.getContextMenu=function(){
if(this.id != null){
this.workflow.handleContextMenu(this);
}
};

View File

@@ -0,0 +1,138 @@
/*
Awesome Uploader
Ext.ux.XHRUpload JavaScript Class
Copyright (c) 2010, Andrew Rymarczyk
All rights reserved.
Redistribution and use in source and minified, compiled or otherwise obfuscated
form, with or without modification, are permitted provided that the following
conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in minified, compiled or otherwise obfuscated form must
reproduce the above copyright notice, this list of conditions and the
following disclaimer in the documentation and/or other materials
provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
// API Specs:
// http://www.w3.org/TR/XMLHttpRequest/
// http://www.w3.org/TR/XMLHttpRequest2/
// http://www.w3.org/TR/progress-events/
// Browser Implementation Details:
// FROM: https://developer.mozilla.org/en/DOM/File
// https://developer.mozilla.org/en/Using_files_from_web_applications
// https://developer.mozilla.org/En/DragDrop/DataTransfer
// https://developer.mozilla.org/en/DOM/FileList
// "NOTE: The File object as implemented by Gecko offers several non-standard methods for reading the contents of the file. These should not be used, as they will prevent your web application from being used in other browsers, as well as in future versions of Gecko, which will likely remove these methods."
// NOTE: fileObj.getAsBinary() is deprecated according to the mozilla docs!
// Can optionally follow RFC2388
// RFC2388 - Returning Values from Forms: multipart/form-data
// http://www.faqs.org/rfcs/rfc2388.html
// This allows additional POST params to be sent with file upload, and also simplifies the backend upload handler becuase a single script can be used for drag and drop, flash, and standard uploads
// NOTE: This is currently only supported by Firefox 1.6, Chrome 6 should be released soon and will also be supported.
Ext.ns('Ext.ux');
Ext.ux.XHRUpload = function(config){
Ext.apply(this, config, {
method: 'POST'
,fileNameHeader: 'X-File-Name'
,filePostName:'fileName'
,contentTypeHeader: 'text/plain; charset=x-user-defined-binary'
,extraPostData:{}
,xhrExtraPostDataPrefix:'extraPostData_'
,sendMultiPartFormData:false
});
this.addEvents( //extend the xhr's progress events to here
'loadstart',
'progress',
'abort',
'error',
'load',
'loadend'
);
Ext.ux.XHRUpload.superclass.constructor.call(this);
};
Ext.extend(Ext.ux.XHRUpload, Ext.util.Observable,{
send:function(config){
Ext.apply(this, config);
this.xhr = new XMLHttpRequest();
this.xhr.addEventListener('loadstart', this.relayXHREvent.createDelegate(this), false);
this.xhr.addEventListener('progress', this.relayXHREvent.createDelegate(this), false);
this.xhr.addEventListener('progressabort', this.relayXHREvent.createDelegate(this), false);
this.xhr.addEventListener('error', this.relayXHREvent.createDelegate(this), false);
this.xhr.addEventListener('load', this.relayXHREvent.createDelegate(this), false);
this.xhr.addEventListener('loadend', this.relayXHREvent.createDelegate(this), false);
this.xhr.upload.addEventListener('loadstart', this.relayUploadEvent.createDelegate(this), false);
this.xhr.upload.addEventListener('progress', this.relayUploadEvent.createDelegate(this), false);
this.xhr.upload.addEventListener('progressabort', this.relayUploadEvent.createDelegate(this), false);
this.xhr.upload.addEventListener('error', this.relayUploadEvent.createDelegate(this), false);
this.xhr.upload.addEventListener('load', this.relayUploadEvent.createDelegate(this), false);
this.xhr.upload.addEventListener('loadend', this.relayUploadEvent.createDelegate(this), false);
this.xhr.open(this.method, this.url, true);
if(typeof(FileReader) !== 'undefined' && this.sendMultiPartFormData ){
//currently this is firefox only, chrome 6 will support this in the future
this.reader = new FileReader();
this.reader.addEventListener('load', this.sendFileUpload.createDelegate(this), false);
this.reader.readAsBinaryString(this.file);
return true;
}
//This will work in both Firefox 1.6 and Chrome 5
this.xhr.overrideMimeType(this.contentTypeHeader);
this.xhr.setRequestHeader(this.fileNameHeader, this.file.name);
for(attr in this.extraPostData){
this.xhr.setRequestHeader(this.xhrExtraPostDataPrefix + attr, this.extraPostData[attr]);
}
//xhr.setRequestHeader('X-File-Size', files.size); //this may be useful
this.xhr.send(this.file);
return true;
}
,sendFileUpload:function(){
var boundary = (1000000000000+Math.floor(Math.random()*8999999999998)).toString(),
data = '';
for(attr in this.extraPostData){
data += '--'+boundary + '\r\nContent-Disposition: form-data; name="' + attr + '"\r\ncontent-type: text/plain;\r\n\r\n'+this.extraPostData[attr]+'\r\n';
}
//window.btoa(binaryData)
//Creates a base-64 encoded ASCII string from a string of binary data.
//https://developer.mozilla.org/en/DOM/window.btoa
//Firefox and Chrome only!!
data += '--'+boundary + '\r\nContent-Disposition: form-data; name="' + this.filePostName + '"; filename="' + this.file.name + '"\r\nContent-Type: '+this.file.type+'\r\nContent-Transfer-Encoding: base64\r\n\r\n' + window.btoa(this.reader.result) + '\r\n'+'--'+boundary+'--\r\n\r\n';
this.xhr.setRequestHeader('Content-Type', 'multipart/form-data; boundary='+boundary);
this.xhr.send(data);
}
,relayUploadEvent:function(event){
this.fireEvent('upload'+event.type, event);
}
,relayXHREvent:function(event){
this.fireEvent(event.type, event);
}
});

View File

@@ -0,0 +1,182 @@
/*!
* Ext JS Library 3.2.1
* Copyright(c) 2006-2010 Ext JS, Inc.
* licensing@extjs.com
* http://www.extjs.com/license
*/
Ext.ns('Ext.ux.form');
/**
* @class Ext.ux.form.FileUploadField
* @extends Ext.form.TextField
* Creates a file upload field.
* @xtype fileuploadfield
*/
Ext.ux.form.FileUploadField = Ext.extend(Ext.form.TextField, {
/**
* @cfg {String} buttonText The button text to display on the upload button (defaults to
* 'Browse...'). Note that if you supply a value for {@link #buttonCfg}, the buttonCfg.text
* value will be used instead if available.
*/
buttonText: 'Browse...',
/**
* @cfg {Boolean} buttonOnly True to display the file upload field as a button with no visible
* text field (defaults to false). If true, all inherited TextField members will still be available.
*/
buttonOnly: false,
/**
* @cfg {Number} buttonOffset The number of pixels of space reserved between the button and the text field
* (defaults to 3). Note that this only applies if {@link #buttonOnly} = false.
*/
buttonOffset: 3,
/**
* @cfg {Object} buttonCfg A standard {@link Ext.Button} config object.
*/
// private
readOnly: true,
/**
* @hide
* @method autoSize
*/
autoSize: Ext.emptyFn,
// private
initComponent: function(){
Ext.ux.form.FileUploadField.superclass.initComponent.call(this);
this.addEvents(
/**
* @event fileselected
* Fires when the underlying file input field's value has changed from the user
* selecting a new file from the system file selection dialog.
* @param {Ext.ux.form.FileUploadField} this
* @param {String} value The file value returned by the underlying file input field
*/
'fileselected'
);
},
// private
onRender : function(ct, position){
Ext.ux.form.FileUploadField.superclass.onRender.call(this, ct, position);
this.wrap = this.el.wrap({cls:'x-form-field-wrap x-form-file-wrap'});
this.el.addClass('x-form-file-text');
this.el.dom.removeAttribute('name');
this.createFileInput();
var btnCfg = Ext.applyIf(this.buttonCfg || {}, {
text: this.buttonText
});
this.button = new Ext.Button(Ext.apply(btnCfg, {
renderTo: this.wrap,
cls: 'x-form-file-btn' + (btnCfg.iconCls ? ' x-btn-icon' : '')
}));
if(this.buttonOnly){
this.el.hide();
this.wrap.setWidth(this.button.getEl().getWidth());
}
this.bindListeners();
this.resizeEl = this.positionEl = this.wrap;
},
bindListeners: function(){
this.fileInput.on({
scope: this,
mouseenter: function() {
this.button.addClass(['x-btn-over','x-btn-focus'])
},
mouseleave: function(){
this.button.removeClass(['x-btn-over','x-btn-focus','x-btn-click'])
},
mousedown: function(){
this.button.addClass('x-btn-click')
},
mouseup: function(){
this.button.removeClass(['x-btn-over','x-btn-focus','x-btn-click'])
},
change: function(){
var v = this.fileInput.dom.value;
this.setValue(v);
this.fireEvent('fileselected', this, v);
}
});
},
createFileInput : function() {
this.fileInput = this.wrap.createChild({
id: this.getFileInputId(),
name: this.name||this.getId(),
cls: 'x-form-file',
tag: 'input',
type: 'file',
size: 1
});
},
reset : function(){
this.fileInput.remove();
this.createFileInput();
this.bindListeners();
Ext.ux.form.FileUploadField.superclass.reset.call(this);
},
// private
getFileInputId: function(){
return this.id + '-file';
},
// private
onResize : function(w, h){
Ext.ux.form.FileUploadField.superclass.onResize.call(this, w, h);
this.wrap.setWidth(w);
if(!this.buttonOnly){
var w = this.wrap.getWidth() - this.button.getEl().getWidth() - this.buttonOffset;
this.el.setWidth(w);
}
},
// private
onDestroy: function(){
Ext.ux.form.FileUploadField.superclass.onDestroy.call(this);
Ext.destroy(this.fileInput, this.button, this.wrap);
},
onDisable: function(){
Ext.ux.form.FileUploadField.superclass.onDisable.call(this);
this.doDisable(true);
},
onEnable: function(){
Ext.ux.form.FileUploadField.superclass.onEnable.call(this);
this.doDisable(false);
},
// private
doDisable: function(disabled){
this.fileInput.dom.disabled = disabled;
this.button.setDisabled(disabled);
},
// private
preFocus : Ext.emptyFn,
// private
alignErrorIcon : function(){
this.errorIcon.alignTo(this.wrap, 'tl-tr', [2, 0]);
}
});
Ext.reg('fileuploadfield', Ext.ux.form.FileUploadField);
// backwards compat
Ext.form.FileUploadField = Ext.ux.form.FileUploadField;

View File

@@ -0,0 +1,30 @@
bpmnFlowConnector=function(){
Line.call(this);
};
bpmnFlowConnector.prototype = new Line;
bpmnFlowConnector.prototype.type = 'bpmnFlowConnector';
bpmnFlowConnector.prototype.paint=function(){
if(this.graphics==null){
this.graphics=new jsGraphics(this.id);
}else{
this.graphics.clear();
}
this.graphics.setStroke(this.stroke);
this.graphics.setColor(this.lineColor.getHTMLStyle());
var endY=this.getLength();
var _3541=[0,0,endY-this.arrowLength,endY-this.arrowLength,endY,endY-this.arrowLength,endY-this.arrowLength,0];
var _3542=[-this.lineWidth,+this.lineWidth,+this.lineWidth,this.lineWidth+this.arrowWidth/2,0,-(this.lineWidth+this.arrowWidth/2),-this.lineWidth,-this.lineWidth];
var _3543=this.getAngle()*Math.PI/180;
var rotX=new Array();
var rotY=new Array();
for(var i=0;i<_3541.length;i++){
rotX[i]=this.startX+_3541[i]*Math.cos(_3543)-_3542[i]*Math.sin(_3543);
rotY[i]=this.startY+_3541[i]*Math.sin(_3543)+_3542[i]*Math.cos(_3543);
}
this.graphics.drawPolyLine(rotX,rotY);
this.graphics.paint();
};

View File

@@ -0,0 +1,69 @@
bpmnGatewayComplex=function(width,_30ab){
VectorFigure.call(this);
this.setDimension(40,40);
this.stroke=2;
};
bpmnGatewayComplex.prototype=new VectorFigure;
bpmnGatewayComplex.prototype.type="bpmnGatewayComplex";
bpmnGatewayComplex.prototype.paint=function(){
VectorFigure.prototype.paint.call(this);
var x=new Array(0,this.width/2,this.width,this.width/2);
var y=new Array(this.height/2,this.height,this.height/2,0);
var x2 = new Array();
var y2 = new Array();
for(var i=0;i<x.length;i++){
x2[i]=x[i]+4;
y2[i]=y[i]+1;
}
this.graphics.setStroke(this.stroke);
this.graphics.setColor( "#c0c0c0" );
this.graphics.fillPolygon(x2,y2);
this.graphics.setStroke(this.stroke);
this.graphics.setColor( "#fdf3e0" );
this.graphics.fillPolygon(x,y);
this.graphics.setColor("#a27628");
this.graphics.drawPolygon(x,y);
/*var x_cross=new Array(5,15,25,30,20,30,25,15,5,0,10,0);
var y_cross=new Array(30,20,30,25,15,5,0,10,0,5,15,25);
this.graphics.setColor( "#000000" );
this.graphics.fillPolygon(x_cross,y_cross);
var x_plus =new Array(10,20,20,30,30,20,20,10,10,0,0,10);
var y_plus=new Array(30,30,20,20,10,10,0,0,10,10,20,20);
this.graphics.fillPolygon(x_plus,y_plus);*/
this.graphics.setStroke(4);
this.graphics.drawLine(this.getWidth()/4.5,this.getHeight()/2,this.getWidth()/1.3,this.getHeight()/2); //horizontal line
this.graphics.drawLine(this.getWidth()/3,this.getHeight()/1.5,this.getWidth()/1.5,this.getHeight()/3); //cross line
this.graphics.drawLine(this.getWidth()/2,this.getHeight()/1.3,this.getWidth()/2,this.getHeight()/4.5); //vertical line
this.graphics.drawLine(this.getWidth()/1.5,this.getHeight()/1.5,this.getWidth()/3,this.getHeight()/3); //cross line
this.graphics.paint();
};
bpmnGatewayComplex.prototype.setWorkflow=function(_40c5){
VectorFigure.prototype.setWorkflow.call(this,_40c5);
if(_40c5!=null){
var gatewayPortName = ['input1','input2','output1','output2'];
var gatewayPortType = ['InputPort','InputPort','OutputPort','OutputPort'];
var gatewayPositionX= [0,this.width/2,this.height/2,this.width];
var gatewayPositionY= [this.height/2,0,this.width,this.height/2];
for(var i=0; i< gatewayPortName.length ; i++){
eval('this.'+gatewayPortName[i]+' = new '+gatewayPortType[i]+'()'); //Create New Port
eval('this.'+gatewayPortName[i]+'.setWorkflow(_40c5)'); //Add port to the workflow
eval('this.'+gatewayPortName[i]+'.setName("'+gatewayPortName[i]+'")'); //Set PortName
eval('this.'+gatewayPortName[i]+'.setZOrder(-1)'); //Set Z-Order of the port to -1. It will be below all the figure
eval('this.'+gatewayPortName[i]+'.setBackgroundColor(new Color(255, 255, 255))'); //Setting Background of the port to white
eval('this.'+gatewayPortName[i]+'.setColor(new Color(255, 255, 255))'); //Setting Border of the port to white
eval('this.addPort(this.'+gatewayPortName[i]+','+gatewayPositionX[i]+', '+gatewayPositionY[i]+')'); //Setting Position of the port
}
}
};
bpmnGatewayComplex.prototype.getContextMenu=function(){
if(this.id != null){
this.workflow.handleContextMenu(this);
}
};

View File

@@ -0,0 +1,62 @@
bpmnGatewayExclusiveData=function(width,_30ab){
VectorFigure.call(this);
this.stroke =2;
this.setDimension(40,40);
};
bpmnGatewayExclusiveData.prototype=new VectorFigure;
bpmnGatewayExclusiveData.prototype.type="bpmnGatewayExclusiveData";
bpmnGatewayExclusiveData.prototype.paint=function(){
VectorFigure.prototype.paint.call(this);
var x=new Array(0,this.width/2,this.width,this.width/2);
var y=new Array(this.height/2,this.height,this.height/2,0);
var x2 = new Array();
var y2 = new Array();
for(var i=0;i<x.length;i++){
x2[i]=x[i]+4;
y2[i]=y[i]+1;
}
this.graphics.setStroke(this.stroke);
this.graphics.setColor( "#c0c0c0" );
this.graphics.fillPolygon(x2,y2);
this.graphics.setColor( "#fdf3e0" );
this.graphics.fillPolygon(x,y);
this.graphics.setColor("#a27628");
this.graphics.drawPolygon(x,y);
this.graphics.setStroke(1);
//var x_cross=new Array(20,30,40,45,35,45,40,30,20,15,25,15);
//var y_cross=new Array(45,35,45,40,30,20,15,25,15,20,30,40);
var x_cross=new Array(this.getWidth()/3,this.getWidth()/2,this.getWidth()/1.5,this.getWidth()/1.3,this.getWidth()/1.7,this.getWidth()/1.3,this.getWidth()/1.5,this.getWidth()/2,this.getWidth()/3,this.getWidth()/4,this.getWidth()/2.4,this.getWidth()/4);
var y_cross=new Array(this.getHeight()/1.3,this.getHeight()/1.7,this.getHeight()/1.3,this.getHeight()/1.5,this.getHeight()/2,this.getHeight()/3,this.getHeight()/4,this.getHeight()/2.4,this.getHeight()/4,this.getHeight()/3,this.getHeight()/2,this.getHeight()/1.5);
this.graphics.setColor( "#a27628" );
this.graphics.fillPolygon(x_cross,y_cross);
this.graphics.paint();
};
bpmnGatewayExclusiveData.prototype.setWorkflow=function(_40c5){
VectorFigure.prototype.setWorkflow.call(this,_40c5);
if(_40c5!=null){
var gatewayPortName = ['input1','input2','output1','output2'];
var gatewayPortType = ['InputPort','InputPort','OutputPort','OutputPort'];
var gatewayPositionX= [0,this.width/2,this.height/2,this.width];
var gatewayPositionY= [this.height/2,0,this.width,this.height/2];
for(var i=0; i< gatewayPortName.length ; i++){
eval('this.'+gatewayPortName[i]+' = new '+gatewayPortType[i]+'()'); //Create New Port
eval('this.'+gatewayPortName[i]+'.setWorkflow(_40c5)'); //Add port to the workflow
eval('this.'+gatewayPortName[i]+'.setName("'+gatewayPortName[i]+'")'); //Set PortName
eval('this.'+gatewayPortName[i]+'.setZOrder(-1)'); //Set Z-Order of the port to -1. It will be below all the figure
eval('this.'+gatewayPortName[i]+'.setBackgroundColor(new Color(255, 255, 255))'); //Setting Background of the port to white
eval('this.'+gatewayPortName[i]+'.setColor(new Color(255, 255, 255))'); //Setting Border of the port to white
eval('this.addPort(this.'+gatewayPortName[i]+','+gatewayPositionX[i]+', '+gatewayPositionY[i]+')'); //Setting Position of the port
}
}
};
bpmnGatewayExclusiveData.prototype.getContextMenu=function(){
if(this.id != null){
this.workflow.handleContextMenu(this);
}
};

View File

@@ -0,0 +1,70 @@
bpmnGatewayExclusiveEvent=function(width,_30ab){
VectorFigure.call(this);
this.setDimension(40,40);
this.stroke=2;
};
bpmnGatewayExclusiveEvent.prototype=new VectorFigure;
bpmnGatewayExclusiveEvent.prototype.type="bpmnGatewayExclusiveEvent";
bpmnGatewayExclusiveEvent.prototype.paint=function(){
VectorFigure.prototype.paint.call(this);
var x=new Array(0,this.width/2,this.width,this.width/2);
var y=new Array(this.height/2,this.height,this.height/2,0);
var x2 = new Array();
var y2 = new Array();
for(var i=0;i<x.length;i++){
x2[i]=x[i]+4;
y2[i]=y[i]+1;
}
this.graphics.setStroke(this.stroke);
this.graphics.setColor( "#c0c0c0" );
this.graphics.fillPolygon(x2,y2);
this.graphics.setStroke(this.stroke);
this.graphics.setColor( "#fdf3e0" );
this.graphics.fillPolygon(x,y);
this.graphics.setColor("#a27628");
this.graphics.drawPolygon(x,y);
//this.graphics.setStroke(2);
this.graphics.setColor("#a27628");
this.graphics.drawEllipse(this.getWidth()/4,this.getHeight()/4,this.getWidth()/2,this.getHeight()/2);
this.graphics.drawEllipse(this.getWidth()/6,this.getHeight()/6,this.getWidth()/1.5,this.getHeight()/1.5);
//var x_penta=new Array(20,30,40,35,25,20);
//var y_penta=new Array(26,21,26,36,36,26);
var x_penta=new Array(this.getWidth()/3, this.getWidth()/2, this.getWidth()/1.5, this.getWidth()/1.7, this.getWidth()/2.4, this.getWidth()/3);
var y_penta=new Array(this.getHeight()/2.3, this.getHeight()/2.8, this.getHeight()/2.3, this.getHeight()/1.6, this.getHeight()/1.6, this.getHeight()/2.3);
//this.graphics.setStroke(2);
this.graphics.setColor( "#a27628" );
this.graphics.fillPolygon(x_penta,y_penta);
this.graphics.setColor("#a27628");
this.graphics.drawPolygon(x_penta,y_penta);
this.graphics.setColor("#a27628");
this.graphics.paint();
};
bpmnGatewayExclusiveEvent.prototype.setWorkflow=function(_40c5){
VectorFigure.prototype.setWorkflow.call(this,_40c5);
if(_40c5!=null){
var gatewayPortName = ['input1','input2','output1','output2'];
var gatewayPortType = ['InputPort','InputPort','OutputPort','OutputPort'];
var gatewayPositionX= [0,this.width/2,this.height/2,this.width];
var gatewayPositionY= [this.height/2,0,this.width,this.height/2];
for(var i=0; i< gatewayPortName.length ; i++){
eval('this.'+gatewayPortName[i]+' = new '+gatewayPortType[i]+'()'); //Create New Port
eval('this.'+gatewayPortName[i]+'.setWorkflow(_40c5)'); //Add port to the workflow
eval('this.'+gatewayPortName[i]+'.setName("'+gatewayPortName[i]+'")'); //Set PortName
eval('this.'+gatewayPortName[i]+'.setZOrder(-1)'); //Set Z-Order of the port to -1. It will be below all the figure
eval('this.'+gatewayPortName[i]+'.setBackgroundColor(new Color(255, 255, 255))'); //Setting Background of the port to white
eval('this.'+gatewayPortName[i]+'.setColor(new Color(255, 255, 255))'); //Setting Border of the port to white
eval('this.addPort(this.'+gatewayPortName[i]+','+gatewayPositionX[i]+', '+gatewayPositionY[i]+')'); //Setting Position of the port
}
}
};
bpmnGatewayExclusiveEvent.prototype.getContextMenu=function(){
if(this.id != null){
this.workflow.handleContextMenu(this);
}
};

View File

@@ -0,0 +1,66 @@
bpmnGatewayInclusive=function(width,_30ab){
VectorFigure.call(this);
this.setDimension(40,40);
};
bpmnGatewayInclusive.prototype=new VectorFigure;
bpmnGatewayInclusive.prototype.type="bpmnGatewayInclusive";
bpmnGatewayInclusive.prototype.paint=function(){
VectorFigure.prototype.paint.call(this);
//var x=new Array(15,50,15,-20);
//var y=new Array(50,15,-20,15);
var x=new Array(0,this.width/2,this.width,this.width/2);
var y=new Array(this.height/2,this.height,this.height/2,0);
var x2 = new Array();
var y2 = new Array();
for(var i=0;i<x.length;i++){
x2[i]=x[i]+4;
y2[i]=y[i]+1;
}
this.graphics.setStroke(this.stroke);
this.graphics.setColor( "#c0c0c0" );
this.graphics.fillPolygon(x2,y2);
this.graphics.setStroke(2);
this.graphics.setColor( "#fdf3e0" );
this.graphics.fillPolygon(x,y);
this.graphics.setColor("#a27628");
this.graphics.drawPolygon(x,y);
var x_cir = 15;
var y_cir = 15;
/*this.graphics.setStroke(3);
this.graphics.setColor( "#a27628" );
this.graphics.fillEllipse(this.getWidth()/4,this.getHeight()/4,this.getWidth()/2,this.getHeight()/2);*/
this.graphics.setColor("#a27628");
this.graphics.drawEllipse(this.getWidth()/4,this.getHeight()/4,this.getWidth()/2,this.getHeight()/2);
this.graphics.paint();
};
bpmnGatewayInclusive.prototype.setWorkflow=function(_40c5){
VectorFigure.prototype.setWorkflow.call(this,_40c5);
if(_40c5!=null){
var gatewayPortName = ['input1','input2','output1','output2'];
var gatewayPortType = ['InputPort','InputPort','OutputPort','OutputPort'];
var gatewayPositionX= [0,this.width/2,this.height/2,this.width];
var gatewayPositionY= [this.height/2,0,this.width,this.height/2];
for(var i=0; i< gatewayPortName.length ; i++){
eval('this.'+gatewayPortName[i]+' = new '+gatewayPortType[i]+'()'); //Create New Port
eval('this.'+gatewayPortName[i]+'.setWorkflow(_40c5)'); //Add port to the workflow
eval('this.'+gatewayPortName[i]+'.setName("'+gatewayPortName[i]+'")'); //Set PortName
eval('this.'+gatewayPortName[i]+'.setZOrder(-1)'); //Set Z-Order of the port to -1. It will be below all the figure
eval('this.'+gatewayPortName[i]+'.setBackgroundColor(new Color(255, 255, 255))'); //Setting Background of the port to white
eval('this.'+gatewayPortName[i]+'.setColor(new Color(255, 255, 255))'); //Setting Border of the port to white
eval('this.addPort(this.'+gatewayPortName[i]+','+gatewayPositionX[i]+', '+gatewayPositionY[i]+')'); //Setting Position of the port
}
}
};
bpmnGatewayInclusive.prototype.getContextMenu=function(){
if(this.id != null){
this.workflow.handleContextMenu(this);
}
};

View File

@@ -0,0 +1,67 @@
bpmnGatewayParallel=function(width,_30ab){
VectorFigure.call(this);
this.setDimension(40,40);
};
bpmnGatewayParallel.prototype=new VectorFigure;
bpmnGatewayParallel.prototype.type="bpmnGatewayParallel";
bpmnGatewayParallel.prototype.paint=function(){
VectorFigure.prototype.paint.call(this);
var x=new Array(0,this.width/2,this.width,this.width/2);
var y=new Array(this.height/2,this.height,this.height/2,0);
var x2 = new Array();
var y2 = new Array();
for(var i=0;i<x.length;i++){
x2[i]=x[i]+4;
y2[i]=y[i]+1;
}
this.graphics.setStroke(this.stroke);
this.graphics.setColor( "#c0c0c0" );
this.graphics.fillPolygon(x2,y2);
this.graphics.setStroke(2);
this.graphics.setColor( "#fdf3e0" );
this.graphics.fillPolygon(x,y);
this.graphics.setColor("#a27628");
this.graphics.drawPolygon(x,y);
//var x=new Array(25,35,35,45,45,35,35,25,25,15,15,25);
//var y=new Array(45,45,35,35,25,25,15,15,25,25,35,35);
var x=new Array(this.width/2.4 , this.width/1.7, this.width/1.7, this.width/1.3, this.width/1.3, this.width/1.7, this.width/1.7, this.width/2.4, this.width/2.4, this.width/4, this.width/4, this.width/2.4);
var y=new Array(this.height/1.3,this.height/1.3,this.height/1.7,this.height/1.7,this.height/2.4,this.height/2.4,this.height/4,this.height/4,this.height/2.4,this.height/2.4,this.height/1.7,this.height/1.7);
this.graphics.setColor( "#a27628" );
this.graphics.fillPolygon(x,y);
this.graphics.setColor("#a27628");
this.graphics.drawPolygon(x,y);
this.graphics.paint();
};
bpmnGatewayParallel.prototype.setWorkflow=function(_40c5){
VectorFigure.prototype.setWorkflow.call(this,_40c5);
if(_40c5!=null){
var gatewayPortName = ['input1','input2','output1','output2'];
var gatewayPortType = ['InputPort','InputPort','OutputPort','OutputPort'];
var gatewayPositionX= [0,this.width/2,this.height/2,this.width];
var gatewayPositionY= [this.height/2,0,this.width,this.height/2];
for(var i=0; i< gatewayPortName.length ; i++){
eval('this.'+gatewayPortName[i]+' = new '+gatewayPortType[i]+'()'); //Create New Port
eval('this.'+gatewayPortName[i]+'.setWorkflow(_40c5)'); //Add port to the workflow
eval('this.'+gatewayPortName[i]+'.setName("'+gatewayPortName[i]+'")'); //Set PortName
eval('this.'+gatewayPortName[i]+'.setZOrder(-1)'); //Set Z-Order of the port to -1. It will be below all the figure
eval('this.'+gatewayPortName[i]+'.setBackgroundColor(new Color(255, 255, 255))'); //Setting Background of the port to white
eval('this.'+gatewayPortName[i]+'.setColor(new Color(255, 255, 255))'); //Setting Border of the port to white
eval('this.addPort(this.'+gatewayPortName[i]+','+gatewayPositionX[i]+', '+gatewayPositionY[i]+')'); //Setting Position of the port
}
}
};
bpmnGatewayParallel.prototype.getContextMenu=function(){
if(this.id != null){
this.workflow.handleContextMenu(this);
}
};

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,76 @@
bpmnGroup=function(){
this.titlebar=null;
this.defaultBackgroundColor=new Color(230,230,250);
this.highlightBackgroundColor=new Color(250,250,200);
CompartmentFigure.call(this);
this.setDimension(800,300);
this.setBackgroundColor(this.defaultBackgroundColor);
};
bpmnGroup.prototype=new CompartmentFigure;
bpmnGroup.prototype.type='bpmnGroup';
bpmnGroup.prototype.title='Group';
bpmnGroup.prototype.createHTMLElement=function(){
var item=CompartmentFigure.prototype.createHTMLElement.call(this);
item.style.margin="0px";
item.style.padding="0px";
item.style.border="1px solid black";
item.style.cursor=null;
this.titlebar=document.createElement("div");
this.titlebar.style.position="absolute";
this.titlebar.style.left="0px";
this.titlebar.style.top="0px";
this.titlebar.style.width=(this.getWidth()-5)+"px";
this.titlebar.style.height="15px";
this.titlebar.style.margin="0px";
this.titlebar.style.padding="0px";
this.titlebar.style.font="normal 10px verdana";
this.titlebar.style.backgroundColor="gray";
this.titlebar.style.borderBottom="1px solid gray";
this.titlebar.style.borderLeft="5px solid transparent";
this.titlebar.style.whiteSpace="nowrap";
this.titlebar.style.textAlign="left";
this.titlebar.style.backgroundImage="url(/skins/ext/images/gray/panel/light-hd.gif)";
this.textNode=document.createTextNode(this.title);
this.titlebar.appendChild(this.textNode);
item.appendChild(this.titlebar);
return item;
};
bpmnGroup.prototype.onFigureEnter=function(_3570){
if(this.children[_3570.id]==null){
this.setBackgroundColor(this.highlightBackgroundColor);
}
CompartmentFigure.prototype.onFigureEnter.call(this,_3570);
};
bpmnGroup.prototype.onFigureLeave=function(_3571){
CompartmentFigure.prototype.onFigureLeave.call(this,_3571);
this.setBackgroundColor(this.defaultBackgroundColor);
};
bpmnGroup.prototype.onFigureDrop=function(_3572){
CompartmentFigure.prototype.onFigureDrop.call(this,_3572);
this.setBackgroundColor(this.defaultBackgroundColor);
};
bpmnGroup.prototype.setDimension=function(w,h){
CompartmentFigure.prototype.setDimension.call(this,w,h);
if(this.titlebar!=null){
this.titlebar.style.width=(this.getWidth()-5)+"px";
}
};
bpmnGroup.prototype.setTitle=function(title){
this.title=title;
};
bpmnGroup.prototype.getMinWidth=function(){
return 50;
};
bpmnGroup.prototype.getMinHeight=function(){
return 50;
};
bpmnGroup.prototype.setBackgroundColor=function(color){
this.bgColor=color;
if(this.bgColor!=null){
this.html.style.backgroundColor=this.bgColor.getHTMLStyle();
}else{
this.html.style.backgroundColor="transparent";
}
};

View File

@@ -0,0 +1,36 @@
bpmnLane = function (_30ab) {
VectorFigure.call(this);
this.setDimension(500, 300);
this.setTaskName(_30ab.taskNo); //It will set the Default Task Name with appropriate count While dragging a task on the canvas
};
bpmnLane.prototype = new VectorFigure;
bpmnLane.prototype.type = "bpmnLane";
bpmnLane.prototype.setTaskName = function (name) {
this.taskName = 'Data Object ' + name;
};
bpmnLane.prototype.paint = function () {
VectorFigure.prototype.paint.call(this);
var x = new Array(0, this.getWidth(), this.getWidth(), 0);
var y = new Array(0, 0, this.getHeight(), this.getHeight());
this.graphics.setStroke(this.stroke);
this.graphics.setColor("#c0c0c0");
this.graphics.fillPolygon(x, y);
for (var i = 0; i < x.length; i++) {
x[i] = x[i] - 3;
y[i] = y[i] - 3;
}
this.graphics.setColor("#ffffff");
this.graphics.fillPolygon(x, y);
this.graphics.setColor("#ff0f0f");
this.graphics.drawPolygon(x, y);
this.graphics.drawLine(45, 0-3, 45, this.getHeight()-3);
this.graphics.drawLine(90, 0-3, 90, this.getHeight()-3);
this.graphics.drawLine(45, 150-3, this.getWidth()-3, 150-3);
this.graphics.paint();
this.x_text = this.workflow.getAbsoluteX(); //Get x co-ordinate from figure
this.y_text = this.workflow.getAbsoluteY(); //Get x co-ordinate from figure
}

View File

@@ -0,0 +1,105 @@
bpmnLoopingSubProcess=function(_30ab){
VectorFigure.call(this);
this.setDimension(110,60);
this.setTaskName(_30ab); //It will set the Default Task Name with appropriate count While dragging a task on the canvas
};
bpmnLoopingSubProcess.prototype=new VectorFigure;
bpmnLoopingSubProcess.prototype.type="bpmnLoopingSubProcess";
bpmnLoopingSubProcess.prototype.setTaskName=function(name){
this.taskName = 'Task '+name;
};
bpmnLoopingSubProcess.prototype.paint=function(){
VectorFigure.prototype.paint.call(this);
var x=new Array(6, this.getWidth()-3, this.getWidth(), this.getWidth(), this.getWidth()-3, 6, 3, 3, 6);
var y=new Array(3, 3, 6, this.getHeight()-3, this.getHeight(), this.getHeight(), this.getHeight()-3, 6, 3);
this.graphics.setStroke(this.stroke);
this.graphics.setColor( "#c0c0c0" );
this.graphics.fillPolygon(x,y);
for(var i=0;i<x.length;i++){
x[i]=x[i]-3;
y[i]=y[i]-3;
}
this.graphics.setColor( "#ffffff" );
this.graphics.fillPolygon(x,y);
this.graphics.setColor("#0000ff");
this.graphics.drawPolygon(x,y);
this.graphics.paint();
this.x_text = this.workflow.getAbsoluteX(); //Get x co-ordinate from figure
this.y_text = this.workflow.getAbsoluteY(); //Get x co-ordinate from figure
/* Created New Object of jsGraphics to draw String.
* New object is created to implement changing of Text functionality
*/
var bpmnText = new jsGraphics(this.id);
//bpmnText.drawStringRect(this.taskName,this.getWidth()/2-20,this.getHeight()/2-11,200,'left');
bpmnText.drawString(this.taskName,this.getWidth()/2.5,this.getHeight()/2.5);
bpmnText.paint();
this.bpmnNewText = bpmnText;
if(this.inputPort1!=null){
this.inputPort1.setPosition(this.width,this.height/2);
}
if(this.outputPort1!=null){
this.outputPort1.setPosition(this.width/2,0);
}
if(this.inputPort2!=null){
this.inputPort2.setPosition(this.width/2,this.height);
}
if(this.outputPort2!=null){
this.outputPort2.setPosition(0,this.height/2);
}
};
bpmnLoopingSubProcess.prototype.setWorkflow=function(_40c5){
VectorFigure.prototype.setWorkflow.call(this,_40c5);
if(_40c5!=null){
this.inputPort1=new InputPort();
this.inputPort1.setWorkflow(_40c5);
this.inputPort1.setName("input1");
this.inputPort1.setBackgroundColor(new Color(115, 115, 245));
this.addPort(this.inputPort1,0,this.height/2);
this.inputPort2=new InputPort();
this.inputPort2.setWorkflow(_40c5);
this.inputPort2.setName("input2");
this.inputPort2.setBackgroundColor(new Color(115, 115, 245));
this.addPort(this.inputPort2,this.width/2,0);
this.outputPort1=new OutputPort();
this.outputPort1.setWorkflow(_40c5);
this.outputPort1.setName("output1");
this.outputPort1.setBackgroundColor(new Color(245,115,115));
this.addPort(this.outputPort1,this.width,this.height/2);
this.outputPort2=new OutputPort();
this.outputPort2.setWorkflow(_40c5);
this.outputPort2.setName("output2");
this.outputPort2.setBackgroundColor(new Color(245,115,115));
this.addPort(this.outputPort2,this.width/2,this.height);
}
};
/*Double Click Event for opening the dialog Box*/
bpmnLoopingSubProcess.prototype.onDoubleClick=function(){
var _409d=new bpmnTaskDialog(this);
this.workflow.showDialog(_409d,this.workflow.currentSelection.x,this.workflow.currentSelection.y);
};
/**
* This method will be called if the user pressed the OK button in buttonbar of the dialog.<br>
* The string is first cleared and new string is painted.<br><br>
**/
bpmnLoopingSubProcess.prototype.onOk=function(){
this.figure.bpmnNewText.clear();
//this.figure.bpmnNewText.drawStringRect(this.input.value,this.workflow.currentSelection.width/2-30,this.workflow.currentSelection.height/2-10,200,'left');
this.figure.bpmnNewText.drawString(this.input.value,this.workflow.currentSelection.width/2.5,this.workflow.currentSelection.height/2.5);
this.figure.bpmnNewText.paint();
this.figure.taskName = this.input.value; //Set Updated Text value
this.workflow.removeFigure(this);
};

View File

@@ -0,0 +1,46 @@
bpmnLoopingTask=function(_30ab){
VectorFigure.call(this);
this.setDimension(110,60);
this.setTaskName(_30ab); //It will set the Default Task Name with appropriate count While dragging a task on the canvas
};
bpmnLoopingTask.prototype=new VectorFigure;
bpmnLoopingTask.prototype.type="bpmnLoopingTask";
bpmnLoopingTask.prototype.setTaskName=function(name){
this.taskName = 'Task '+name;
};
bpmnLoopingTask.prototype.paint=function(){
VectorFigure.prototype.paint.call(this);
var x_subtask=new Array(6, this.getWidth()-3, this.getWidth(), this.getWidth(), this.getWidth()-3, 6, 3, 3, 6);
var y_subtask=new Array(3, 3, 6, this.getHeight()-3, this.getHeight(), this.getHeight(), this.getHeight()-3, 6, 3);
var x_subtask=new Array(6,125,128,128,125,6,3,3,6);
var y_subtask=new Array(3,3,6,87,90,90,87,6,3);
this.graphics.setStroke(this.stroke);
this.graphics.setColor( "#c0c0c0" );
this.graphics.fillPolygon(x_subtask,y_subtask);
for(var i=0;i<x_subtask.length;i++){
x_subtask[i]=x_subtask[i]-3;
y_subtask[i]=y_subtask[i]-3;
}
this.graphics.setColor( "#ffffff" );
this.graphics.fillPolygon(x_subtask,y_subtask);
this.graphics.setColor("#00ff00");
this.graphics.drawPolygon(x_subtask,y_subtask);
var x_task=new Array(15, this.getWidth()+6, this.getWidth()+9, this.getWidth()+9, this.getWidth()+6, 15, 12, 12, 15);
var y_task=new Array(3, 3, 6, this.getHeight()-3, this.getHeight(), this.getHeight(), this.getHeight()-3, 6, 3);
this.graphics.setStroke(this.stroke);
this.graphics.setColor( "#c0c0c0" );
this.graphics.fillPolygon(x_task,y_task);
for(var i=0;i<x_task.length;i++){
x_task[i]=x_task[i]-3;
y_task[i]=y_task[i]-3;
}
this.graphics.setColor( "#ffffff" );
this.graphics.fillPolygon(x_task,y_task);
this.graphics.setColor("#00ff00");
this.graphics.drawPolygon(x_task,y_task);
this.graphics.paint();
};

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,53 @@
bpmnPool = function (workflow) {
VectorFigure.call(this);
this.setDimension(800, 600);
var figures = workflow.getFigures();
for(var i=0;i<figures.length;i++)
{
var test = figures[i];
}
//workflow.moveFront(workflow.getFigures());
//ToolGeneric.prototype.execute.call(this);
// this.processName = workflow.processInfo.title.label; //It will set the Default Task Name with appropriate count While dragging a task on the canvas
};
bpmnPool.prototype = new VectorFigure;
bpmnPool.prototype.type = "bpmnPool";
//bpmnPool.prototype.setTaskName = function (name) {
// this.taskName = 'Data Object ' + name;
//};
bpmnPool.prototype.paint = function () {
VectorFigure.prototype.paint.call(this);
//Setting up Limitation in Width and Height
if(this.getWidth() < 150 )
{
this.setDimension(150, this.getHeight());
}
if(this.getHeight() < 80 )
{
this.setDimension(this.getWidth(), 80);
}
var x = new Array(0, this.getWidth(), this.getWidth(), 0);
var y = new Array(0, 0, this.getHeight(), this.getHeight());
this.graphics.setStroke(this.stroke);
this.graphics.setColor("#c0c0c0");
this.graphics.fillPolygon(x, y);
for (var i = 0; i < x.length; i++) {
x[i] = x[i] - 3;
y[i] = y[i] - 3;
}
this.graphics.setColor("#ffffff");
this.graphics.fillPolygon(x, y);
this.graphics.setColor("#ff0f0f");
this.graphics.drawPolygon(x, y);
//this.graphics.setColor("#000000");
this.graphics.drawLine(45, 0-3,45,this.getHeight()-3);
this.graphics.paint();
this.x_text = this.workflow.getAbsoluteX(); //Get x co-ordinate from figure
this.y_text = this.workflow.getAbsoluteY(); //Get x co-ordinate from figure
}

View File

@@ -0,0 +1,392 @@
ProcessMapContext=function(id){
Workflow.call(this,id);
};
ProcessMapContext.prototype=new Workflow;
ProcessMapContext.prototype.type="ProcessMap";
ProcessMapContext.prototype.editProcess= function(_5678)
{
var editProcessData = _5678.scope.workflow.processEdit;
var processCategoryData = _5678.scope.workflow.processCategory;
var debug =editProcessData.PRO_DEBUG;
var pro_category =editProcessData.PRO_CATEGORY;
var pro_category_label = editProcessData.PRO_CATEGORY_LABEL;
var checkDebug = true;
if(debug == '0')
checkDebug = false;
var processCalendar = new Array();
processCalendar[0] = new Array();
processCalendar[1] = new Array();
processCalendar[0].name = 'None';
processCalendar[0].value = '';
processCalendar[1].name = 'Default';
processCalendar[1].value = '00000000000000000000000000000001';
//var processName = processInfo.title.label
var editProcess = new Ext.FormPanel({
labelWidth: 75, // label settings here cascade unless overridden
frame:true,
bodyStyle:'padding:5px 5px 0',
width: 500,
height: 400,
defaults: {width: 350},
defaultType: 'textfield',
items: [{
xtype:'fieldset',
title: 'Process Information',
collapsible: false,
autoHeight:true,
buttonAlign : 'center',
width: 450,
defaultType: 'textfield',
items: [{
fieldLabel: 'Title',
name: 'title',
value: editProcessData.PRO_TITLE,
allowBlank:false
},{
xtype: 'textarea',
fieldLabel: 'Description',
name: 'description',
value: editProcessData.PRO_DESCRIPTION,
width: 300,
height : 150
},{
width: 100,
xtype: 'combo',
mode: 'local',
value: editProcessData.PRO_CALENDAR,
forceSelection: true,
triggerAction: 'all',
editable: false,
fieldLabel: 'Calendar',
name: 'calendar',
hiddenName: 'calendar',
displayField: 'name',
valueField: 'value',
store: new Ext.data.JsonStore({
fields : ['name', 'value'],
data : processCalendar
})
}, {
width: 100,
xtype: 'combo',
mode: 'local',
value: editProcessData.PRO_CATEGORY,
triggerAction: 'all',
forceSelection: true,
editable: false,
fieldLabel: 'Category',
name: 'category',
hiddenName: 'category',
displayField: 'CATEGORY_NAME',
valueField: 'CATEGORY_UID',
store: new Ext.data.JsonStore({
fields : ['CATEGORY_NAME', 'CATEGORY_UID'],
data :processCategoryData
})
},{
xtype: 'checkbox',
fieldLabel: 'Debug',
name: 'debug',
checked:checkDebug
}
]
}]
});
editProcess.render(document.body);
_5678.scope.workflow.editProcessForm = editProcess;
var window = new Ext.Window({
title: 'Edit Process',
collapsible: false,
maximizable: false,
width: 500,
height: 400,
minWidth: 300,
minHeight: 200,
layout: 'fit',
plain: true,
bodyStyle: 'padding:5px;',
buttonAlign: 'center',
items: editProcess,
buttons: [{
text: 'Save',
handler: function(){
//waitMsg: 'Saving...', // Wait Message
var fields = editProcess.items.items;
var pro_title = fields[0].items.items[0].getValue();
var pro_description = fields[0].items.items[1].getValue();
var pro_calendar = fields[0].items.items[2].getValue();
var pro_category = fields[0].items.items[3].getValue();
var pro_debug = fields[0].items.items[4].getValue();
if(pro_debug == true)
pro_debug = '1';
else
pro_debug = '0';
var pro_uid = _5678.scope.workflow.getUrlVars();
var urlparams = '?action=saveProcess&data={"PRO_UID":"'+ pro_uid +'","PRO_CALENDAR":"'+ pro_calendar +'","PRO_CATEGORY":"'+ pro_category +'","PRO_DEBUG":"'+ pro_debug +'","PRO_DESCRIPTION":"'+ pro_description +'","PRO_TITLE":"'+ pro_title +'",}';
Ext.Ajax.request({
url: "processes_Ajax.php"+ urlparams,
success: function(response) {
window.close();
},
failure: function(){
Ext.Msg.alert ('Failure');
}
});
}
},{
text: 'Cancel',
handler: function(){
// when this button clicked,
window.close();
}
}]
});
window.show();
}
ProcessMapContext.prototype.exportProcess= function()
{
workflow.FILENAME_LINK = '';
workflow.FILENAME_LINKXPDL = '';
/*var exportProcessFields = Ext.data.Record.create([
{
name: 'PRO_TITLE',
type: 'string'
},{
name: 'PRO_DESCRIPTION',
type: 'string'
},{
name: 'SIZE',
type: 'string'
},{
name: 'File',
type: 'string'
}]);
var pro_uid = workflow.getUrlVars();
exportProcess = new Ext.data.JsonStore
({
root : 'data',
totalProperty: 'totalCount',
idProperty : 'gridIndex',
remoteSort : true,
fields : exportProcessFields,
proxy : new Ext.data.HttpProxy({
url : 'proxyProcesses_Export?pro_uid='+pro_uid
})
});
//taskUsers.setDefaultSort('LABEL', 'asc');
exportProcess.load();*/
var exportProcessForm = new Ext.FormPanel({
labelWidth : 120, // label settings here cascade unless overridden
frame : true,
title : '',
bodyStyle : 'padding:5px 5px 0',
width : 500,
height : 400,
defaultType : 'textfield',
buttonAlign : 'center',
items: [
{
xtype :'fieldset',
title : 'Process Info',
collapsible: false,
autoHeight :true,
buttonAlign: 'center',
defaults : {width: 210},
//defaultType: 'textfield',
items: [
{
xtype : 'textfield',
fieldLabel : 'Process Title',
name : 'PRO_TITLE',
readOnly :true
},{
xtype : 'textfield',
fieldLabel : 'Description',
name : 'PRO_DESCRIPTION',
readOnly :true
},{
xtype : 'textfield',
fieldLabel : 'Size in bytes',
name : 'SIZE',
readOnly :true
},{
xtype : 'textfield',
fieldLabel : 'File',
name : 'FILENAME_LINK',
readOnly :true
},{
xtype : 'textfield',
fieldLabel : 'File XPDL',
name : 'FILENAME_LINKXPDL',
dataIndex : 'FILENAME_LINKXPDL',
readOnly :true
},{
xtype : 'button',
name : 'FILENAME_LINK',
html : '<a href=\"http:\/\/www.google.at\">Link<\/a>',
width :100
},{
sortable: false,
renderer: function()
{
return String.format("<a href=\"http:\/\/www.google.at\">x<\/a>");
}
}
]
}]
});
exportProcessForm.render(document.body);
var pro_uid = workflow.getUrlVars();
workflow.exportProcessForm = exportProcessForm;
exportProcessForm.form.load({
url:'proxyProcesses_Export?pro_uid='+pro_uid,
method:'GET',
waitMsg:'Loading',
success:function(form, action) {
var aData = action.result.data;
var fieldSet = workflow.exportProcessForm.items.items[0];
var fields = fieldSet.items.items;
var link = new Ext.form.TextField({
xtype : 'button',
name : 'FILENAME_LINK',
html : '<a href=\"http:\/\/www.google.at\">Link<\/a>',
width :100
});
workflow.exportProcessForm.add(link);
//this.add(form);
//this.doLayout();
fields[5].render = '<a href=\"http:\/\/www.google.com\">x<\/a>';
workflow.FILENAME_LINK = aData.FILENAME_LINK;
//workflow.FILENAME_LINKXPDL = aData.FILENAME_LINKXPDL;
},
failure:function(form, action) {
// Ext.MessageBox.alert('Message', 'Load failed');
}
});
var exportProcesswindow = new Ext.Window({
title : 'Export Process',
collapsible: false,
maximizable: false,
width : 450,
height : 450,
minWidth : 300,
minHeight : 200,
layout : 'fit',
plain : true,
bodyStyle : 'padding:5px;',
buttonAlign: 'center',
items : exportProcessForm
});
workflow.exportProcesswindow = exportProcesswindow;
exportProcesswindow.show();
}
ProcessMapContext.prototype.addTask= function()
{
Ext.MessageBox.alert('Status','Add Task');
}
ProcessMapContext.prototype.horiLine= function()
{
Ext.MessageBox.alert('Status','Horizontal Line');
}
ProcessMapContext.prototype.vertiLine= function()
{
Ext.MessageBox.alert('Status','Vertical Line');
}
ProcessMapContext.prototype.delLines= function()
{
Ext.MessageBox.alert('Status','Delete All Lines');
}
ProcessMapContext.prototype.processPermission= function()
{
Ext.MessageBox.alert('Status','Process Permission');
}
ProcessMapContext.prototype.caseTracker= function()
{
Ext.MessageBox.alert('Status','Case Tracker');
}
ProcessMapContext.prototype.processFileManager= function()
{
var AwesomeUploaderInstance = new AwesomeUploader({
title:'Ext JS Super Uploader'
,renderTo:'paintarea'
,frame:true
,width:500
,height:300
});
var window = new Ext.Window({
title: 'Edit Process',
collapsible: false,
maximizable: false,
width: 500,
height: 400,
minWidth: 300,
minHeight: 200,
layout: 'fit',
plain: true,
bodyStyle: 'padding:5px;',
buttonAlign: 'center',
items: AwesomeUploaderInstance,
buttons: [{
text: 'Save',
handler: function(){
//waitMsg: 'Saving...', // Wait Message
var fields = editProcess.items.items;
var pro_title = fields[0].items.items[0].getValue();
var pro_description = fields[0].items.items[1].getValue();
var pro_calendar = fields[0].items.items[2].getValue();
var pro_category = fields[0].items.items[3].getValue();
var pro_debug = fields[0].items.items[4].getValue();
if(pro_debug == true)
pro_debug = '1';
else
pro_debug = '0';
var pro_uid = _5678.scope.workflow.getUrlVars();
var urlparams = '?action=saveProcess&data={"PRO_UID":"'+ pro_uid +'","PRO_CALENDAR":"'+ pro_calendar +'","PRO_CATEGORY":"'+ pro_category +'","PRO_DEBUG":"'+ pro_debug +'","PRO_DESCRIPTION":"'+ pro_description +'","PRO_TITLE":"'+ pro_title +'",}';
Ext.Ajax.request({
url: "processes_Ajax.php"+ urlparams,
success: function(response) {
window.close();
},
failure: function(){
Ext.Msg.alert ('Failure');
}
});
}
},{
text: 'Cancel',
handler: function(){
// when this button clicked,
window.close();
}
}]
});
window.show();
}

View File

@@ -0,0 +1,430 @@
ProcessOptions=function(id){
Workflow.call(this,id);
};
ProcessOptions.prototype=new Workflow;
ProcessOptions.prototype.type="ProcessOptions";
/**
* 'addDynaform' function that will allow adding new dynaforms and showing list of
* dynaforms available
*/
ProcessOptions.prototype.addDynaform= function(_5625)
{
var pro_uid = workflow.getUrlVars();
//var taskId = workflow.currentSelection.id;
var dynaFields = Ext.data.Record.create([
{ name: 'DYN_UID', type: 'string'},
{ name: 'DYN_TYPE', type: 'string'},
{ name: 'DYN_TITLE', type: 'string'},
{ name: 'DYN_DISCRIPTION',type: 'string'}
]);
var editor = new Ext.ux.grid.RowEditor({
saveText: 'Update'
});
var btnAdd = new Ext.Button({
id: 'btnAdd',
text: 'New Dynaform',
iconCls: 'application_add',
handler: function () {
}
});
var btnRemove = new Ext.Button({
id: 'btnRemove',
text: 'Delete Dynaform',
iconCls: 'application_delete',
handler: function (s) {
editor.stopEditing();
var s = dynaformGrid.getSelectionModel().getSelections();
for(var i = 0, r; r = s[i]; i++){
//First Deleting dynaform from Database using Ajax
var dynUID = r.data.DYN_UID;
//if STEP_UID is properly defined (i.e. set to valid value) then only delete the row
//else its a BLANK ROW for which Ajax should not be called.
if(r.data.DYN_UID != "")
{
Ext.Ajax.request({
url : '../dynaforms/dynaforms_Delete.php',
method: 'POST',
params: {
DYN_UID : dynUID
},
success: function(response) {
Ext.MessageBox.alert ('Status','Dynaform has been removed successfully.');
}
});
}
//Secondly deleting from Grid
taskDynaform.remove(r);
}
}
});
var tb = new Ext.Toolbar({
items: [btnAdd, btnRemove]
});
var taskDynaform = new Ext.data.JsonStore({
root : 'data',
totalProperty: 'totalCount',
idProperty : 'gridIndex',
remoteSort : true,
fields : dynaFields,
proxy: new Ext.data.HttpProxy({
url: 'proxyDynaform?pid='+pro_uid
})
});
taskDynaform.load();
//Creating store for getting list of additional PM tables
var additionalTablesFields = Ext.data.Record.create([
{ name: 'ADD_TAB_UID', type: 'string'},
{ name: 'ADD_TAB_NAME', type: 'string'},
{ name: 'ADD_TAB_DESCRIPTION',type: 'string'}
]);
var additionalTables = new Ext.data.JsonStore({
root : 'data',
totalProperty: 'totalCount',
idProperty : 'gridIndex',
remoteSort : true,
fields : additionalTablesFields,
proxy: new Ext.data.HttpProxy({
url: 'proxyDynaform'
})
});
additionalTables.load();
//Creating store for getting list of Fields of additional PM tables
var TablesFields = Ext.data.Record.create([
{ name: 'FLD_UID',type: 'string'},
{ name: 'FLD_NAME',type: 'string'},
{ name: 'FLD_DESCRIPTION',type: 'string'},
{ name: 'FLD_TYPE',type: 'string'}
]);
var tablesFieldsStore = new Ext.data.JsonStore({
root : 'data',
totalProperty: 'totalCount',
idProperty : 'gridIndex',
remoteSort : true,
fields : TablesFields,
proxy: new Ext.data.HttpProxy({
url: 'proxyDynaform'
})
});
//tablesFieldsStore.load();
var dynaformColumns = new Ext.grid.ColumnModel({
columns: [
new Ext.grid.RowNumberer(),
{
id: 'DYN_TITLE',
header: 'Title',
dataIndex: 'DYN_TITLE',
width: 280,
editable: false,
editor: new Ext.form.TextField({
//allowBlank: false
})
},
{
sortable: false,
renderer: function(val, meta, record)
{
return String.format("<a href='../dynaforms/dynaforms_Editor?PRO_UID={0}&DYN_UID={1}'>Edit</a>",pro_uid,record.data.DYN_UID);
}
}
]
});
var addTableColumns = new Ext.grid.ColumnModel({
columns: [
new Ext.grid.RowNumberer(),
{
id: 'FLD_NAME',
header: 'Primary Key',
dataIndex: 'FLD_NAME',
width: 200,
editable: false,
sortable: true,
editor: {
xtype: 'textfield',
allowBlank: false,
name : 'FLD_NAME'
}
},{
id: 'PRO_VARIABLE',
header: 'Variables',
dataIndex: 'PRO_VARIABLE',
width: 200,
sortable: true,
editor: {
xtype: 'textfield',
allowBlank: false,
name : 'PRO_VARIABLE'
}
},{
sortable: false,
renderer: function(val){return '<input type="button" value="@@" id="'+val+'"/>';}
}
]
});
/*var dynaformGrid = new Ext.grid.GridPanel({
store: taskDynaform,
id : 'mygrid',
loadMask: true,
loadingText: 'Loading...',
renderTo: 'cases-grid',
frame: false,
autoHeight:false,
clicksToEdit: 1,
minHeight:400,
height :400,
layout: 'fit',
cm: dynaformColumns,
stripeRows: true,
tbar: tb,
viewConfig: {forceFit: true}
});*/
var dynaformDetails = new Ext.FormPanel({
labelWidth: 100,
bodyStyle :'padding:5px 5px 0',
width : 550,
items:
[{
xtype: 'fieldset',
layout: 'fit',
border:true,
title: 'Please select the Dynaform Type',
width: 550,
collapsible: false,
labelAlign: 'top',
items:[{
xtype: 'radiogroup',
id: 'dynaformType',
layout: 'fit',
fieldLabel: 'Type',
itemCls: 'x-check-group-alt',
columns: 1,
items: [
{
boxLabel: 'Blank Dynaform',
name: 'DYN_SOURCE',
inputValue: 'blankDyna',
checked: true
},
{
boxLabel: 'PM Table Dynaform',
name: 'DYN_SOURCE',
inputValue: 'pmTableDyna'
}],
listeners: {
change: function(radiogroup, radio) {
if(radio.inputValue == 'blankDyna')
{
Ext.getCmp("blankDynaform").show();
Ext.getCmp("pmTableDynaform").hide();
}
else
{
Ext.getCmp("blankDynaform").hide();
Ext.getCmp("pmTableDynaform").show();
}
}
}
}]
},
{
xtype: 'fieldset',
id: 'blankDynaform',
border:true,
hidden: false,
title: 'Dynaform Information',
width: 550,
items:[{
xtype : 'textfield',
fieldLabel: 'Title',
name : 'DYN_TITLE',
allowBlank: false
},{
width: 150,
xtype: 'combo',
mode: 'local',
editable: false,
fieldLabel: 'Type',
triggerAction: 'all',
forceSelection: true,
name: 'ACTION',
displayField: 'name',
valueField: 'value',
value : 'Normal',
store: new Ext.data.JsonStore({
fields : ['name', 'value'],
data : [
{name : 'Normal', value: 'Normal'},
{name : 'Grid', value: 'Grid'},
]
})
},{
xtype : 'textarea',
fieldLabel: 'Description',
name : 'DYN_DESCRIPTION',
height : 120,
width : 350
}
]
},{
xtype: 'fieldset',
id: 'pmTableDynaform',
border:true,
hidden: true,
title: 'Dynaform Information',
width: 550,
items:[{
width: 150,
xtype: 'combo',
mode: 'local',
editable: false,
triggerAction: 'all',
forceSelection: true,
fieldLabel: 'Create from a PM Table',
name: 'ADD_TABLE',
displayField: 'ADD_TAB_NAME',
valueField: 'ADD_TAB_UID',
value : '---------------------------',
store : additionalTables,
onSelect: function(record, index){
var link = 'proxyDynaform?tabId='+record.data.ADD_TAB_UID;
tablesFieldsStore.proxy.setUrl(link, true);
tablesFieldsStore.load();
/*Ext.Ajax.request({
url : 'proxyDynaform?tabId='+record.data.ADD_TAB_UID,
method: 'GET',
success: function(response) {
var fields = Ext.util.JSON.decode(response.responseText);
Ext.getCmp("FLD_NAME").setValue(fields[0].FLD_NAME);
}
});*/
Ext.getCmp("fieldsGrid").show();
this.setValue(record.data[this.valueField || this.displayField]);
this.collapse();
}
},{
xtype : 'textfield',
fieldLabel: 'Title',
name : 'DYN_TITLE',
allowBlank: false
},{
xtype : 'textarea',
fieldLabel: 'Description',
name : 'DYN_DESCRIPTION',
height : 120,
width : 350
},
{
xtype: 'grid',
id:'fieldsGrid',
hidden: true,
ds: tablesFieldsStore,
cm: addTableColumns,
width: 550,
height: 300,
//autoHeight: true,
plugins: [editor],
//loadMask : true,
loadingText : 'Loading...',
border: true,
renderTo : Ext.getBody()
}
]
}
]
});
var gridWindow = new Ext.Window({
title: 'Dynaform',
collapsible: false,
maximizable: true,
width: 600,
//autoHeight: true,
height: 500,
layout: 'fit',
plain: true,
bodyStyle: 'padding:5px;',
buttonAlign: 'center',
items: dynaformDetails,
buttons: [{
text: 'Save',
handler: function(){
var getForm = dynaformDetails.getForm().getValues();
//var sDynaType = getForm.DYN_SOURCE;
if(getForm.DYN_SOURCE == 'blankDyna')
{
var sAction = getForm.ACTION;
var sTitle = getForm.DYN_TITLE[0];
var sDesc = getForm.DYN_DESCRIPTION[0];
}
else
{
//sAction = getForm.ADD_TABLE;
var aFields = new Array();
var aStoreFields = tablesFieldsStore.data.items;
var aData = '';
for(var i=0;i<aStoreFields.length;i++)
{
/*aFields[i] = new Array();
aFields[i] = aStoreFields[i].data.FLD_NAME;
aFields[i] = aStoreFields[i].data.PRO_VARIABLE;*/
var fName = aStoreFields[i].data.FLD_NAME;
var pVar = aStoreFields[i].data.PRO_VARIABLE;
aData = '"FLD_NAME":"'+fName+'","PRO_VARIABLE":"'+pVar+'"';
}
var sData = '[' +aData+ ']';
//var sFields = Ext.util.JSON.encode(aData);
sTitle = getForm.DYN_TITLE[1];
sDesc = getForm.DYN_DESCRIPTION[1];
var sAddTab = getForm.ADD_TABLE;
}
Ext.Ajax.request({
url : '../dynaforms/dynaforms_Save.php',
method: 'POST',
params:{
//ACTION : sAction,
FIELDS : sData,
ADD_TABLE : sAddTab,
PRO_UID : pro_uid,
DYN_TITLE : sTitle,
DYN_TYPE : 'xmlform',
DYN_DESCRIPTION : sDesc
},
success: function(response) {
Ext.MessageBox.alert ('Status','Dynaform has been created successfully.');
}
});
}
},{
text: 'Cancel',
handler: function(){
// when this button clicked,
gridWindow.close();
}
}]
});
gridWindow.show();
}

View File

@@ -0,0 +1,208 @@
bpmnSubProcess = function (_30ab) {
VectorFigure.call(this);
this.setDimension(165, 50);
this.subProcessName = _30ab.subProcessName; //It will set the Default Task Name with appropriate count While dragging a task on the canvas
};
bpmnSubProcess.prototype = new VectorFigure;
bpmnSubProcess.prototype.type = "bpmnSubProcess"
bpmnSubProcess.prototype.setSubProcessName = function () {
this.subProcessName = 'Sub Process';
};
bpmnSubProcess.prototype.coord_converter = function (bound_width, bound_height, text_length) {
//bound_width = this.workflow.currentSelection.width;
//bound_height = this.workflow.currentSelection.height;
input_width = text_length * 6
input_height = 10
temp_width = bound_width - input_width;
temp_width /= 2;
temp_x = temp_width;
temp_height = bound_height - 10;
temp_height /= 2;
temp_y = temp_height;
var temp_coord = new Object();
temp_coord.temp_x = temp_x;
temp_coord.temp_y = temp_y;
return temp_coord;
};
//curWidth = this.getWidth();
bpmnSubProcess.prototype.paint = function () {
VectorFigure.prototype.paint.call(this);
var x = new Array(6, this.getWidth() - 3, this.getWidth(), this.getWidth(), this.getWidth() - 3, 6, 3, 3, 6);
var y = new Array(3, 3, 6, this.getHeight() - 3, this.getHeight(), this.getHeight(), this.getHeight() - 3, 6, 3);
this.graphics.setStroke(this.stroke);
this.graphics.setColor("#c0c0c0");
this.graphics.fillPolygon(x, y);
for (var i = 0; i < x.length; i++) {
x[i] = x[i] - 3;
y[i] = y[i] - 3;
}
this.graphics.setColor("#ffffff");
this.graphics.fillPolygon(x, y);
this.graphics.setColor("#5164b5"); //Blue Color
this.graphics.drawPolygon(x, y);
//Circle on right top corner
var x_cir = this.getWidth()/1.3;
var y_cir = this.getHeight()/8.75;
this.graphics.setColor("#ffffff");
this.graphics.fillEllipse(x_cir,y_cir,this.getHeight()/5,this.getHeight()/5);
this.graphics.setColor("#5891B7");
this.graphics.setStroke(2);
this.graphics.drawEllipse(x_cir,y_cir,this.getHeight()/5,this.getHeight()/5);
//Plus symbol on bottom
var x1=new Array(this.getWidth()/2.6,this.getWidth()/2.6,this.getWidth()/1.8,this.getWidth()/1.8);
var y1=new Array(this.getHeight()/1.45,this.getHeight() - 5,this.getHeight() - 5,this.getHeight()/1.45);
var x2 = new Array();
var y2 = new Array();
for(var j=0;j<x1.length;j++){
x2[j]=x1[j]+4;
y2[j]=y1[j]+1;
}
//this.graphics.fillPolygon(x2,y2);
this.graphics.setColor( "#FFFFFF" );
//this.graphics.fillPolygon(x1,y1);
this.graphics.setColor("#5891B7");
this.graphics.drawPolygon(x1,y1);
//this.graphics.setStroke(1);
//var x_cross=new Array(54,54,59,59,63,63,68,68,63,63,59,59);
// var y_cross=new Array(57,61,61,65,65,61,61,57,57,52,52,57);
var x_cross=new Array(this.getWidth()/2.4, this.getWidth()/2.4,this.getWidth()/2.2,this.getWidth()/2.2,this.getWidth()/2.06,this.getWidth()/2.06,this.getWidth()/1.91,this.getWidth()/1.91,this.getWidth()/2.06,this.getWidth()/2.06,this.getWidth()/2.2,this.getWidth()/2.2);
var y_cross=new Array(this.getHeight()/1.22,this.getHeight()/1.15,this.getHeight()/1.15,this.getHeight()/1.07,this.getHeight()/1.07,this.getHeight()/1.15,this.getHeight()/1.15,this.getHeight()/1.22,this.getHeight()/1.22,this.getHeight()/1.35,this.getHeight()/1.35,this.getHeight()/1.22);
this.graphics.setColor( "#5891B7" );
this.graphics.fillPolygon(x_cross,y_cross);
this.graphics.paint();
var bpmnText = new jsGraphics(this.id);
var padleft = 0.025*this.getWidth();
var padtop = 0.36*this.getHeight();
var rectwidth = this.getWidth() - padleft;
var rectheight = this.getHeight() - 2*padtop;
//var rectheight = this.getHeight() - 2*padtop;
bpmnText.drawStringRect(this.subProcessName,padleft,padtop,rectwidth,rectheight,'center');
// tempcoord = this.coord_converter(this.getWidth(), this.getHeight(), this.taskName.length);
// bpmnText.drawTextString(this.taskName, this.getWidth(), this.getHeight(), tempcoord.temp_x, tempcoord.temp_y);
bpmnText.paint();
this.bpmnNewText = bpmnText;
};
jsGraphics.prototype.drawTextString = function (txt, x, y, dx, dy) {
this.htm += '<div style="position:absolute; display:table-cell; vertical-align:middle; height:' + y + '; width:' + x + ';' + 'margin-left:' + dx + 'px;' + 'margin-top:' + dy + 'px;' + 'font-family:' + this.ftFam + ';' + 'font-size:' + this.ftSz + ';' + 'color:' + this.color + ';' + this.ftSty + '">' + txt + '<\/div>';
};
bpmnSubProcess.prototype.setWorkflow = function (_40c5) {
VectorFigure.prototype.setWorkflow.call(this, _40c5);
if (_40c5 != null) {
/*Adding Port to the Task After dragging Task on the Canvas
*Ports will be invisibe After Drag and Drop, But It will be created
*/
var TaskPortName = ['output1','output2','input1','input2'];
var TaskPortType = ['OutputPort','OutputPort','InputPort','InputPort'];
var TaskPositionX= [this.width/2,this.width,0,this.width/2];
var TaskPositionY= [this.height,this.height/2,this.height/2,0];
for(var i=0; i< TaskPortName.length ; i++){
eval('this.'+TaskPortName[i]+' = new '+TaskPortType[i]+'()'); //Create New Port
eval('this.'+TaskPortName[i]+'.setWorkflow(_40c5)'); //Add port to the workflow
eval('this.'+TaskPortName[i]+'.setName("'+TaskPortName[i]+'")'); //Set PortName
eval('this.'+TaskPortName[i]+'.setZOrder(-1)'); //Set Z-Order of the port to -1. It will be below all the figure
eval('this.'+TaskPortName[i]+'.setBackgroundColor(new Color(255, 255, 255))'); //Setting Background of the port to white
eval('this.'+TaskPortName[i]+'.setColor(new Color(255, 255, 255))'); //Setting Border of the port to white
eval('this.addPort(this.'+TaskPortName[i]+','+TaskPositionX[i]+', '+TaskPositionY[i]+')'); //Setting Position of the port
}
}
};
bpmnSubProcessDialog = function (_2e5e) {
this.figure = _2e5e;
var title = 'Sub Process';
Dialog.call(this, title);
this.setDimension(400, 150); //Set the width and height of the Dialog box
}
bpmnSubProcessDialog.prototype = new Dialog();
bpmnSubProcessDialog.prototype.createHTMLElement = function () {
var item = Dialog.prototype.createHTMLElement.call(this);
var inputDiv = document.createElement("form");
inputDiv.style.position = "absolute";
inputDiv.style.left = "10px";
inputDiv.style.top = "30px";
inputDiv.style.width = "375px";
inputDiv.style.font = "normal 10px verdana";
item.appendChild(inputDiv);
this.label = document.createTextNode("Sub Process Name");
inputDiv.appendChild(this.label);
this.input = document.createElement("textarea");
this.input.style.border = "1px solid gray";
this.input.style.font = "normal 10px verdana";
//this.input.type = "text";
this.input.maxLength = "500";
this.input.cols = "50";
this.input.rows = "3";
var value = bpmnTask.prototype.trim(this.figure.workflow.currentSelection.subProcessName);
if (value) this.input.value = value;
else this.input.value = "";
this.input.style.width = "100%";
inputDiv.appendChild(this.input);
this.input.focus();
return item;
};
/*Double Click Event for opening the dialog Box*/
bpmnSubProcess.prototype.onDoubleClick = function () {
var _409d = new bpmnSubProcessDialog(this);
this.workflow.showDialog(_409d, this.workflow.currentSelection.x, this.workflow.currentSelection.y);
};
/**
* This method will be called if the user pressed the OK button in buttonbar of the dialog.<br>
* The string is first cleared and new string is painted.<br><br>
**/
bpmnSubProcessDialog.prototype.onOk = function () {
this.figure.bpmnNewText.clear();
len = Math.ceil(this.input.value.length/16);
if(this.input.value.length < 19)
{
len = 1.5;
if(this.input.value.length > 9)
this.figure.rectWidth = this.input.value.length*8;
else
this.figure.rectWidth = 48;
}
else
this.figure.rectWidth = 150;
//tempcoord = this.workflow.currentSelection.coord_converter(this.workflow.currentSelection.width, this.workflow.currentSelection.height, this.input.value.length)
this.figure.bpmnNewText.drawStringRect(this.input.value,20,20,this.figure.rectWidth,'left');
// this.figure.bpmnNewText.drawTextString(this.input.value, this.workflow.currentSelection.width, this.workflow.currentSelection.height, tempcoord.temp_x, tempcoord.temp_y);
this.figure.bpmnNewText.paint();
this.figure.subProcessName = this.input.value; //Set Updated Text value
if(this.figure.rectWidth<80)
tempW = 110;
else
tempW = this.figure.rectWidth+35;
this.workflow.currentSelection.setDimension(tempW, len*13+40);
this.workflow.removeFigure(this);
};
bpmnSubProcess.prototype.getContextMenu = function () {
this.workflow.handleContextMenu(this);
};

View File

@@ -0,0 +1,33 @@
Task=function(){
ImageFigure.call(this,'/skins/ext/images/gray/shapes/Task.png');
this.outputPort=null;
this.setDimension(94,66);
return this;
};
Task.prototype=new ImageFigure;
Task.prototype.type="Task";
Task.prototype.setWorkflow=function(_40c5){
ImageFigure.prototype.setWorkflow.call(this,_40c5);
if(_40c5!=null&&this.outputPort==null){
this.outputPort=new MyOutputPort();
this.outputPort.setWorkflow(_40c5);
this.outputPort.setMaxFanOut(4);
this.outputPort.setBackgroundColor(new Color(245,115,115));
this.addPort(this.outputPort,this.width,this.height/2);
this.outputPort1=new MyOutputPort();
this.outputPort1.setWorkflow(_40c5);
this.outputPort1.setMaxFanOut(4);
this.outputPort1.setBackgroundColor(new Color(245,115,115));
this.addPort(this.outputPort1,this.width/2,0);
this.outputPort2=new MyOutputPort();
this.outputPort2.setWorkflow(_40c5);
this.outputPort2.setMaxFanOut(4);
this.outputPort2.setBackgroundColor(new Color(245,115,115));
this.addPort(this.outputPort2,this.width/2,this.height);
this.outputPort3=new MyOutputPort();
this.outputPort3.setWorkflow(_40c5);
this.outputPort3.setMaxFanOut(4);
this.outputPort3.setBackgroundColor(new Color(245,115,115));
this.addPort(this.outputPort3,0,this.height/2);
}
};

View File

@@ -0,0 +1,281 @@
Task2=function(){
this.cornerWidth=15;
this.cornerHeight=15;
Node.call(this);
this.setDimension(100,100);
this.originalHeight=-1;
};
Task2.prototype=new Node;
Task2.prototype.type="Task2";
Task2.prototype.createHTMLElement=function(){
var item=document.createElement("div");
item.id=this.id;
item.style.position="absolute";
item.style.left=this.x+"px";
item.style.top=this.y+"px";
item.style.height=this.width+"px";
item.style.width=this.height+"px";
item.style.margin="0px";
item.style.padding="0px";
item.style.outline="none";
item.style.zIndex=""+Figure.ZOrderBaseIndex;
this.top_left=document.createElement("div");
this.top_left.style.background="url(/skins/ext/images/gray/shapes/circle.png) no-repeat top left";
this.top_left.style.position="absolute";
this.top_left.style.width=this.cornerWidth+"px";
this.top_left.style.height=this.cornerHeight+"px";
this.top_left.style.left="0px";
this.top_left.style.top="0px";
this.top_left.style.fontSize="2px";
this.top_right=document.createElement("div");
this.top_right.style.background="url(/skins/ext/images/gray/shapes/circle.png) no-repeat top right";
this.top_right.style.position="absolute";
this.top_right.style.width=this.cornerWidth+"px";
this.top_right.style.height=this.cornerHeight+"px";
this.top_right.style.left="0px";
this.top_right.style.top="0px";
this.top_right.style.fontSize="2px";
this.bottom_left=document.createElement("div");
this.bottom_left.style.background="url(/skins/ext/images/gray/shapes/circle.png) no-repeat bottom left";
this.bottom_left.style.position="absolute";
this.bottom_left.style.width=this.cornerWidth+"px";
this.bottom_left.style.height=this.cornerHeight+"px";
this.bottom_left.style.left="0px";
this.bottom_left.style.top="0px";
this.bottom_left.style.fontSize="2px";
this.bottom_right=document.createElement("div");
this.bottom_right.style.background="url(/skins/ext/images/gray/shapes/circle.png) no-repeat bottom right";
this.bottom_right.style.position="absolute";
this.bottom_right.style.width=this.cornerWidth+"px";
this.bottom_right.style.height=this.cornerHeight+"px";
this.bottom_right.style.left="0px";
this.bottom_right.style.top="0px";
this.bottom_right.style.fontSize="2px";
this.header=document.createElement("div");
this.header.style.position="absolute";
this.header.style.left=this.cornerWidth+"px";
this.header.style.top="0px";
this.header.style.height=(this.cornerHeight)+"px";
this.header.style.backgroundColor="#1e1b57";
this.header.style.borderTop="3px solid #1e1b57";
this.header.style.fontSize="9px";
this.header.style.color="white";
this.header.style.textAlign="center";
this.textarea=document.createElement("div");
this.textarea.style.position="absolute";
this.textarea.style.left="0px";
this.textarea.style.top=this.cornerHeight+"px";
this.textarea.style.background="url(/skins/ext/images/gray/shapes/bg.png)";
this.textarea.style.borderTop="2px solid #d98e3e";
this.textarea.style.borderBottom="2px solid white";
this.textarea.style.borderLeft="1px solid #1e1b57";
this.textarea.style.borderRight="1px solid #1e1b57";
this.textarea.style.overflow="auto";
this.textarea.style.fontSize="9pt";
this.textarea.style.color="white";
this.disableTextSelection(this.textarea);
this.footer=document.createElement("div");
this.footer.style.position="absolute";
this.footer.style.left=this.cornerWidth+"px";
this.footer.style.top="0px";
this.footer.style.height=(this.cornerHeight-1)+"px";
this.footer.style.backgroundColor="#1e1b57";
this.footer.style.borderBottom="1px solid #1e1b57";
this.footer.style.fontSize="2px";
item.appendChild(this.top_left);
item.appendChild(this.header);
item.appendChild(this.top_right);
item.appendChild(this.textarea);
item.appendChild(this.bottom_left);
item.appendChild(this.footer);
item.appendChild(this.bottom_right);
this.setTitle("Task 1");
this.setContent("Task Description");
return item;
};
Task2.prototype.setDimension=function(w,h){
Node.prototype.setDimension.call(this,w,h);
if(this.top_left!=null){
this.top_right.style.left=(this.width-this.cornerWidth)+"px";
this.bottom_right.style.left=(this.width-this.cornerWidth)+"px";
this.bottom_right.style.top=(this.height-this.cornerHeight)+"px";
this.bottom_left.style.top=(this.height-this.cornerHeight)+"px";
this.textarea.style.width=(this.width-2)+"px";
this.textarea.style.height=(this.height-this.cornerHeight*2)+"px";
this.header.style.width=(this.width-this.cornerWidth*2)+"px";
this.footer.style.width=(this.width-this.cornerWidth*2)+"px";
this.footer.style.top=(this.height-this.cornerHeight)+"px";
}
if(this.outputPort!=null){
this.outputPort.setPosition(this.width+5,this.height/2);
}
if(this.inputPort!=null){
this.inputPort.setPosition(-5,this.height/2);
}
};
Task2.prototype.setTitle=function(title){
this.header.innerHTML=title;
};
Task2.prototype.setContent=function(_3595){
this.textarea.innerHTML=_3595;
};
Task2.prototype.getTitle=function(){
return this.figure.header.innerHTML;
};
Task2.prototype.getContent=function(){
return this.figure.textarea.innerHTML;
};
Task2.prototype.onDragstart=function(x,y){
var _3598=Node.prototype.onDragstart.call(this,x,y);
if(this.header==null){
return false;
}
if(y<this.cornerHeight&&x<this.width&&x>(this.width-this.cornerWidth)){
this.toggle();
return false;
}
if(this.originalHeight==-1){
if(this.canDrag==true&&x<parseInt(this.header.style.width)&&y<parseInt(this.header.style.height)){
return true;
}
}else{
return _3598;
}
};
Task2.prototype.setCanDrag=function(flag){
Node.prototype.setCanDrag.call(this,flag);
this.html.style.cursor="";
if(this.header==null){
return;
}
if(flag){
this.header.style.cursor="move";
}else{
this.header.style.cursor="";
}
};
Task2.prototype.setWorkflow=function(_359a){
Node.prototype.setWorkflow.call(this,_359a);
if(_359a!=null&&this.inputPort==null){
this.inputPort=new InputPort();
this.inputPort.setWorkflow(_359a);
this.inputPort.setName("input");
this.addPort(this.inputPort,-5,this.height/2);
this.outputPort=new OutputPort();
this.outputPort.setMaxFanOut(5);
this.outputPort.setWorkflow(_359a);
this.outputPort.setName("output");
this.addPort(this.outputPort,this.width+5,this.height/2);
}
};
Task2.prototype.toggle=function(){
if(this.originalHeight==-1){
this.originalHeight=this.height;
this.setDimension(this.width,this.cornerHeight*2);
this.setResizeable(false);
}else{
this.setDimension(this.width,this.originalHeight);
this.originalHeight=-1;
this.setResizeable(true);
}
};
Task2.prototype.getContextMenu=function(){
var menu=new Menu();
var oThis=this;
menu.appendMenuItem(new MenuItem("Steps",null,function(){
oThis.setBackgroundColor(new Color(0,0,255));
}));
menu.appendMenuItem(new MenuItem("Users & Users Groups",null,function(){
oThis.setBackgroundColor(new Color(0,255,0));
}));
menu.appendMenuItem(new MenuItem("Users & Users Groups (ad-hoc)",null,function(){
oThis.setBackgroundColor(new Color(128,128,128));
}));
menu.appendMenuItem(new MenuItem("Routing Rule",null,function(){
oThis.setBackgroundColor(new Color(0,0,0));
}));
menu.appendMenuItem(new MenuItem("Deleting Routing Rule",null,function(){
oThis.setBackgroundColor(new Color(0,0,0));
}));
menu.appendMenuItem(new MenuItem("Delete Task ",null,function(){
//oThis.;
}));
menu.appendMenuItem(new MenuItem("Properties ",null,function(){
oThis.setBackgroundColor(new Color(0,0,0));
}));
return menu;
};
/*
**Extended the Dialog class with 2 form element for editing the Task Name and Description
*/
Task2Dialog = function(_2e5e){
this.figure=_2e5e;
Dialog.call(this);
this.setDimension(400,150); //Set the width and height of the Dialog box
}
Task2Dialog.prototype= new Dialog;
Task2Dialog.prototype.createHTMLElement=function(){
var item=Dialog.prototype.createHTMLElement.call(this);
var _2e60=document.createElement("form");
_2e60.style.position="absolute";
_2e60.style.left="10px";
_2e60.style.top="30px";
_2e60.style.width="375px";
_2e60.style.font="normal 10px verdana";
item.appendChild(_2e60);
this.label=document.createTextNode("Task Name"); //New Text Field for Task Name
_2e60.appendChild(this.label);
this.input=document.createElement("input");
this.input.style.border="1px solid gray";
this.input.style.font="normal 10px verdana";
this.input.type="text";
var value=this.figure.header.innerHTML;
if(value){
this.input.value=value;
}else{
this.input.value="";
}
this.input.style.width="100%";
_2e60.appendChild(this.input);
this.input.focus();
this.label=document.createTextNode("Task Description"); //New Text Field for Task Description
_2e60.appendChild(this.label);
this.input=document.createElement("input");
this.input.style.border="1px solid gray";
this.input.style.font="normal 10px verdana";
this.input.type="text";
var value=this.figure.textarea.innerHTML;
if(value){
this.input.value=value;
}else{
this.input.value="";
}
this.input.style.width="100%";
_2e60.appendChild(this.input);
this.input.focus();
return item;
};
/*Double Click Event for opening the dialog Box*/
Task2.prototype.onDoubleClick=function(){
var _409d=new Task2Dialog(this);
this.workflow.showDialog(_409d);
};
/*Set the Task Name and Description*/
Task2Dialog.prototype.onOk=function(){
this.figure.header.innerHTML = this.input.form.children[0].value;
this.figure.textarea.innerHTML = this.input.form.children[1].value;
this.workflow.removeFigure(this);
};

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,971 @@
bpmnTask = function (_30ab) {
VectorFigure.call(this);
if(typeof _30ab.boundaryEvent != 'undefined' && _30ab.boundaryEvent == true)
{
this.boundaryEvent = _30ab.boundaryEvent;
}
if(typeof _30ab.task_width != 'undefined' && typeof _30ab.task_height != 'undefined')
this.setDimension(_30ab.task_width, _30ab.task_height);
else
this.setDimension(165, 40);
this.taskName = _30ab.taskName; //It will set the Default Task Name with appropriate count While dragging a task on the canvas
};
bpmnTask.prototype = new VectorFigure;
bpmnTask.prototype.type = "bpmnTask"
bpmnTask.prototype.coord_converter = function (bound_width, bound_height, text_length) {
//bound_width = this.workflow.currentSelection.width;
//bound_height = this.workflow.currentSelection.height;
input_width = text_length * 6
input_height = 10
temp_width = bound_width - input_width;
temp_width /= 2;
temp_x = temp_width;
temp_height = bound_height - 10;
temp_height /= 2;
temp_y = temp_height;
var temp_coord = new Object();
temp_coord.temp_x = temp_x;
temp_coord.temp_y = temp_y;
return temp_coord;
};
//curWidth = this.getWidth();
bpmnTask.prototype.paint = function () {
VectorFigure.prototype.paint.call(this);
//Set the Task Limitation
if (this.getWidth() > 200 || this.getHeight() > 100) {
this.setDimension(200, 100);
}
else if (this.getWidth() < 165 || this.getHeight() < 40) {
this.setDimension(165, 40);
}
var x = new Array(6, this.getWidth() - 3, this.getWidth(), this.getWidth(), this.getWidth() - 3, 6, 3, 3, 6);
var y = new Array(3, 3, 6, this.getHeight() - 3, this.getHeight(), this.getHeight(), this.getHeight() - 3, 6, 3);
this.stroke = 2;
this.graphics.setStroke(this.stroke);
this.graphics.setColor("#c0c0c0");
this.graphics.fillPolygon(x, y);
for (var i = 0; i < x.length; i++) {
x[i] = x[i] - 3;
y[i] = y[i] - 3;
}
this.graphics.setColor("#DBDFF6");
this.graphics.fillPolygon(x, y);
this.graphics.setColor("#5164b5"); //Blue Color
this.graphics.drawPolygon(x, y);
this.graphics.paint();
this.x_text = this.workflow.getAbsoluteX(); //Get x co-ordinate from figure
this.y_text = this.workflow.getAbsoluteY(); //Get x co-ordinate from figure
/* Created New Object of jsGraphics to draw String.
* New object is created to implement changing of Text functionality
*/
bpmnText = new jsGraphics(this.id);
/*if(this.taskName.length <= 17)
{
var padleft = 0.025*this.getWidth();
var padtop = 0.36*this.getHeight();
var rectwidth = this.getWidth() - padleft;
var rectheight = 0.54*this.getHeight();
}
else
{
padleft = 0.1*this.getWidth();
padtop = 0.15*this.getHeight();
rectwidth = this.getWidth() - padleft;
rectheight = 0.75*this.getHeight();
}
*/
var len = this.getWidth() / 18;
if (len >= 6) {
//len = 1.5;
var padleft = 0.12 * this.getWidth();
var padtop = 0.32 * this.getHeight() -3;
this.rectWidth = this.getWidth() - 2 * padleft;
}
else {
padleft = 0.1 * this.getWidth();
padtop = 0.09 * this.getHeight() -3;
this.rectWidth = this.getWidth() - 2 * padleft;
}
var rectheight = this.getHeight() - padtop -7;
bpmnText.drawStringRect(this.taskName, padleft, padtop, this.rectWidth, rectheight, 'center');
// tempcoord = this.coord_converter(this.getWidth(), this.getHeight(), this.taskName.length);
// bpmnText.drawTextString(this.taskName, this.getWidth(), this.getHeight(), tempcoord.temp_x, tempcoord.temp_y);
/**************************** Drawing Timer Boundary event starts here *******************************/
var boundaryTimer = new jsGraphics(this.id);
var x_cir1=5;
var y_cir1=45;
boundaryTimer.setColor("#c0c0c0");
boundaryTimer.fillEllipse(x[3]-x[3]/1.08,y[4]-12,30,30);
boundaryTimer.setStroke(this.stroke);
boundaryTimer.setColor( "#f9faf2" );
boundaryTimer.fillEllipse(x[3]-x[3]/1.08,y[5]-12,30,30);
boundaryTimer.setColor("#adae5e");
boundaryTimer.drawEllipse(x[3]-x[3]/1.08,y[5]-12,30,30);
var x_cir2=8;
var y_cir2=48;
boundaryTimer.setColor( "#f9faf2" );
boundaryTimer.fillEllipse(x[3]-x[3]/1.08+3,y[5]-9,30-6,30-6);
boundaryTimer.setColor("#adae5e");
boundaryTimer.drawEllipse(x[3]-x[3]/1.08+3,y[5]-9,30-6,30-6);
/*
//drawing clock's minutes lines
this.graphics.setColor("#adae5e");
//this.graphics.drawEllipse(x_cir3,y_cir3,30-20,30-20);
this.graphics.drawLine(30/2,30/2,30/1.3,30/2);
this.graphics.drawLine(30/2,30/2,30/2,30/4.5);
*/
//var x_cir3=10;
//var y_cir3=10;
//this.graphics.setColor( "#f9faf2" );
//this.graphics.fillEllipse(x_cir3,y_cir3,30-20,30-20);
boundaryTimer.setColor("#adae5e");
//this.graphics.drawEllipse(x_cir3,y_cir3,30-20,30-20);
boundaryTimer.drawLine(30/2.2+x[3]-x[3]/1.08,30/2+y[5]-10,30/1.6+x[3]-x[3]/1.08,30/2+y[5]-10); //horizontal line
boundaryTimer.drawLine(30/2.2+x[3]-x[3]/1.08,30/2+y[5]-10,30/2.2+x[3]-x[3]/1.08,30/3.7+y[5]-10); //vertical line
boundaryTimer.drawLine(x[3]-x[3]/1.08+24,y[5]-3,x[3]-x[3]/1.08+20,y[5]); //10th min line 24,8,20,11
boundaryTimer.drawLine(x[3]-x[3]/1.08+21,y[5]+4,x[3]-x[3]/1.08+25,y[5]+4); //15th min line
boundaryTimer.drawLine(x[3]-x[3]/1.08+24,y[5]+11,x[3]-x[3]/1.08+19,y[5]+9); //25th min line
boundaryTimer.drawLine(x[3]-x[3]/1.08+15,y[5]+11,x[3]-x[3]/1.08+15,y[5]+14); //30th min line
boundaryTimer.drawLine(x[3]-x[3]/1.08+8,y[5]+11,x[3]-x[3]/1.08+12,y[5]+8); //40th min line
boundaryTimer.drawLine(x[3]-x[3]/1.08+5,y[5]+4,x[3]-x[3]/1.08+8,y[5]+4); //45th min line
boundaryTimer.drawLine(x[3]-x[3]/1.08+8,y[5]-4,x[3]-x[3]/1.08+11,y[5]-1); //50th min line
boundaryTimer.drawLine(x[3]-x[3]/1.08+15,y[5]-7,x[3]-x[3]/1.08+15,y[5]-4); //60th min line
if(this.boundaryEvent == true)
boundaryTimer.paint();
/**************************** Drawing Timer Boundary event ends here *******************************/
bpmnText.paint();
this.bpmnNewText = bpmnText;
/*Code Added to Dynamically shift Ports on resizing of shapes
**/
if (this.input1 != null) {
this.input1.setPosition(0, this.height / 2);
}
if (this.output1 != null) {
this.output1.setPosition(this.width / 2, this.height);
}
if (this.input2 != null) {
this.input2.setPosition(this.width / 2, 0);
}
if (this.output2 != null) {
this.output2.setPosition(this.width, this.height / 2);
}
};
jsGraphics.prototype.drawTextString = function (txt, x, y, dx, dy) {
this.htm += '<div style="position:absolute; display:table-cell; vertical-align:middle; height:' + y + '; width:' + x + ';' + 'margin-left:' + dx + 'px;' + 'margin-top:' + dy + 'px;' + 'font-family:' + this.ftFam + ';' + 'font-size:' + this.ftSz + ';' + 'color:' + this.color + ';' + this.ftSty + '">' + txt + '<\/div>';
};
/*Workflow.prototype.onMouseUp=function(x,y){
//Saving Task/Annotations position on Async Ajax call
this.dragging=false;
this.draggingLine=null;
};*/
Figure.prototype.onDragend=function(){
if(typeof workflow.currentSelection != 'undefined' && workflow.currentSelection != null)
{
var currObj =workflow.currentSelection;
switch (currObj.type) {
case 'bpmnTask':
case 'bpmnSubProcess':
currObj.actiontype = 'saveTaskPosition';
currObj.workflow.saveShape(currObj);
break;
case 'bpmnAnnotation':
currObj.actiontype = 'saveTextPosition';
currObj.workflow.saveShape(currObj);
break;
}
workflow.setBoundary(currObj);
}
if(this.getWorkflow().getEnableSmoothFigureHandling()==true){
var _3dfe=this;
var _3dff=function(){
if(_3dfe.alpha<1){
_3dfe.setAlpha(Math.min(1,_3dfe.alpha+0.05));
}else{
window.clearInterval(_3dfe.timer);
_3dfe.timer=-1;
}
};
if(_3dfe.timer>0){
window.clearInterval(_3dfe.timer);
}
_3dfe.timer=window.setInterval(_3dff,20);
}else{
this.setAlpha(1);
}
this.command.setPosition(this.x,this.y);
this.workflow.commandStack.execute(this.command);
this.command=null;
this.isMoving=false;
this.workflow.hideSnapToHelperLines();
this.fireMoveEvent();
};
Figure.prototype.onKeyDown=function(_3e0e,ctrl){
if(_3e0e==46&&this.isDeleteable()==true){
workflow.getDeleteCriteria();
//this.workflow.commandStack.execute(new CommandDelete(this));
}
if(ctrl){
this.workflow.onKeyDown(_3e0e,ctrl);
}
};
bpmnTask.prototype.setWorkflow = function (_40c5) {
VectorFigure.prototype.setWorkflow.call(this, _40c5);
if (_40c5 != null) {
/*Adding Port to the Task After dragging Task on the Canvas
*Ports will be invisibe After Drag and Drop, But It will be created
*/
var TaskPortName = ['output1', 'output2', 'input1', 'input2'];
var TaskPortType = ['OutputPort', 'OutputPort', 'InputPort', 'InputPort'];
var TaskPositionX = [this.width / 2, this.width, 0, this.width / 2];
var TaskPositionY = [this.height, this.height / 2, this.height / 2, 0];
for (var i = 0; i < TaskPortName.length; i++) {
eval('this.' + TaskPortName[i] + ' = new ' + TaskPortType[i] + '()'); //Create New Port
eval('this.' + TaskPortName[i] + '.setWorkflow(_40c5)'); //Add port to the workflow
eval('this.' + TaskPortName[i] + '.setName("' + TaskPortName[i] + '")'); //Set PortName
eval('this.' + TaskPortName[i] + '.setZOrder(-1)'); //Set Z-Order of the port to -1. It will be below all the figure
eval('this.' + TaskPortName[i] + '.setBackgroundColor(new Color(255, 255, 255))'); //Setting Background of the port to white
eval('this.' + TaskPortName[i] + '.setColor(new Color(255, 255, 255))'); //Setting Border of the port to white
eval('this.addPort(this.' + TaskPortName[i] + ',' + TaskPositionX[i] + ', ' + TaskPositionY[i] + ')'); //Setting Position of the port
}
}
};
InputPort.prototype.onDrop = function (port) {
if (port.getMaxFanOut && port.getMaxFanOut() <= port.getFanOut()) {
return;
}
if (this.parentNode.id == port.parentNode.id) {} else {
var newObj = new Array();
newObj = this.workflow.currentSelection;
var preObj = port.parentNode;
newObj.sPortType =port.properties.name;
preObj.sPortType =this.properties.name;
this.workflow.saveRoute(preObj,newObj);
var _3f02 = new CommandConnect(this.parentNode.workflow, port, this);
if (_3f02.source.type == _3f02.target.type) {
return;
}
_3f02.setConnection(new DecoratedConnection());
this.parentNode.workflow.getCommandStack().execute(_3f02);
}
};
OutputPort.prototype.onDrop = function (port) {
if (this.getMaxFanOut() <= this.getFanOut()) {
return;
}
var connect = true;
var conn = this.workflow.checkConnectionsExist(port, 'targetPort', 'OutputPort');
if (conn == 0) //If no connection Exist then Allow connect
connect = true;
else if (conn < 2) //If One connection exist then Do not Allow to connect
connect = false;
if (this.parentNode.id == port.parentNode.id || connect == false) {
} else {
var _4070 = new CommandConnect(this.parentNode.workflow, this, port);
if (_4070.source.type == _4070.target.type) {
return;
}
_4070.setConnection(new DecoratedConnection());
this.parentNode.workflow.getCommandStack().execute(_4070);
//Saving Start Event
var preObj = new Array();
var bpmnType = this.workflow.currentSelection.type;
if(bpmnType.match(/Event/) && bpmnType.match(/Start/) && port.parentNode.type.match(/Task/))
{
var tas_uid = port.parentNode.id;
this.workflow.saveEvents(this.workflow.currentSelection,tas_uid);
}
else if(bpmnType.match(/Task/) && port.parentNode.type.match(/End/) && port.parentNode.type.match(/Event/))
{
preObj = this.workflow.currentSelection;
var newObj = port.parentNode;
newObj.conn = _4070.connection;
this.workflow.saveRoute(preObj,newObj);
}
else if(port.parentNode.type.match(/Task/) && bpmnType.match(/Inter/) && bpmnType.match(/Event/))
{
var taskFrom = workflow.getStartEventConn(this,'sourcePort','InputPort');
var taskTo = workflow.getStartEventConn(this,'targetPort','OutputPort');
if(typeof taskFrom[0] != 'undefined' || typeof taskTo[0] != 'undefined')
{
preObj.type = 'Task';
preObj.taskFrom = taskFrom[0].value;
preObj.taskTo = taskTo[0].value;
//save Event First
var tas_uid = port.parentNode.id;
this.workflow.saveEvents(workflow.currentSelection,preObj);
}
}
else if(bpmnType.match(/Task/) && port.parentNode.type.match(/Task/))
{
var preObj = this.workflow.currentSelection;
var newObj = port.parentNode;
newObj.conn = _4070.connection;
newObj.sPortType =port.properties.name;
preObj.sPortType =this.properties.name;
this.workflow.saveRoute(preObj,newObj);
}
else if(bpmnType.match(/Gateway/) && port.parentNode.type.match(/Task/))
{
var shape = new Array();
shape.type = '';
var preObj = this.workflow.currentSelection;
this.workflow.saveRoute(preObj,shape);
}
}
};
LineEndResizeHandle.prototype.onDrop=function(_3f3e){
var line=this.workflow.currentSelection;
line.isMoving=false;
if(line instanceof Connection){
this.command.setNewPorts(line.getSource(),_3f3e);
//If Input Port /Output Port is connected to respective ports, then should not connected
if(this.command.newSourcePort.type == this.command.newTargetPort.type)
return;
else
{
this.command.newTargetPort.parentNode.conn = this.command.con;
this.command.newTargetPort.parentNode.sPortType = this.command.newTargetPort.properties.name;
this.command.newSourcePort.parentNode.sPortType = this.command.newSourcePort.properties.name;
this.workflow.saveRoute(this.command.newSourcePort.parentNode,this.command.newTargetPort.parentNode);
this.getWorkflow().getCommandStack().execute(this.command);
}
}
this.command=null;
};
LineStartResizeHandle.prototype.onDrop=function(_410d){
var line=this.workflow.currentSelection;
line.isMoving=false;
if(line instanceof Connection){
this.command.setNewPorts(_410d,line.getTarget());
//If Input Port /Output Port is connected to respective ports, then should not connected
if(this.command.newSourcePort.type == this.command.newTargetPort.type)
return;
else
{
this.command.newTargetPort.parentNode.conn = this.command.con;
this.command.newTargetPort.parentNode.sPortType = this.command.newTargetPort.properties.name;
this.command.newSourcePort.parentNode.sPortType = this.command.newSourcePort.properties.name;
this.command.newTargetPort.parentNode.conn = this.command.con;
this.workflow.saveRoute(this.command.newSourcePort.parentNode,this.command.newTargetPort.parentNode);
this.getWorkflow().getCommandStack().execute(this.command);
}
}
this.command=null;
};
ResizeHandle.prototype.onDragend=function(){
if(this.commandMove==null){
return;
}
var currentSelection = workflow.currentSelection;
if(currentSelection.type.match(/Task/))
{
currentSelection.actiontype = 'saveTaskCordinates';
workflow.saveShape(currentSelection);
}
else if(currentSelection.type.match(/Annotation/))
{
currentSelection.actiontype = 'saveAnnotationCordinates';
workflow.saveShape(currentSelection);
}
}
VectorFigure.prototype.addChild=function(_4078){
_4078.setParent(this);
//_4078.setZOrder(this.getZOrder()+1);
//_4078.setParent(this);
//_4078.parent.addChild(_4078);
//this.children[_4078.id]=_4078;
//this.scrollarea.appendChild(_4078.getHTMLElement());
};
////// Decorators to add an arrow to the flow line. To show the direction of flow //////////////
DecoratedConnection = function () {
Connection.call(this);
this.setTargetDecorator(new ArrowConnectionDecorator());
this.setRouter(new ManhattanConnectionRouter());
};
DecoratedConnection.prototype = new Connection();
DecoratedConnection.prototype.type = "DecoratedConnection";
DecoratedConnection.prototype.getContextMenu = function () {
if (this.id != null) {
this.workflow.contextClicked = true;
this.workflow.connectionContextMenu(this);
}
};
////////--------------------------------------------------------------------------------------------///////
FlowMenu = function (_39f9) {
this.actionAdd = new ButtonAdd(this);
this.actionTask = new ButtonTask(this);
this.actionInterEvent = new ButtonInterEvent(this);
this.actionEndEvent = new ButtonEndEvent(this);
this.actionGateway = new ButtonGateway(this);
this.actionFront = new ButtonMoveFront(this);
this.actionBack = new ButtonMoveBack(this);
this.actionDelete = new ButtonDelete(this);
this.actionAnnotation = new ButtonAnnotation(this);
ToolPalette.call(this);
this.setDimension(20, 80);
this.setBackgroundColor(new Color(220, 255, 255));
this.currentFigure = null;
this.myworkflow = _39f9;
this.added = false;
this.setDeleteable(false);
this.setCanDrag(false);
this.setResizeable(false);
this.setSelectable(false);
var zOrder = this.getZOrder();
this.setZOrder(4000);
this.setBackgroundColor(null);
this.setColor(null);
this.scrollarea.style.borderBottom = "0px";
this.actionAdd.setPosition(0, 0);
this.actionInterEvent.setPosition(20, 0);
this.actionGateway.setPosition(20, 20);
this.actionFront.setPosition(0, 18);
this.actionBack.setPosition(0, 36);
this.actionDelete.setPosition(0, 54);
};
ToolPalette.prototype.removechild = function (_4079) {
if (_4079 != null) {
var parentNode = this.html;
if (parentNode != null) {
if (typeof parentNode.children != 'undefined') {
var len = parentNode.children[0].children.length;
for (var i = 0; i < len; i++) {
var childNode = parentNode.children[0].children[i];
if (childNode == _4079.html) {
parentNode.children[0].removeChild(childNode);
}
}
}
}
}
};
FlowMenu.prototype = new ToolPalette;
FlowMenu.prototype.setAlpha = function (_39fa) {
Figure.prototype.setAlpha.call(this, _39fa);
};
FlowMenu.prototype.hasTitleBar = function () {
return false;
};
FlowMenu.prototype.setFigure = function (_3087) {
}
FlowMenu.prototype.onSelectionChanged = function (_39fb) {
var newWorkflow = '';
//If Right Clicked on the figure, Disabling Flow menu
if (_39fb != null) {
newWorkflow = _39fb.workflow;
}
else if (this.workflow != null) {
newWorkflow = this.workflow;
}
else {
newWorkflow = this.myworkflow;
}
var contextClicked = newWorkflow.contextClicked;
/*Check wheather the figure selected is same as previous figure.
*If figure is different ,then remove the port from the previous selected figure.
**/
if (newWorkflow.currentSelection != null && typeof newWorkflow.preSelectedFigure != 'undefined') {
if (newWorkflow.currentSelection.id != newWorkflow.preSelectedFigure.id) {
newWorkflow.disablePorts(newWorkflow.preSelectedFigure);
}
}
if (_39fb == this.currentFigure && contextClicked == true) {
return;
}
if (this.added == true) {
this.myworkflow.removeFigure(this);
this.added = false;
}
if (_39fb != null && this.added == false) {
if (this.myworkflow.getEnableSmoothFigureHandling() == true) {
this.setAlpha(0.01);
}
this.myworkflow.addFigure(this, 100, 100);
this.added = true;
}
if (this.currentFigure != null) {
this.currentFigure.detachMoveListener(this);
}
this.currentFigure = _39fb;
if (this.currentFigure != null) {
this.currentFigure.attachMoveListener(this);
this.onOtherFigureMoved(this.currentFigure);
}
};
FlowMenu.prototype.setWorkflow = function (_39fc) {
Figure.prototype.setWorkflow.call(this, _39fc);
};
FlowMenu.prototype.onOtherFigureMoved = function (_39fd) {
if (_39fd != null) {
//Get the workflow object of the selected Figure object, so that we can compare with the new selected figure to remove ports
_39fd.workflow.preSelectedFigure = _39fd.workflow.currentSelection;
workflow.setBoundary(workflow.currentSelection);
//Preventing Task from drawing outside canvas Code Starts here
//@params - max X pos(canvas Width) = 918
//@params - max Y pos(canvas Height) = 837
///////////////////////////////////////////
//Preventing Task from drawing outside canvas Code Ends here
if (_39fd.type == 'DecoratedConnection' || _39fd.workflow.contextClicked == true) {
this.removechild(this.actionAdd);
this.removechild(this.actionInterEvent);
this.removechild(this.actionGateway);
this.removechild(this.actionAnnotation);
this.removechild(this.actionTask);
this.removechild(this.actionEndEvent);
this.removechild(this.actionBack);
this.removechild(this.actionDelete);
this.removechild(this.actionFront);
_39fd.workflow.hideResizeHandles();
}
else {
var pos = _39fd.getPosition();
this.setPosition(pos.x + _39fd.getWidth() + 7, pos.y - 16);
if (_39fd.workflow != null) {
var bpmnShape = _39fd.workflow.currentSelection.type;
this.addChild(this.actionFront);
this.addChild(this.actionBack);
this.addChild(this.actionDelete);
var ports = '';
//Disable Resize for All Events and Gateway
if (bpmnShape.match(/Event/) || bpmnShape.match(/Gateway/) || bpmnShape.match(/bpmnDataobject/) || bpmnShape.match(/bpmnSubProcess/)) {
_39fd.workflow.hideResizeHandles();
}
if (bpmnShape.match(/Task/) || bpmnShape.match(/SubProcess/)) {
this.addChild(this.actionAdd);
this.addChild(this.actionInterEvent);
this.addChild(this.actionEndEvent);
this.addChild(this.actionGateway);
this.addChild(this.actionAnnotation);
this.actionAnnotation.setPosition(20, 60);
this.actionEndEvent.setPosition(20, 40)
this.removechild(this.actionTask);
ports = ['output1', 'input1', 'output2', 'input2'];
//ports = ['output1', 'output2'];
_39fd.workflow.enablePorts(_39fd, ports);
}
else if (bpmnShape.match(/Start/)) {
this.addChild(this.actionAdd);
this.addChild(this.actionAnnotation);
this.actionAnnotation.setPosition(20, 40);
this.addChild(this.actionInterEvent);
this.actionInterEvent.setPosition(20, 20)
this.addChild(this.actionGateway);
this.actionGateway.setPosition(20, 0)
this.removechild(this.actionEndEvent);
ports = ['output1', 'output2'];
_39fd.workflow.enablePorts(_39fd, ports);
}
else if (bpmnShape.match(/Inter/)) {
this.addChild(this.actionAdd);
this.addChild(this.actionAnnotation);
this.actionAnnotation.setPosition(20, 60);
this.addChild(this.actionInterEvent);
this.actionInterEvent.setPosition(20, 20)
this.addChild(this.actionGateway);
this.actionGateway.setPosition(20, 0);
this.addChild(this.actionEndEvent);
this.actionEndEvent.setPosition(20, 40);
ports = ['output1', 'input1', 'output2', 'input2'];
_39fd.workflow.enablePorts(_39fd, ports);
}
else if (bpmnShape.match(/End/)) {
this.addChild(this.actionAnnotation);
this.actionAnnotation.setPosition(0, 0);
this.removechild(this.actionInterEvent);
this.removechild(this.actionEndEvent);
this.removechild(this.actionTask);
this.removechild(this.actionGateway);
this.removechild(this.actionAdd);
ports = ['input1', 'input2'];
_39fd.workflow.enablePorts(_39fd, ports);
}
else if (bpmnShape.match(/Gateway/)) {
this.addChild(this.actionAdd);
this.addChild(this.actionAnnotation);
this.actionAnnotation.setPosition(20, 60);
this.addChild(this.actionInterEvent);
this.actionInterEvent.setPosition(20, 20)
this.addChild(this.actionGateway);
this.actionGateway.setPosition(20, 0);
this.addChild(this.actionEndEvent);
this.actionEndEvent.setPosition(20, 40);
ports = ['output1', 'input1', 'output2', 'input2'];
_39fd.workflow.enablePorts(_39fd, ports);
}
else if (bpmnShape.match(/Annotation/) || bpmnShape.match(/Dataobject/)) {
this.removechild(this.actionAdd);
this.removechild(this.actionInterEvent);
this.removechild(this.actionGateway);
this.removechild(this.actionEndEvent);
this.removechild(this.actionAnnotation);
this.removechild(this.actionEndEvent);
if (bpmnShape.match(/Annotation/)) {
ports = ['input1'];
_39fd.workflow.enablePorts(_39fd, ports);
}
}
else if (bpmnShape.match(/Pool/)) {
this.removechild(this.actionAdd);
this.removechild(this.actionInterEvent);
this.removechild(this.actionGateway);
this.removechild(this.actionEndEvent);
this.removechild(this.actionAnnotation);
this.removechild(this.actionEndEvent);
this.removechild(this.actionFront);
this.removechild(this.actionBack);
this.removechild(this.actionDelete);
}
}
}
}
};
bpmnTask.prototype.addShapes = function (_3896) {
var xOffset = _3896.workflow.currentSelection.getX(); //Get x co-ordinate from figure
var y = _3896.workflow.currentSelection.getY(); //Get y co-ordinate from figure
//var xOffset = parseFloat(x + _3896.workflow.currentSelection.width); //Get x-offset co-ordinate from figure
var yOffset = parseFloat(y + _3896.workflow.currentSelection.height + 25); //Get y-offset co-ordinate from figure
var count;
var shape = _3896.workflow.currentSelection.type;
if (_3896.newShapeName == 'bpmnTask' && shape.match(/Event/)) {
xOffset = _3896.workflow.currentSelection.getX() - 40; //Setting new offset value when currentselection is not Task i.e deriving task from events
}
if (_3896.newShapeName == 'bpmnTask' && shape.match(/Gateway/)) {
xOffset = _3896.workflow.currentSelection.getX() - 35; //Setting new offset value when currentselection is not Task i.e deriving task from gateways
}
if (_3896.newShapeName.match(/Event/)) {
xOffset = _3896.workflow.currentSelection.getX() + 40; //Setting new offset value when newShape is not Task i.e aligning events
}
if (_3896.newShapeName.match(/Gateway/)) {
xOffset = _3896.workflow.currentSelection.getX() + 35; //Setting new offset value when newShape is not Task i.e aligning gateways
}
/* Incrementing Task No and assigning it to a local variable
* taskNo Globally Declared in processmap.js
* taskNo will have Last Task count
* */
if (_3896.newShapeName == 'bpmnTask') {
count = ++_3896.workflow.taskNo;
_3896.workflow.taskName = 'Task ' + count;
}
workflow.subProcessName = 'Sub Process';
var newShape = eval("new " + _3896.newShapeName + "(_3896.workflow)");
_3896.workflow.addFigure(newShape, xOffset, yOffset);
//Assigning values to newShape Object for Saving Task automatically (Async Ajax Call)
newShape.x = xOffset;
newShape.y = yOffset;
var conn = new DecoratedConnection();
if (newShape.type.match(/Gateway/)) {
conn.setTarget(newShape.getPort("input2"));
conn.setSource(_3896.workflow.currentSelection.getPort("output1"));
_3896.workflow.addFigure(conn);
}
if (newShape.type.match(/Start/)) {
conn.setTarget(newShape.getPort("output1"));
conn.setSource(_3896.workflow.currentSelection.getPort("input2"));
_3896.workflow.addFigure(conn);
}
if (newShape.type.match(/Event/)) {
conn.setTarget(newShape.getPort("input2"));
conn.setSource(_3896.workflow.currentSelection.getPort("output1"));
_3896.workflow.addFigure(conn);
}
if (newShape.type.match(/Task/)) {
conn.setTarget(newShape.getPort("input2"));
conn.setSource(_3896.workflow.currentSelection.getPort("output1"));
_3896.workflow.addFigure(conn);
}
if (_3896.newShapeName.match(/Event/) && _3896.newShapeName.match(/End/)) {
newShape.conn = conn;
_3896.workflow.saveRoute(_3896.workflow.currentSelection,newShape);
}
else if (_3896.newShapeName == 'bpmnTask') {
newShape.actiontype = 'addTask';
newShape.conn = conn;
_3896.workflow.saveShape(newShape); //Saving Task automatically (Async Ajax Call)
}
}
ButtonInterEvent = function (_30a8) {
Button.call(this, _30a8, 16, 16);
};
ButtonInterEvent.prototype = new Button;
ButtonInterEvent.prototype.type = "/skins/ext/images/gray/shapes/interevent";
ButtonInterEvent.prototype.execute = function () {
var count = 0;
this.palette.newShapeName = 'bpmnEventEmptyInter';
bpmnTask.prototype.addShapes(this.palette);
};
ButtonEndEvent = function (_30a8) {
Button.call(this, _30a8, 16, 16);
};
ButtonEndEvent.prototype = new Button;
ButtonEndEvent.prototype.type = "/skins/ext/images/gray/shapes/endevent";
ButtonEndEvent.prototype.execute = function () {
var count = 0;
this.palette.newShapeName = 'bpmnEventEmptyEnd';
bpmnTask.prototype.addShapes(this.palette);
};
ButtonGateway = function (_30a8) {
Button.call(this, _30a8, 16, 16);
};
ButtonGateway.prototype = new Button;
ButtonGateway.prototype.type = "/skins/ext/images/gray/shapes/gateway-small";
ButtonGateway.prototype.execute = function () {
this.palette.newShapeName = 'bpmnGatewayExclusiveData';
bpmnTask.prototype.addShapes(this.palette);
};
ButtonAnnotation = function (_30a8) {
Button.call(this, _30a8, 16, 16);
};
ButtonAnnotation.prototype = new Button;
ButtonAnnotation.prototype.type = "/skins/ext/images/gray/shapes/annotation";
ButtonAnnotation.prototype.execute = function () {
var count = 0;
this.palette.newShapeName = 'bpmnAnnotation';
bpmnTask.prototype.addShapes(this.palette);
};
ButtonTask = function (_30a8) {
Button.call(this, _30a8, 16, 16);
};
ButtonTask.prototype = new Button;
ButtonTask.prototype.type = "/skins/ext/images/gray/shapes/Task";
ButtonTask.prototype.execute = function () {
this.palette.newShapeName = 'bpmnTask';
bpmnTask.prototype.addShapes(this.palette);
};
ButtonAdd = function (_30a8) {
Button.call(this, _30a8, 16, 16);
};
ButtonAdd.prototype = new Button;
ButtonAdd.prototype.type = "/skins/ext/images/gray/shapes/btn-add";
ButtonAdd.prototype.execute = function () {
this.palette.newShapeName = 'bpmnTask';
this.palette.workflow.preSelectedObj = this.palette.workflow.currentSelection;
bpmnTask.prototype.addShapes(this.palette);
};
ButtonDelete = function (_30a9) {
Button.call(this, _30a9, 16, 16);
};
ButtonDelete.prototype = new Button;
ButtonDelete.prototype.type = "/skins/ext/images/gray/shapes/btn-del";
ButtonDelete.prototype.execute = function () {
workflow.hideResizeHandles();
workflow.getDeleteCriteria();
};
ButtonMoveFront = function (_3e22) {
Button.call(this, _3e22, 16, 16);
};
ButtonMoveFront.prototype = new Button;
ButtonMoveFront.prototype.type = "/skins/ext/images/gray/shapes/btn-movefrnt";
ButtonMoveFront.prototype.execute = function () {
this.palette.workflow.moveFront(this.palette.workflow.getCurrentSelection());
ToolGeneric.prototype.execute.call(this);
};
ButtonMoveBack = function (_4091) {
Button.call(this, _4091, 16, 16);
};
ButtonMoveBack.prototype = new Button;
ButtonMoveBack.prototype.type = "/skins/ext/images/gray/shapes/btn-movebk";
ButtonMoveBack.prototype.execute = function () {
this.palette.workflow.moveBack(this.palette.workflow.getCurrentSelection());
ToolGeneric.prototype.execute.call(this);
};
bpmnTaskDialog = function (_2e5e) {
this.figure = _2e5e;
var title = 'Task Detail';
Dialog.call(this, title);
this.setDimension(400, 150); //Set the width and height of the Dialog box
}
bpmnTaskDialog.prototype = new Dialog(this);
bpmnTaskDialog.prototype.createHTMLElement = function () {
var item = Dialog.prototype.createHTMLElement.call(this);
var inputDiv = document.createElement("form");
inputDiv.style.position = "absolute";
inputDiv.style.left = "10px";
inputDiv.style.top = "30px";
inputDiv.style.width = "375px";
inputDiv.style.font = "normal 10px verdana";
item.appendChild(inputDiv);
this.label = document.createTextNode("Task Name");
inputDiv.appendChild(this.label);
this.input = document.createElement("textarea");
this.input.size = '1';
this.input.style.border = "1px solid gray";
this.input.style.font = "normal 10px verdana";
//this.input.type = "text";
this.input.cols = "50";
this.input.rows = "3";
this.input.maxLength = "100";
var value = bpmnTask.prototype.trim(workflow.currentSelection.taskName);
if (value) this.input.value = value;
else this.input.value = "";
this.input.style.width = "100%";
inputDiv.appendChild(this.input);
this.input.focus();
return item;
};
/*Double Click Event for opening the dialog Box*/
bpmnTask.prototype.onDoubleClick = function () {
var _409d = new bpmnTaskDialog(this);
this.workflow.showDialog(_409d, this.workflow.currentSelection.x, this.workflow.currentSelection.y);
};
bpmnTask.prototype.trim = function (str) {
if (str != null) return str.replace(/^\s+|\s+$/g, '');
else return null;
};
/**
* This method will be called if the user pressed the OK button in buttonbar of the dialog.<br>
* The string is first cleared and new string is painted.<br><br>
**/
bpmnTaskDialog.prototype.onOk = function () {
this.figure.bpmnNewText.clear();
//len = Math.ceil(this.input.value.length/16);
var len = this.workflow.currentSelection.width / 18;
if (len >= 6) {
// len = 1.5;
var padleft = 0.12 * this.workflow.currentSelection.width;
var padtop = 0.32 * this.workflow.currentSelection.height - 3;
this.figure.rectWidth = this.workflow.currentSelection.width - 2 * padleft;
}
else {
padleft = 0.1 * this.workflow.currentSelection.width;
padtop = 0.09 * this.workflow.currentSelection.height - 3;
this.figure.rectWidth = this.workflow.currentSelection.width - 2 * padleft;
}
var rectheight = this.workflow.currentSelection.height - 2*padtop;
//Aligning text more precisely onOK
/* if(this.input.value.length <= 17)
{
var padleft = 0.025*this.workflow.currentSelection.width;
var padtop = 0.30*this.workflow.currentSelection.height;
var rectwidth = this.workflow.currentSelection.width - 2*padleft;
}
else
{
padleft = 0.1*this.workflow.currentSelection.width;
padtop = 0.09*this.workflow.currentSelection.height;
rectwidth = this.workflow.currentSelection.width - 2*padleft;
var rectheight = this.workflow.currentSelection.height - 10;
}*/
//tempcoord = this.workflow.currentSelection.coord_converter(this.workflow.currentSelection.width, this.workflow.currentSelection.height, this.input.value.length)
this.figure.bpmnNewText.drawStringRect(this.input.value, padleft, padtop, this.figure.rectWidth, rectheight, 'center');
// this.figure.bpmnNewText.drawTextString(this.input.value, this.workflow.currentSelection.width, this.workflow.currentSelection.height, tempcoord.temp_x, tempcoord.temp_y);
this.figure.bpmnNewText.paint();
this.workflow.currentSelection.taskName = this.input.value; //Set Updated Text value
//Saving task name (whenever updated) onAsynch AJAX call
this.figure.actiontype = 'updateTaskName';
this.workflow.saveShape(this.figure);
if (this.figure.rectWidth < 80) tempW = 110;
else tempW = this.figure.rectWidth + 35;
this.workflow.removeFigure(this);
};
bpmnTask.prototype.getContextMenu = function () {
this.workflow.handleContextMenu(this);
};

View File

@@ -0,0 +1,559 @@
bpmnTask = function (_30ab) {
VectorFigure.call(this);
this.setDimension(110, 60);
this.setTaskName(_30ab.taskNo); //It will set the Default Task Name with appropriate count While dragging a task on the canvas
};
bpmnTask.prototype = new VectorFigure;
bpmnTask.prototype.type = "bpmnTask";
bpmnTask.prototype.setTaskName = function (name) {
this.taskName = 'Task ' + name;
};
bpmnTask.prototype.coord_converter = function (bound_width, bound_height, text_length) {
//bound_width = this.workflow.currentSelection.width;
//bound_height = this.workflow.currentSelection.height;
input_width = text_length * 6
input_height = 10
temp_width = bound_width - input_width;
temp_width /= 2;
temp_x = temp_width;
temp_height = bound_height - 10;
temp_height /= 2;
temp_y = temp_height;
var temp_coord = new Object();
temp_coord.temp_x = temp_x;
temp_coord.temp_y = temp_y;
return temp_coord;
};
bpmnTask.prototype.paint = function () {
VectorFigure.prototype.paint.call(this);
var x = new Array(6, this.getWidth() - 3, this.getWidth(), this.getWidth(), this.getWidth() - 3, 6, 3, 3, 6);
var y = new Array(3, 3, 6, this.getHeight() - 3, this.getHeight(), this.getHeight(), this.getHeight() - 3, 6, 3);
this.graphics.setStroke(this.stroke);
this.graphics.setColor("#c0c0c0");
this.graphics.fillPolygon(x, y);
for (var i = 0; i < x.length; i++) {
x[i] = x[i] - 3;
y[i] = y[i] - 3;
}
this.graphics.setColor("#ffffff");
this.graphics.fillPolygon(x, y);
this.graphics.setColor("#5164b5"); //Blue Color
this.graphics.drawPolygon(x, y);
this.graphics.paint();
this.x_text = this.workflow.getAbsoluteX(); //Get x co-ordinate from figure
this.y_text = this.workflow.getAbsoluteY(); //Get x co-ordinate from figure
/* Created New Object of jsGraphics to draw String.
* New object is created to implement changing of Text functionality
*/
var bpmnText = new jsGraphics(this.id);
//bpmnText.drawStringRect(this.taskName,this.getWidth()/2-20,this.getHeight()/2-11,200,'left');
tempcoord = this.coord_converter(this.getWidth(), this.getHeight(), this.taskName.length);
bpmnText.drawTextString(this.taskName, this.getWidth(), this.getHeight(), tempcoord.temp_x, tempcoord.temp_y);
bpmnText.paint();
this.bpmnNewText = bpmnText;
/*Code Added to Dynamically shift Ports on resizing of shapes
**/
if (this.input1 != null) {
this.input1.setPosition(0, this.height / 2);
}
if (this.output1 != null) {
this.output1.setPosition(this.width / 2, this.height);
}
if (this.input2 != null) {
this.input2.setPosition(this.width / 2, 0);
}
if (this.output2 != null) {
this.output2.setPosition(this.width, this.height / 2);
}
};
jsGraphics.prototype.drawTextString = function (txt, x, y, dx, dy) {
this.htm += '<div style="position:absolute; display:table-cell; vertical-align:middle; height:' + y + '; width:' + x + ';' + 'margin-left:' + dx + 'px;' + 'margin-top:' + dy + 'px;' + 'font-family:' + this.ftFam + ';' + 'font-size:' + this.ftSz + ';' + 'color:' + this.color + ';' + this.ftSty + '">' + txt + '<\/div>';
};
bpmnTask.prototype.setWorkflow = function (_40c5) {
VectorFigure.prototype.setWorkflow.call(this, _40c5);
if (_40c5 != null) {
this.output1 = new OutputPort();
this.output1.setWorkflow(_40c5);
this.output1.setName("output1");
this.output1.setBackgroundColor(new Color(115, 115, 245));
this.addPort(this.output1, this.width / 2, this.height);
this.output2 = new OutputPort();
this.output2.setWorkflow(_40c5);
this.output2.setName("output2");
this.output2.setBackgroundColor(new Color(115, 115, 245));
this.addPort(this.output2, this.width, this.height / 2);
this.input1 = new InputPort();
this.input1.setWorkflow(_40c5);
this.input1.setName("input1");
this.input1.setBackgroundColor(new Color(245, 115, 115));
this.addPort(this.input1, 0, this.height / 2);
this.input2 = new InputPort();
this.input2.setWorkflow(_40c5);
this.input2.setName("input2");
this.input2.setBackgroundColor(new Color(245, 115, 115));
this.addPort(this.input2, this.width / 2, 0);
}
};
InputPort.prototype.onDrop=function(port){
if(port.getMaxFanOut&&port.getMaxFanOut()<=port.getFanOut()){
return;
}
if(this.parentNode.id==port.parentNode.id){
}else{
var _3f02=new CommandConnect(this.parentNode.workflow,port,this);
if(_3f02.source.type == _3f02.target.type){
return;
}
_3f02.setConnection(new DecoratedConnection());
this.parentNode.workflow.getCommandStack().execute(_3f02);
}
};
OutputPort.prototype.onDrop=function(port){
if(this.getMaxFanOut()<=this.getFanOut()){
return;
}
if(this.parentNode.id==port.parentNode.id){
}else{
var _4070=new CommandConnect(this.parentNode.workflow,this,port);
if(_4070.source.type == _4070.target.type){
return;
}
_4070.setConnection(new DecoratedConnection());
this.parentNode.workflow.getCommandStack().execute(_4070);
}
};
////// Decorators to add an arrow to the flow line. To show the direction of flow //////////////
DecoratedConnection=function(){
Connection.call(this);
this.setTargetDecorator(new ArrowConnectionDecorator());
this.setRouter(new ManhattanConnectionRouter());
};
DecoratedConnection.prototype=new Connection();
DecoratedConnection.prototype.type="DecoratedConnection";
////////--------------------------------------------------------------------------------------------///////
FlowMenu = function (_39f9) {
this.actionAdd = new ButtonAdd(this);
this.actionTask = new ButtonTask(this);
this.actionInterEvent = new ButtonInterEvent(this);
this.actionEndEvent = new ButtonEndEvent(this);
this.actionGateway = new ButtonGateway(this);
this.actionFront = new ButtonMoveFront(this);
this.actionBack = new ButtonMoveBack(this);
this.actionDelete = new ButtonDelete(this);
this.actionAnnotation = new ButtonAnnotation(this);
ToolPalette.call(this);
this.setDimension(20, 80);
this.setBackgroundColor(new Color(220, 255, 255));
this.currentFigure = null;
this.myworkflow = _39f9;
this.added = false;
this.setDeleteable(false);
this.setCanDrag(false);
this.setResizeable(false);
this.setSelectable(false);
this.setBackgroundColor(null);
this.setColor(null);
this.scrollarea.style.borderBottom = "0px";
this.actionAdd.setPosition(0, 0);
this.actionInterEvent.setPosition(20, 0);
this.actionGateway.setPosition(20, 20);
this.actionFront.setPosition(0, 18);
this.actionBack.setPosition(0, 36);
this.actionDelete.setPosition(0, 54);
this.addChild(this.actionFront);
this.addChild(this.actionBack);
this.addChild(this.actionDelete);
};
ToolPalette.prototype.removechild = function (_4079) {
if (_4079 != null) {
var parentNode = this.html;
if (parentNode != null) {
var len = parentNode.children[0].children.length;
for (var i = 0; i < len; i++) {
var childNode = parentNode.children[0].children[i];
if (childNode == _4079.html) {
parentNode.children[0].removeChild(childNode);
}
}
}
}
};
FlowMenu.prototype = new ToolPalette;
FlowMenu.prototype.setAlpha = function (_39fa) {
Figure.prototype.setAlpha.call(this, _39fa);
};
FlowMenu.prototype.hasTitleBar = function () {
return false;
};
FlowMenu.prototype.setFigure = function (_3087) {
}
FlowMenu.prototype.onSelectionChanged = function (_39fb) {
if (_39fb == this.currentFigure) {
return;
}
if (this.added == true) {
this.myworkflow.removeFigure(this);
this.added = false;
}
if (_39fb != null && this.added == false) {
if (this.myworkflow.getEnableSmoothFigureHandling() == true) {
this.setAlpha(0.01);
}
this.myworkflow.addFigure(this, 100, 100);
this.added = true;
}
if (this.currentFigure != null) {
this.currentFigure.detachMoveListener(this);
}
this.currentFigure = _39fb;
if (this.currentFigure != null) {
this.currentFigure.attachMoveListener(this);
this.onOtherFigureMoved(this.currentFigure);
}
};
FlowMenu.prototype.setWorkflow = function (_39fc) {
Figure.prototype.setWorkflow.call(this, _39fc);
};
FlowMenu.prototype.onOtherFigureMoved = function (_39fd) {
var pos = _39fd.getPosition();
this.setPosition(pos.x + _39fd.getWidth() + 7, pos.y - 16);
if (_39fd.workflow != null) {
var bpmnShape = _39fd.workflow.currentSelection.type;
switch (bpmnShape) {
case 'bpmnTask':
this.addChild(this.actionAdd);
this.addChild(this.actionInterEvent);
this.addChild(this.actionEndEvent);
this.addChild(this.actionGateway);
this.addChild(this.actionAnnotation);
this.actionAnnotation.setPosition(20,60);
this.actionEndEvent.setPosition(20,40)
this.removechild(this.actionTask);
break;
case 'bpmnEventEmptyEnd':
case 'bpmnEventMessageEnd':
case 'bpmnEventErrorEnd':
case 'bpmnEventCancelEnd':
case 'bpmnEventCompEnd':
case 'bpmnEventMultipleEnd':
case 'bpmnEventEndSignal':
case 'bpmnEventTerminate':
this.addChild(this.actionAnnotation);
this.actionAnnotation.setPosition(0,0);
this.removechild(this.actionInterEvent);
this.removechild(this.actionEndEvent);
this.removechild(this.actionTask);
this.removechild(this.actionGateway);
this.removechild(this.actionAdd);
break;
case 'bpmnEventEmptyStart':
case 'bpmnEventMessageStart':
case 'bpmnEventTimerStart':
case 'bpmnEventRuleStart':
case 'bpmnEventSignalStart':
case 'bpmnEventMulStart':
this.addChild(this.actionAdd);
this.addChild(this.actionAnnotation);
this.actionAnnotation.setPosition(20,40);
this.addChild(this.actionInterEvent);
this.actionInterEvent.setPosition(20,20)
this.addChild(this.actionGateway);
this.actionGateway.setPosition(20,0)
break;
case 'bpmnEventEmptyInter':
case 'bpmnEventMessageSendInter':
case 'bpmnEventMessageRecInter':
case 'bpmnEventTimerInter':
case 'bpmnEventCompInter':
case 'bpmnEventRuleInter':
case 'bpmnEventLinkInter':
case 'bpmnEventInterSignal':
case 'bpmnEventMultipleInter':
this.addChild(this.actionAdd);
this.addChild(this.actionAnnotation);
this.actionAnnotation.setPosition(20,60);
this.addChild(this.actionInterEvent);
this.actionInterEvent.setPosition(20,20)
this.addChild(this.actionGateway);
this.actionGateway.setPosition(20,0);
this.addChild(this.actionEndEvent);
this.actionEndEvent.setPosition(20,40);
break;
case 'bpmnGatewayInclusive':
case 'bpmnGatewayExclusiveData':
case 'bpmnGatewayExclusiveEvent':
case 'bpmnGatewayComplex':
case 'bpmnGatewayParallel':
this.addChild(this.actionAdd);
this.addChild(this.actionAnnotation);
this.actionAnnotation.setPosition(20,60);
this.addChild(this.actionInterEvent);
this.actionInterEvent.setPosition(20,20)
this.addChild(this.actionGateway);
this.actionGateway.setPosition(20,0);
this.addChild(this.actionEndEvent);
this.actionEndEvent.setPosition(20,40);
break;
default:
this.addChild(this.actionAdd);
this.removechild(this.actionTask);
this.removechild(this.actionInterEvent);
this.removechild(this.actionGateway);
break;
}
}
};
bpmnTask.prototype.addShapes = function (_3896) {
var x = _3896.workflow.currentSelection.getX(); //Get x co-ordinate from figure
var y = _3896.workflow.currentSelection.getY(); //Get y co-ordinate from figure
var xOffset = parseFloat(x + _3896.workflow.currentSelection.width); //Get x-offset co-ordinate from figure
var yOffset = parseFloat(y + _3896.workflow.currentSelection.height); //Get y-offset co-ordinate from figure
var count;
var shape = _3896.workflow.currentSelection.type;
/* Incrementing Task No and assigning it to a local variable
* taskNo Globally Declared in processmap.js
* taskNo will have Last Task count
* */
if (_3896.newShapeName == 'bpmnTask') count = ++_3896.workflow.taskNo;
NewShape = eval("new " + _3896.newShapeName + "(_3896.workflow)");
_3896.workflow.addFigure(NewShape, xOffset, yOffset);
var conn = new DecoratedConnection();
if(NewShape.getPort("input1") != null){
conn.setTarget(NewShape.getPort("input1"));
conn.setSource(_3896.workflow.currentSelection.getPort("output1"));
_3896.workflow.addFigure(conn);
}
else
{
conn.setTarget(NewShape.getPort("output1"));
conn.setSource(_3896.workflow.currentSelection.getPort("input1"));
_3896.workflow.addFigure(conn);
}
}
ButtonInterEvent = function (_30a8) {
Button.call(this, _30a8, 16, 16);
};
ButtonInterEvent.prototype = new Button;
ButtonInterEvent.prototype.type = "/skins/ext/images/gray/shapes/interevent";
ButtonInterEvent.prototype.execute = function () {
var count = 0;
this.palette.newShapeName = 'bpmnEventEmptyInter';
bpmnTask.prototype.addShapes(this.palette);
};
ButtonEndEvent = function (_30a8) {
Button.call(this, _30a8, 16, 16);
};
ButtonEndEvent.prototype = new Button;
ButtonEndEvent.prototype.type = "/skins/ext/images/gray/shapes/endevent";
ButtonEndEvent.prototype.execute = function () {
var count = 0;
this.palette.newShapeName = 'bpmnEventEmptyEnd';
bpmnTask.prototype.addShapes(this.palette);
};
ButtonGateway = function (_30a8) {
Button.call(this, _30a8, 16, 16);
};
ButtonGateway.prototype = new Button;
ButtonGateway.prototype.type = "/skins/ext/images/gray/shapes/gateway-small";
ButtonGateway.prototype.execute = function () {
this.palette.newShapeName = 'bpmnGatewayExclusiveData';
bpmnTask.prototype.addShapes(this.palette);
};
ButtonAnnotation = function (_30a8) {
Button.call(this, _30a8, 16, 16);
};
ButtonAnnotation.prototype = new Button;
ButtonAnnotation.prototype.type = "/skins/ext/images/gray/shapes/annotation";
ButtonAnnotation.prototype.execute = function () {
var count = 0;
this.palette.newShapeName = 'bpmnAnnotation';
bpmnTask.prototype.addShapes(this.palette);
};
ButtonTask = function (_30a8) {
Button.call(this, _30a8, 16, 16);
};
ButtonTask.prototype = new Button;
ButtonTask.prototype.type = "/skins/ext/images/gray/shapes/Task";
ButtonTask.prototype.execute = function () {
this.palette.newShapeName = 'bpmnTask';
bpmnTask.prototype.addShapes(this.palette);
};
ButtonAdd = function (_30a8) {
Button.call(this, _30a8, 16, 16);
};
ButtonAdd.prototype = new Button;
ButtonAdd.prototype.type = "/skins/ext/images/gray/shapes/btn-add";
ButtonAdd.prototype.execute = function () {
this.palette.newShapeName = 'bpmnTask';
bpmnTask.prototype.addShapes(this.palette);
};
ButtonDelete = function (_30a9) {
Button.call(this, _30a9, 16, 16);
};
ButtonDelete.prototype = new Button;
ButtonDelete.prototype.type = "/skins/ext/images/gray/shapes/btn-del";
ButtonDelete.prototype.execute = function () {
var shape = this.palette.workflow.currentSelection.type;
/* Decrementing Task No and assigning it to a local variable
* taskNo Globally Declared in processmap.js
* taskNo will have Last Task count
* */
if (shape == 'bpmnTask') {
--this.palette.workflow.taskNo;
}
this.palette.workflow.getCommandStack().execute(new CommandDelete(this.palette.workflow.getCurrentSelection()));
ToolGeneric.prototype.execute.call(this);
};
ButtonMoveFront = function (_3e22) {
Button.call(this, _3e22, 16, 16);
};
ButtonMoveFront.prototype = new Button;
ButtonMoveFront.prototype.type = "/skins/ext/images/gray/shapes/btn-movefrnt";
ButtonMoveFront.prototype.execute = function () {
this.palette.workflow.moveFront(this.palette.workflow.getCurrentSelection());
ToolGeneric.prototype.execute.call(this);
};
ButtonMoveBack = function (_4091) {
Button.call(this, _4091, 16, 16);
};
ButtonMoveBack.prototype = new Button;
ButtonMoveBack.prototype.type = "/skins/ext/images/gray/shapes/btn-movebk";
ButtonMoveBack.prototype.execute = function () {
this.palette.workflow.moveBack(this.palette.workflow.getCurrentSelection());
ToolGeneric.prototype.execute.call(this);
};
bpmnTaskDialog = function (_2e5e) {
this.figure = _2e5e;
var title = 'Task Detail';
Dialog.call(this, title);
this.setDimension(400, 100); //Set the width and height of the Dialog box
}
bpmnTaskDialog.prototype = new Dialog();
bpmnTaskDialog.prototype.createHTMLElement = function () {
var item = Dialog.prototype.createHTMLElement.call(this);
var inputDiv = document.createElement("form");
inputDiv.style.position = "absolute";
inputDiv.style.left = "10px";
inputDiv.style.top = "30px";
inputDiv.style.width = "375px";
inputDiv.style.font = "normal 10px verdana";
item.appendChild(inputDiv);
this.label = document.createTextNode("Task Name");
inputDiv.appendChild(this.label);
this.input = document.createElement("input");
this.input.style.border = "1px solid gray";
this.input.style.font = "normal 10px verdana";
this.input.type = "text";
var value = bpmnTaskDialog.prototype.trim(this.figure.html.textContent);
if (value) this.input.value = value;
else this.input.value = "";
this.input.style.width = "100%";
inputDiv.appendChild(this.input);
this.input.focus();
return item;
};
/*Double Click Event for opening the dialog Box*/
bpmnTask.prototype.onDoubleClick = function () {
var _409d = new bpmnTaskDialog(this);
this.workflow.showDialog(_409d, this.workflow.currentSelection.x, this.workflow.currentSelection.y);
};
/**
* This method will be called if the user pressed the OK button in buttonbar of the dialog.<br>
* The string is first cleared and new string is painted.<br><br>
**/
bpmnTaskDialog.prototype.onOk = function () {
this.figure.bpmnNewText.clear();
tempcoord = this.workflow.currentSelection.coord_converter(this.workflow.currentSelection.width, this.workflow.currentSelection.height, this.input.value.length)
//this.figure.bpmnNewText.drawStringRect(this.input.value,this.workflow.currentSelection.width/2-30,this.workflow.currentSelection.height/2-10,200,'left');
this.figure.bpmnNewText.drawTextString(this.input.value, this.workflow.currentSelection.width, this.workflow.currentSelection.height, tempcoord.temp_x, tempcoord.temp_y);
this.figure.bpmnNewText.paint();
this.figure.taskName = this.input.value; //Set Updated Text value
//alert(this.input.value.length);
//this.workflow.currentSelection.width = this.input.value.length;
//VectorFigure.prototype.paint.call(this.figure);
this.workflow.removeFigure(this);
};
bpmnTask.prototype.getContextMenu = function () {
if (this.id != null) {
this.canvasTask = Ext.get(this.id);
this.contextTaskmenu = new Ext.menu.Menu({
items: [{
text: 'Steps',
scope: this
},
{
text: 'Users & Users Group',
scope: this
},
{
text: 'Users & Users Groups (ad-hoc)',
scope: this
},
{
text: 'Routing Rule',
scope: this
},
{
text: 'Deleting Routing Rule',
scope: this
},
{
text: 'Delete Task',
scope: this
},
{
text: 'Properties',
scope: this
}]
});
}
this.canvasTask.on('contextmenu', function (e) {
e.stopEvent();
this.contextTaskmenu.showAt(e.getXY());
}, this);
};

View File

@@ -0,0 +1,380 @@
// --------------------------------------------------------------------
// Javascript Magnifier v 0.97
// Written by Dino Termini - termini@email.it - May 9, 2003
// This script is freeware (GPL) but if you use it, please let me know!
//
// Portions of code by zoomIN, zoomOUT
// Author: Nguyen Duong Minh (Obie) - obie4web@yahoo.com
// WWW: http://ObieWebsite.SourceForge.net
// License: GNU (GPL)
//
// Portions of code by Webreference Javascript Cookie Functions
// Jupirmedia Corporation
// http://www.internet.com
bpmnZoom=function(){
// Configuration parameters
// ------------------------
// Measure unit in pixel (px) or points (pt)
// measureUnit = "pt"
measureUnit = "px"
// Minimum size allowed for SIZE attribute (like in <FONT SIZE="1"> )
minSize = 1;
// Minimum size allowed for STYLE attribute (like in <FONT STYLE="font-size: 10px"> )
minStyleSize = 10;
// Maximum size allowed for SIZE attribute
maxSize = 6;
// Maximum size allowed for STYLE attribute
maxStyleSize = 30;
// Start size for tags with no SIZE attribute defined
startSize = 1;
// Start size for tags with no font-size STYLE or CLASS attribute defined
startStyleSize = 10;
// Increasing and decreasing step
stepSize = 1;
// Increasing step for STYLE definition (measure previously declared will be used)
stepStyleSize = 2;
// To set your own hotkeys, use key generator tool page included
// Keys to zooming in (with and without CAPS lock). Default: "+"
var keyin = 61;
var keyinCAPS = 43;
// Keys to zooming out (with and without CAPS lock). Default: "-"
var keyout = 45;
var keyoutCAPS = 95;
// Keys for "hard" zooming in (with and without CAPS lock). Default: ">"
var keyinIe = 46;
var keyinIeCAPS = 62;
// Keys for "hard" zooming out (with and without CAPS lock). Default: "<"
var keyoutIe = 44;
var keyoutIeCAPS = 60;
// "Hard" zoom factor
var zoomFactor = 1.1;
// Max zoom allowed
var maxZoom = 4.096;
// Min zoom allowed
var minZoom = 0.625;
// Initial decrease zoom
var startDecZoom = 0.7;
// Initial increase zoom
var startIncZoom = 1.3;
// Cookie expiry (default one year, actually 365 days)
// 365 days in a year
// 24 hours in a day
// 60 minutes in an hour
// 60 seconds in a minute
// 1000 milliseconds in a second
userExpiry = 365 * 24 * 60 * 60 * 1000;
// Enable or disable alert messages
alertEnabled = false;
// Allow input fields resize (text, buttons, and so on)
allowInputResize = false;
// End of configuration parameters. Please do not edit below this line
// --------------------------------------------------------------------------------
}
// Input values:
// name - name of the cookie
// value - value of the cookie
// [expires] - expiration date of the cookie (defaults to end of current session)
// [path] - path for which the cookie is valid (defaults to path of calling document)
// [domain] - domain for which the cookie is valid (defaults to domain of calling document)
// [secure] - Boolean value indicating if the cookie transmission requires a secure transmission
// * an argument defaults when it is assigned null as a placeholder
// * a null placeholder is not required for trailing omitted arguments
bpmnZoom.prototype.setCookie = function(name, value, expires, path, domain, secure) {
// Check whether cookies enabled
document.cookie = "Enabled=true";
var cookieValid = document.cookie;
// if retrieving the VALUE we just set actually works
// then we know cookies enabled
if (cookieValid.indexOf("Enabled=true") != -1) {
var curCookie = name + "=" + escape(value) +
((expires) ? "; expires=" + expires.toGMTString() : "") +
((path) ? "; path=" + path : "") +
((domain) ? "; domain=" + domain : "") +
((secure) ? "; secure" : "");
document.cookie = curCookie;
return(true);
}
else {
return(false);
}
}
// Input value:
// name - name of the desired cookie
// * return string containing value of specified cookie or null if cookie does not exist
bpmnZoom.prototype.getCookie = function(name) {
var dc = document.cookie;
var prefix = name + "=";
var begin = dc.indexOf("; " + prefix);
if (begin == -1) {
begin = dc.indexOf(prefix);
if (begin != 0) return null;
} else
begin += 2;
var end = document.cookie.indexOf(";", begin);
if (end == -1)
end = dc.length;
return unescape(dc.substring(begin + prefix.length, end));
}
// Input values:
// name - name of the cookie
// [path] - path of the cookie (must be same as path used to create cookie)
// [domain] - domain of the cookie (must be same as domain used to create cookie)
// * path and domain default if assigned null or omitted if no explicit argument proceeds
bpmnZoom.prototype.deleteCookie = function(name, path, domain) {
if (this.getCookie(name)) {
document.cookie = name + "=" +
((path) ? "; path=" + path : "") +
((domain) ? "; domain=" + domain : "") +
"; expires=Thu, 01-Jan-70 00:00:01 GMT";
}
}
// Input value:
// date - any instance of the Date object
// * hand all instances of the Date object to this function for "repairs"
bpmnZoom.prototype.fixDate = function(date) {
var base = new Date(0);
var skew = base.getTime();
if (skew > 0)
date.setTime(date.getTime() - skew);
}
bpmnZoom.prototype.searchTags = function(childTree, level) {
var retArray = new Array();
var tmpArray = new Array();
var j = 0;
var childName = "";
for (var i=0; i<childTree.length; i++) {
childName = childTree[i].nodeName;
if (childTree[i].hasChildNodes()) {
if ((childTree[i].childNodes.length == 1) && (childTree[i].childNodes[0].nodeName == "#text"))
retArray[j++] = childTree[i];
else {
tmpArray = this.searchTags(childTree[i].childNodes, level+1);
for (var k=0;k<tmpArray.length; k++)
retArray[j++] = tmpArray[k];
retArray[j++] = childTree[i];
}
}
else
retArray[j++] = childTree[i];
}
return(retArray);
}
bpmnZoom.prototype.changeFontSize = function(stepSize, stepStyleSize, useCookie) {
if (document.body) {
// var centerRegionId = workflow.main.items.items[2].body.id;
// canvas = Ext.get(centerRegionId);
// var oChild = document.getElementById(canvas.id).getChildren;
// var oChild = document.getElementById('ext-gen34').getChildren;
var myObj = this.searchTags(document.body.childNodes, 0);
var myCookieSize = parseInt(this.getCookie("incrSize"));
var myCookieStyleSize = parseInt(this.getCookie("incrStyleSize"));
var myStepSize = stepSize;
var myStepStyleSize = stepStyleSize;
var now = new Date();
// Fix the bug in Navigator 2.0, Macintosh
this.fixDate(now);
if (isNaN(myCookieSize)) myCookieSize = 0;
if (isNaN(myCookieStyleSize)) myCookieStyleSize = 0;
// For debug purpose only
// if (!confirm("COOKIE: SIZE ["+myCookieSize+"] STYLESIZE ["+myCookieStyleSize+"]")) return(0);
// Check valid increment/decrement sizes or useCookie parameter
if (useCookie) {
myStepSize = myCookieSize;
myStepStyleSize = myCookieStyleSize;
}
now.setTime(now.getTime() + userExpiry);
myObjNumChilds = myObj.length;
for (i=0; i<myObjNumChilds; i++) {
myObjName = myObj[i].nodeName;
// Only some tags will be parsed
if (myObjName != "#text" && myObjName != "HTML" &&
myObjName != "HEAD" && myObjName != "TITLE" &&
myObjName != "STYLE" && myObjName != "SCRIPT" &&
myObjName != "BR" && myObjName != "TBODY" &&
myObjName != "#comment" && myObjName != "FORM") {
// Skip INPUT fields, if required
if (!allowInputResize && myObjName == "INPUT") continue;
size = parseInt(myObj[i].getAttribute("size"));
// Internet Explorer uses a different DOM implementation
if (myObj[i].currentStyle)
styleSize = parseInt(myObj[i].currentStyle.fontSize);
else
styleSize = parseInt(window.getComputedStyle(myObj[i], null).fontSize);
// For debug purpose only. Note: can be very annoying
// if (!confirm("TAG ["+myObjName+"] SIZE ["+size+"] STYLESIZE ["+styleSize+"]")) return(0);
if (isNaN(size) || (size < minSize) || (size > maxSize))
size = startSize;
if (isNaN(styleSize) || (styleSize < minStyleSize) || (styleSize > maxStyleSize))
styleSize = startStyleSize;
if ( ((size > minSize) && (size < maxSize)) ||
((size == minSize) && (stepSize > 0)) ||
((size == maxSize) && (stepSize < 0)) || useCookie) {
myObj[i].setAttribute("size", size+myStepSize);
}
if ( ((styleSize > minStyleSize) && (styleSize < maxStyleSize)) ||
((styleSize == minStyleSize) && (stepStyleSize > 0)) ||
((styleSize == maxStyleSize) && (stepStyleSize < 0)) || useCookie) {
newStyleSize = styleSize+myStepStyleSize;
myObj[i].style.fontSize = newStyleSize+measureUnit;
}
} // End if condition ("only some tags")
} // End main for cycle
// Set the cookies
if (!useCookie) {
cookieIsSet = this.setCookie("incrSize", myStepSize+myCookieSize, now);
cookieIsSet = this.setCookie("incrStyleSize", myStepStyleSize+myCookieStyleSize, now);
if (alertEnabled && !cookieIsSet) {
alert("Per mantenere in memoria la dimensione scelta, abilita i cookie nel browser");
}
}
} // End if condition ("document.body exists")
} // End function declaration
bpmnZoom.prototype.increaseFontSize = function() {
if (document.body) {
this.changeFontSize(stepSize, stepStyleSize, false);
}
else {
if (alertEnabled) {
alert("Spiacente, il tuo browser non supporta questa funzione");
}
}
}
bpmnZoom.prototype.decreaseFontSize = function() {
if (document.body) {
myStepSize = -stepSize;
myStepStyleSize = -stepStyleSize;
this.changeFontSize(myStepSize, myStepStyleSize, false);
}
else {
if (alertEnabled) {
alert("Spiacente, il tuo browser non supporta questa funzione");
}
}
}
bpmnZoom.prototype.zoomin = function() {
if (window.parent.document.body.style.zoom < maxZoom) {
if (window.parent.document.body.style.zoom > 0) {
window.parent.document.body.style.zoom *= zoomFactor;
}
else {
window.parent.document.body.style.zoom = startIncZoom;
}
}
else {
if (alertEnabled) {
alert("Warning: Max size reached");
}
}
}
bpmnZoom.prototype.zoomout = function() {
if ( (window.parent.document.body.style.zoom > minZoom) ||
(window.parent.document.body.style.zoom == 0) ) {
if (window.parent.document.body.style.zoom > 0) {
window.parent.document.body.style.zoom /= zoomFactor;
}
else {
window.parent.document.body.style.zoom = startDecZoom;
}
}
else {
if (alertEnabled) {
alert("Warning: Min size reached");
}
}
}
bpmnZoom.prototype.checkzoom = function(e) {
if (document.all) {
myEvent = event.keyCode;
}
else {
myEvent = e.which;
}
switch(myEvent) {
case keyinIe:
case keyinIeCAPS:
this.zoomin();
break;
case keyoutIe:
case keyoutIeCAPS:
this.zoomout();
break;
case keyin:
case keyinCAPS:
this.increaseFontSize();
break;
case keyout:
case keyoutCAPS:
this.decreaseFontSize();
break;
default:
break;
}
}
if (document.layers) {
document.captureEvents(Event.KEYPRESS);
}
document.onkeypress = this.checkzoom;

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,10 @@
<div id='cases-grid'></div>
<div id="toolbar"></div>
<div id="center1" class="x-layout-active-content">
<div id="paintarea" >
</div>
</div>
<div id="debug">
</div>
<div id="properties">
</div>

View File

@@ -0,0 +1,804 @@
Ext.onReady ( function() {
workflow = new MyWorkflow("paintarea");
workflow.setEnableSmoothFigureHandling(true);
workflow.scrollArea.width = 2000;
//For Undo and Redo Options
// workflow.getCommandStack().addCommandStackEventListener(new commandListener());
//Getting process id from the URL using getUrlvars function
var pro_uid = getUrlVars();
if(typeof pro_uid != 'undefined')
{
Ext.Ajax.request({
url: 'openProcess.php?PRO_UID=' + pro_uid,
success: function(response) {
var shapesData = createShapes(response.responseText,this);
createConnection(shapesData);
},
failure: function(){
Ext.Msg.alert ('Failure');
}
});
//load all the Information related to the process
// var urlparams = '?action=load&data={"uid":"'+ pro_uid +'"}';
// Ext.Ajax.request({
// url: "processes_Ajax.php"+ urlparams,
// success: function(response) {
// this.workflow.processInfo = Ext.util.JSON.decode(response.responseText);
// },
// failure: function(){
// Ext.Msg.alert ('Failure');
// }
// });
//Get All the processes
// var urlparams = '?action=getProcesses';
// Ext.Ajax.request({
// url: "processes_Ajax.php"+ urlparams,
// success: function(response) {
// this.workflow.processName = Ext.util.JSON.decode(response.responseText);
// },
// failure: function(){
// Ext.Msg.alert ('Failure');
// }
// });
}
/**********************************************************************************
*
* Do the Ext (Yahoo UI) Stuff
*
**********************************************************************************/
var west= {
xtype :"panel",
title: 'Palette',
region: 'west',
split: false,
width: 75,
collapsible: false,
margins:'3 0 3 3',
cmargins:'3 3 3 3',
items:{
html:'<div id="x-shapes"><p id="x-shapes-task" title="Task" ><img src= "/skins/ext/images/gray/shapes/pallete/task.png"/></p>\n\
<p id="x-shapes-startEvent" title="Start"><img src= "/skins/ext/images/gray/shapes/pallete/startevent.png"/></p>\n\
<p id="x-shapes-interEvent" title="Intermediate Event"><img src= "/skins/ext/images/gray/shapes/pallete/interevent.png"/></p>\n\
<p id="x-shapes-endEvent" title="End Event"><img src= "/skins/ext/images/gray/shapes/pallete/endevent.png"/></p>\n\
<p id="x-shapes-gateways" title="Gateway"><img src= "/skins/ext/images/gray/shapes/pallete/gateway.png"/></p>\n\
<p id="x-shapes-group" title="Group"><img src= "/skins/ext/images/gray/shapes/pallete/group.png"/></p>\n\
<p id="x-shapes-annotation" title="Annotation"><img src= "/skins/ext/images/gray/shapes/pallete/annotation.png"/></p>\n\
<p id="x-shapes-dataobject" title="Data Object"><img src= "/skins/ext/images/gray/shapes/pallete/dataobject.png"/></p>\n\
<p id="x-shapes-pool" title="Pool"><img src= "/skins/ext/images/gray/shapes/pallete/pool.png"/></p>\n\
<p id="x-shapes-lane" title="Lane"><img src= "/skins/ext/images/gray/shapes/pallete/lane.png"/></p>\n\
<p id="x-shapes-milestone" title="Milestone"><img src= "/skins/ext/images/gray/shapes/pallete/milestone.png"/></p>\n\
</div>'
}
};
var north= {
xtype : "panel",
initialSize: 60,
split:false,
titlebar: false,
collapsible: false,
animate: false,
region : "north"
};
var south= {
xtype : "panel",
initialSize: 120,
height: 100,
split:true,
titlebar: false,
collapsible: true,
autoScroll:true,
animate: true,
region : "south",
items: {
region: 'center',
xtype: 'tabpanel',
items: [{
title: 'Properties',
html: 'Properties'
},
{
title: 'Debug Console',
html: 'Debug Console'
}]
}
};
var center= {
width:100,
height:200,
xtype : "panel",
titlebar: true,
title : 'BPMN Processmap',
autoScroll:true,
fitToFrame:true,
region : "center"
};
var processObj = new ProcessOptions();
var main = new Ext.Panel({
tbar: [
{
text: 'Save',
cls: 'x-btn-text-icon',
handler: function() {
saveProcess();
}
},
{
text:'Save as'
},
{
text:'Undo',
handler: function() {
workflow.getCommandStack().undo();
}
},
{
text:'Redo',
handler: function() {
workflow.getCommandStack().redo();
}
},
{
xtype: 'tbsplit',
text: 'Process',
menu: new Ext.menu.Menu({
items: [{
text : 'Dynaform',
handler : function() {
processObj.addDynaform();
}
},
{text: 'Input Document'},{text: 'Output Document'},{text: 'Trigger'},{text: 'Report Table'},{text: 'Database Connection'},{text: 'Cases Scheduler'}]
})
},
{
text:'Zoom In',
handler: function() {
var figures = workflow.getDocument().getFigures();
for(f = 0;f<figures.getSize();f++){
var fig = figures.get(f);
var width = fig.getWidth();
var height = fig.getHeight();
fig.setDimension(width+10,height+10);
}
// var lines = workflow.getDocument().getLines();
// for(l = 0;l<lines.getSize();l++){
// var line = lines.get(l);
// line.startX += 10;
// line.startY += 10;
// line.endX += 10;
// line.endY += 10;
// }
oZoom = new bpmnZoom();
oZoom.increaseFontSize();
}
},
{
text:'Zoom Out',
handler: function() {
var figures = workflow.getDocument().getFigures();
for(f = 0;f<figures.getSize();f++){
var fig = figures.get(f);
var width = fig.getWidth();
var height = fig.getHeight();
fig.setDimension(width-10,height-10);
}
oZoom = new bpmnZoom();
oZoom.decreaseFontSize();
}
},
],
renderTo : "center1",
layout : "border",
autoScroll: true,
height : 1000,
width : 1300,
items : [west,north,center]
});
//Get main into workflow object
workflow.main = main;
//items[3]=>'center region'
var centerRegionId = main.items.items[2].body.id;
canvas = Ext.get(centerRegionId);
//Context Menu of ProcessMap
ProcessMapObj = new ProcessMapContext();
contextCanvasMenu = new Ext.menu.Menu({
items: [{
text: 'Edit Process',
handler: ProcessMapObj.editProcess,
icon: '/skins/ext/images/gray/shapes/more.gif',
scope: this
}, {
text: 'Export Process',
handler: ProcessMapObj.exportProcess,
scope: this
}, {
text: 'Add Task',
handler: ProcessMapObj.addTask,
scope: this
}, {
text: 'Add Subprocess',
handler: workflow.subProcess,
scope: this
},/* {
text: 'Horizontal Line',
handler: ProcessMapObj.horiLine,
scope: this
}, {
text: 'Vertical Line',
handler: ProcessMapObj.vertiLine,
scope: this
}, {
text: 'Delete All Lines',
handler: ProcessMapObj.delLines,
scope: this
}, */{
text: 'Process Permission',
handler: ProcessMapObj.processPermission,
scope: this
},{
text: 'Case Tracker',
handler: ProcessMapObj.caseTracker,
scope: this
}, {
text: 'Process File Manager',
menu: { // <-- submenu by nested config object
items: [
// stick any markup in a menu
{
text: 'mailTemplates',
handler: ProcessMapObj.processFileManager
},
{
text: 'public',
handler: ProcessMapObj.processFileManager
}
]
}
}]
});
canvas.on('contextmenu', function(e) {
e.stopEvent();
this.workflow.contextX = e.xy[0];
this.workflow.contextY = e.xy[1];
var pmosExtObj = new pmosExt();
//Load all the process Data
pmosExtObj.loadEditProcess(this);
pmosExtObj.loadProcessCategory(this);
this.contextCanvasMenu.showAt(e.getXY());
}, this);
canvas.on('click', function(e) {
e.stopEvent();
this.workflow.contextClicked = false;
if(this.workflow.currentSelection != null)
this.workflow.disablePorts(this.workflow.currentSelection);
//Removes Flow menu
this.workflow.setCurrentSelection(null);
}, this);
var simpleToolbar = new Ext.Toolbar('toolbar');
simpleToolbar.addButton({
text: 'Save',
cls: 'x-btn-text-icon scroll-bottom'
});
simpleToolbar.addButton({
text: 'Save As',
cls: 'x-btn-text-icon scroll-bottom'
});
simpleToolbar.addButton({
text: 'Undo',
cls: 'x-btn-text-icon'
});
simpleToolbar.addButton({
text: 'Redo',
cls: 'x-btn-text-icon'
});
var menu = new FlowMenu(workflow);
workflow.addSelectionListener(menu);
workflow.scrollArea = document.getElementById(centerRegionId).parentNode;
var dragsource=new Ext.dd.DragSource("x-shapes-task", {
ddGroup:'TreeDD',
dragData:{
name: "bpmnTask"
}
});
var dragsource=new Ext.dd.DragSource("x-shapes-startEvent", {
ddGroup:'TreeDD',
dragData:{
name: "bpmnEventEmptyStart"
}
});
var dragsource=new Ext.dd.DragSource("x-shapes-interEvent", {
ddGroup:'TreeDD',
dragData:{
name: "bpmnEventEmptyInter"
}
});
var dragsource=new Ext.dd.DragSource("x-shapes-endEvent", {
ddGroup:'TreeDD',
dragData:{
name: "bpmnEventEmptyEnd"
}
});
var dragsource=new Ext.dd.DragSource("x-shapes-gateways", {
ddGroup:'TreeDD',
dragData:{
name: "bpmnGatewayExclusiveData"
}
});
var dragsource=new Ext.dd.DragSource("x-shapes-dataobject", {
ddGroup:'TreeDD',
dragData:{
name: "bpmnDataobject"
}
});
var dragsource=new Ext.dd.DragSource("x-shapes-pool", {
ddGroup:'TreeDD',
dragData:{
name: "bpmnPool"
}
});
var dragsource=new Ext.dd.DragSource("x-shapes-annotation", {
ddGroup:'TreeDD',
dragData:{
name: "bpmnAnnotation"
}
});
var droptarget=new Ext.dd.DropTarget(centerRegionId,{
ddGroup:'TreeDD'
});
//Creating Pool
var oPool = new bpmnPool(workflow);
//workflow.addFigure(oPool,100,70);
workflow.taskNo= 0; //Initializing Count for the bpmnTask
var count = 0;
this.taskName='';
droptarget.notifyDrop=function(dd, e, data)
{
if(data.name)
{
var xOffset = workflow.getAbsoluteX();
var yOffset = workflow.getAbsoluteY();
if(data.name == 'bpmnTask')
{
count = ++workflow.taskNo; //Incrementing Task No and assigning it to a local variable
workflow.boundaryEvent = false;
workflow.taskName = 'Task '+count;
}
NewShape = eval("new "+data.name+"(workflow)");
NewShape.x = e.xy[0];
NewShape.y = e.xy[1];
NewShape.actiontype = 'addTask';
if(data.name == 'bpmnAnnotation')
{
NewShape.actiontype = 'addText';
workflow.saveShape(NewShape); //Saving task when user drags and drops it
}
if(data.name == 'bpmnTask')
{
NewShape.actiontype = 'addTask';
workflow.saveShape(NewShape); //Saving Annotations when user drags and drops it
NewShape.taskName = workflow.taskName;
}
var scrollLeft = workflow.getScrollLeft();
var scrollTop = workflow.getScrollTop();
workflow.addFigure(NewShape,e.xy[0]-xOffset+scrollLeft,e.xy[1]-yOffset+scrollTop);
return true;
}
}
function createConnection(shapes)
{
//var totaltask = shapes[0].length; //shapes[0] is an array for all the tasks
//var totalgateways = shapes[1].length; //shapes[1] is an array for all the gateways
//var totalevents = shapes[2].length; //shapes[2] is an array for all the events
var totalroutes = shapes.routes.length; //shapes[3] is an array for all the routes
for(var i=0;i<=totalroutes-1;i++)
{
var sourceid = shapes.routes[i][1]; //getting source id for connection from Routes array
var targetid = shapes.routes[i][2]; //getting target id for connection from Routes array
//After creating all the shapes, check one by one shape id
for(var conn =0; conn < this.workflow.figures.data.length ; conn++)
{
if(typeof this.workflow.figures.data[conn] === 'object')
{
if(sourceid == this.workflow.figures.data[conn].id){
sourceObj = this.workflow.figures.data[conn];
}
}
}
for(var conn =0; conn < this.workflow.figures.data.length ; conn++)
{
if(typeof this.workflow.figures.data[conn] === 'object')
{
if(targetid == '-1')
{
targetObj = eval("new bpmnEventEmptyEnd (this.workflow)");
this.workflow.addFigure(targetObj,sourceObj.x+67,sourceObj.y+60);
break;
}
else if(targetid == this.workflow.figures.data[conn].id ){
targetObj = this.workflow.figures.data[conn];
}
}
}
//Making Connections
var connObj = new DecoratedConnection();
connObj.setSource(sourceObj.output1);
connObj.setTarget(targetObj.input2);
connObj.id = shapes.routes[i][0];
this.workflow.addFigure(connObj);
}
}
function getUrlVars()
{
var vars = [], hash;
var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
for(var i = 0; i < hashes.length; i++)
{
hash = hashes[i].split('=');
vars.push(hash[0]);
vars[hash[0]] = hash[1];
}
var pro_uid = vars["PRO_UID"];
return pro_uid;
}
function createShapes(stringData,_4562)
{
var responsearray = stringData.split("|");
var jsonstring = new Array();
var shapes = new Array();
//var param = new Array();
var shapeType = new Array();
for(var i=0; i<=responsearray.length-1;i++)
{
jsonstring[i] = responsearray[i].split(":");
var param = jsonstring[i][0].replace(" ","");
shapeType[i] = param;
switch(param)
{
case 'tasks':
shapes[param] = new Array();
shapes[param] = Ext.util.JSON.decode(jsonstring[i][1]);
break;
case 'gateways':
shapes[param] = new Array();
shapes[param] = Ext.util.JSON.decode(jsonstring[i][1]);
break;
case 'events':
shapes[param] = new Array();
shapes[param] = Ext.util.JSON.decode(jsonstring[i][1]);
break;
case 'annotations':
shapes[param] = new Array();
shapes[param] = Ext.util.JSON.decode(jsonstring[i][1]);
break;
case 'process':
shapes[param] = new Array();
shapes[param] = Ext.util.JSON.decode(jsonstring[i][1]);
break;
case 'subprocess':
shapes[param] = new Array();
shapes[param] = Ext.util.JSON.decode(jsonstring[i][1]);
break;
case 'routes':
shapes[param] = new Array();
shapes[param] = Ext.util.JSON.decode(jsonstring[i][1]);
break;
}
}
//Create all shapes
for(var j=0;j< shapeType.length;j++)
{
// _4562.workflow.taskNo=0;
switch(shapeType[j])
{
case 'tasks':
for(var k=0;k<shapes.tasks.length;k++){
var srctaskxpos = shapes.tasks[k][2];
var srctaskypos = shapes.tasks[k][3];
var task_width = shapes.tasks[k][4];
var task_height = shapes.tasks[k][5];
var task_boundary = shapes.tasks[k][6];
if(task_boundary != null && task_boundary == 'TIMER' && task_boundary == '')
_4562.workflow.boundaryEvent = true;
else
_4562.workflow.boundaryEvent = false;
if(k != 0)
_4562.workflow.taskNo++;
_4562.workflow.taskName = shapes.tasks[k][1];
workflow.task_width = task_width;
workflow.task_height = task_height;
NewShape = eval("new bpmnTask(_4562.workflow)");
NewShape.taskName = shapes.tasks[k][1];
_4562.workflow.addFigure(NewShape, srctaskxpos, srctaskypos);
workflow.setBoundary(NewShape);
//Setting newshape id to the old shape id
NewShape.html.id = shapes.tasks[k][0];
NewShape.id = shapes.tasks[k][0];
}
break;
case 'gateways':
for(var k=0;k<shapes.gateways.length;k++){
var srctype = shapes.gateways[k][1];
var srcxpos = shapes.gateways[k][2];
var srcypos = shapes.gateways[k][3];
NewShape = eval("new "+srctype+"(_4562.workflow)");
_4562.workflow.addFigure(NewShape, srcxpos, srcypos);
workflow.setBoundary(NewShape);
//Setting newshape id to the old shape id
NewShape.html.id = shapes.gateways[k][0];
NewShape.id = shapes.gateways[k][0];
}
break;
case 'events':
for(var k=0;k<shapes.events.length;k++){
var srceventtype = shapes.events[k][1];
if(! srceventtype.match(/End/))
{
var srceventxpos = shapes.events[k][2];
var srceventypos = shapes.events[k][3];
NewShape = eval("new "+srceventtype+"(_4562.workflow)");
_4562.workflow.addFigure(NewShape, srceventxpos, srceventypos);
workflow.setBoundary(NewShape);
//Setting newshape id to the old shape id
NewShape.html.id = shapes.events[k][0];
NewShape.id = shapes.events[k][0];
}
}
break;
case 'annotations':
for(var k=0;k<shapes.annotations.length;k++){
//var srcannotationname = shapes[j][k][1];
var srcannotationxpos = shapes.annotations[k][2];
var srcannotationypos = shapes.annotations[k][3];
var width = shapes.annotations[k][4];
var height = shapes.annotations[k][5];
_4562.workflow.annotationName = shapes.annotations[k][1];
workflow.anno_width = width;
workflow.anno_height = height;
NewShape = eval("new bpmnAnnotation(_4562.workflow)");
_4562.workflow.addFigure(NewShape, srcannotationxpos, srcannotationypos);
workflow.setBoundary(NewShape);
//Setting newshape id to the old shape id
NewShape.html.id = shapes.annotations[k][0];
NewShape.id = shapes.annotations[k][0];
}
break;
case 'subprocess':
for(var k=0;k<shapes.subprocess.length;k++){
var srctaskxpos = shapes.subprocess[k][2];
var srctaskypos = shapes.subprocess[k][3];
//_4562.workflow.taskNo++;
_4562.workflow.subProcessName = shapes.subprocess[k][1];
NewShape = eval("new bpmnSubProcess(_4562.workflow)");
_4562.workflow.addFigure(NewShape, srctaskxpos, srctaskypos);
workflow.setBoundary(NewShape);
//Setting newshape id to the old shape id
NewShape.html.id = shapes.subprocess[k][0];
NewShape.id = shapes.subprocess[k][0];
}
break;
}
}
return shapes;
}
function updateConnection(connArray,oldid,newid)
{
for(var i=0;i< connArray.length;i++)
{
if(connArray[i][1] == oldid)
connArray[i][1] = newid;
else if(connArray[i][2] == oldid)
connArray[i][2] = newid;
}
return connArray;
}
function debug(msg)
{
var console = document.getElementById("debug");
console.innerHTML=console.innerHTML+"<br>"+msg;
}
function saveProcess()
{
// console.dir(this.workflow);
var tasks = new Array();
var events = new Array();
var gateways = new Array();
var annotations = new Array();
var subprocess = new Array();
var l=0;
var m=0;
var n=0;
var p=0;
var r=0;
for(var c = 0; c<this.workflow.figures.data.length; c++)
{
if(this.workflow.figures.data[c]){
if(typeof this.workflow.figures.data[c] === "object")
{
if(this.workflow.figures.data[c].type.match(/Task/))
{
tasks[l] = new Array();
tasks[l][0] = this.workflow.figures.data[c].id;
tasks[l][1] = this.workflow.figures.data[c].taskName;
tasks[l][2] = this.workflow.figures.data[c].x;
tasks[l][3] = this.workflow.figures.data[c].y;
tasks[l][4] = this.workflow.figures.data[c].width;
tasks[l][5] = this.workflow.figures.data[c].height;
tasks[l][6] = 'NORMAL';
l++;
}
if(this.workflow.figures.data[c].type.match(/Gateway/))
{
gateways[m] = new Array();
gateways[m][0] = this.workflow.figures.data[c].id;
gateways[m][1] = this.workflow.figures.data[c].type;
gateways[m][2] = this.workflow.figures.data[c].x;
gateways[m][3] = this.workflow.figures.data[c].y;
gateways[m][4] = this.workflow.figures.data[c].width;
gateways[m][5] = this.workflow.figures.data[c].height;
m++;
}
if(this.workflow.figures.data[c].type.match(/Event/))
{
events[n] = new Array();
events[n][0] = this.workflow.figures.data[c].id;
events[n][1] = this.workflow.figures.data[c].type;
events[n][2] = this.workflow.figures.data[c].x;
events[n][3] = this.workflow.figures.data[c].y;
events[n][4] = this.workflow.figures.data[c].width;
events[n][5] = this.workflow.figures.data[c].height;
n++;
}
if(this.workflow.figures.data[c].type.match(/Annotation/))
{
annotations[p] = new Array();
annotations[p][0] = this.workflow.figures.data[c].id;
annotations[p][1] = this.workflow.figures.data[c].type;
annotations[p][2] = this.workflow.figures.data[c].x;
annotations[p][3] = this.workflow.figures.data[c].y;
annotations[p][4] = this.workflow.figures.data[c].width;
annotations[p][5] = this.workflow.figures.data[c].height;
annotations[p][6] = this.workflow.figures.data[c].annotationName;
p++;
}
if(this.workflow.figures.data[c].type.match(/SubProcess/))
{
subprocess[r] = new Array();
subprocess[r][0] = this.workflow.figures.data[c].id;
subprocess[r][1] = this.workflow.figures.data[c].subProcessName;
subprocess[r][2] = this.workflow.figures.data[c].x;
subprocess[r][3] = this.workflow.figures.data[c].y;
subprocess[r][4] = this.workflow.figures.data[c].width;
subprocess[r][5] = this.workflow.figures.data[c].height;
subprocess[r][6] = 'SUBPROCESS';
r++;
}
}
}
}
var routes = new Array();
routes = this.workflow.getCommonConnections(this);
//array task ['idTask','name','pos_X','pos_y']
var oldtasks = [['4043621294c5bda0d9625f4067933182','Task 1','431','131'],['4131425644c5bda073ed062050942935','Task 2','360','274'],['6367816924c6cbc57f36c36034634744','Task 3','540','274']];
//array gateways ['idGateway','type_gateway','pos_X','pos_y']
var oldgateways = [['6934720824c5be48364b533001453464','GatewayExclusiveData','461','228']];
//array gateways ['idEvent','type_event','pos_X','pos_y']
var oldevents = [['2081943344c5bdbb38a7ae9016052622','EventEmptyStart','480','95'],['5585460614c5bdbb8629170012669821','EventEmptyEnd','411','347'],['8565089054c5be1e6efeca5077280809','EventEmptyEnd','590','347']];
//array routes ['id','from','to']
var oldroutes = [['2081943344c5bdbb38a7ae9016052982','2081943344c5bdbb38a7ae9016052622','4043621294c5bda0d9625f4067933182'],['4031913164c5bdbb5329a05024607071','4043621294c5bda0d9625f4067933182','6934720824c5be48364b533001453464'],['8851314534c5a6777ee2c96009360450','6934720824c5be48364b533001453464','4131425644c5bda073ed062050942935'],['6934720824c5be48364b533001453464','6934720824c5be48364b533001453464','6367816924c6cbc57f36c36034634744'],['7298598774c5bd9fa3ed1c8035004509','4131425644c5bda073ed062050942935','5585460614c5bdbb8629170012669821'],['8565089054c5be1e6efeca5077280809','6367816924c6cbc57f36c36034634744','8565089054c5be1e6efeca5077280809']];
var allRoutes = routes
var aTasks = Ext.util.JSON.encode(tasks);
var aGateways = Ext.util.JSON.encode(gateways);
var aEvents = Ext.util.JSON.encode(events);
var aAnnotations = Ext.util.JSON.encode(annotations);
var aRoutes = Ext.util.JSON.encode(routes);
var aSubProcess = Ext.util.JSON.encode(subprocess);
var pro_uid = getUrlVars();
if(typeof pro_uid != 'undefined')
{
Ext.Ajax.request({
url: 'saveProcess.php',
method: 'POST',
success: function(response) {
Ext.Msg.alert ('Done', response.responseText);
},
failure: function(){},
params: {
PRO_UID:pro_uid,
tasks: aTasks,
gateways:aGateways,
events:aEvents,
annotations:aAnnotations,
subprocess:aSubProcess,
routes:aRoutes
}
});
}
else
Ext.Msg.alert ('Process ID Undefined');
}
});

View File

@@ -0,0 +1,461 @@
Ext.onReady ( function() {
var workflow = new MyWorkflow("paintarea");
workflow.setEnableSmoothFigureHandling(true);
workflow.scrollArea.width = 2000;
/* var bpmnObj = new bpmnTask();
workflow.addFigure(bpmnObj,350,150);*/
/* var bpmnObj = new bpmnTask();
workflow.addFigure(bpmnObj,250,150);*/
// Add an simple annotation to the canvas
//
/* var annotation = new Annotation("this is my version of new ProcessMap");
annotation.setDimension(234,30);
workflow.addFigure(annotation,500,75);*/
/*var bpmnObj = new bpmnTask();
workflow.addFigure(bpmnObj,50,50);*/
/**********************************************************************************
*
* Do the Ext (Yahoo UI) Stuff
*
**********************************************************************************/
var west= {
xtype : "panel",
split:true,
initialSize: 200,
width: 100,
minSize: 305,
maxSize: 400,
titlebar: true,
collapsible: true,
autoScroll:true,
animate: true,
region : "west",
items: {
region: 'center',
layout:'accordion',
layoutConfig:{animate:true},
items: [{
title: 'Shapes',
//html:'<p>Text Annotation <br>Task<br>Looping Task<br>Flow Connector<br>Message Connection<br>Association<br>Pool<br>Sub-ProcessMap<br>Looping Sub-Process<br>Lane<br>Group<br>Data Object<br>',
html:'<ul id="x-basicshapes"><li id="x-shapes-text" title="Text Annotation" >&nbsp;</li>\n\
<li id="x-shapes-task" title="Task">&nbsp;</li>\n\
<li id="x-shapes-loop" title="Looping Task">&nbsp;</li>\n\
<li id="x-shapes-flow" title="Flow Connector">&nbsp;</li>\n\
<li id="x-shapes-group" title="Group">&nbsp;</li>\n\
<li id="x-shapes-loopsub" title="Looping Sub-Process">&nbsp;</li>\n\
<li id="x-shapes-assoc" title="Association">&nbsp;</li>\n\
<li id="x-shapes-msgconn" title="Message connection">&nbsp;</li>\n\
<li id="x-shapes-lane" title="Lane">&nbsp;</li>\n\
<li id="x-shapes-dataObject" title="Data Object">&nbsp;</li></ul>',
cls:'empty'
},
{
title: 'Events',
// html: ' Empty Start<br>Message Start<br>Rule Start<br>Timer Start<br>Signal start event<br>Multiple start event<br>Link start<br> Empty Intermediate<br>Message Intermediate<br>Timer Intermediate<br>Error Intermediate<br>Compensation Intermediate<br>Rule Intermediate<br>Cancel Intermediate<br>Intermediate signal event<br>Multiple Intermediate event<br>Link Intermediate event<br>Empty End<br>Message End<br>Error End<br>Compensation End<br>Terminate<br>End signal event<br>Multiple end event<br>Cancel end<br>Link end<br>',
html:'<ul id="x-event-shapes"><li id="x-shapes-event-empty" title="Empty Start" >&nbsp;</li>\n\
<li id="x-shapes-event-msgstart" title="Message Start">&nbsp;</li>\n\
<li id="x-shapes-event-rule" title="Rule Start">&nbsp;</li>\n\
<li id="x-shapes-event-timerstart" title="Timer Start">&nbsp;</li>\n\
<li id="x-shapes-event-sigstart" title="Signal start event">&nbsp;</li>\n\
<li id="x-shapes-event-mulstart" title="Multiple start event">&nbsp;</li>\n\
<li id="x-shapes-event-linkstart" title="Link start">&nbsp;</li>\n\
<li id="x-shapes-event-emptyinter" title="Empty Intermediate">&nbsp;</li>\n\
<li id="x-shapes-event-msgconn" title="Message Intermediate">&nbsp;</li>\n\
<li id="x-shapes-event-timerinter" title="Timer Intermediate">&nbsp;</li>\n\
<li id="x-shapes-event-errorinter" title="Error Intermediate">&nbsp;</li>\n\
<li id="x-shapes-event-compinter" title="Compensation Intermediate">&nbsp;</li>\n\
<li id="x-shapes-event-ruleinter" title="Rule Intermediate">&nbsp;</li>\n\
<li id="x-shapes-event-caninter" title="Cancel Intermediate">&nbsp;</li>\n\
<li id="x-shapes-event-intersig" title="Intermediate signal">&nbsp;</li>\n\
<li id="x-shapes-event-mulinter" title="Multiple Intermediate">&nbsp;</li>\n\
<li id="x-shapes-event-linkinter" title="Link Intermediate">&nbsp;</li>\n\
<li id="x-shapes-event-emptyend" title="Empty End">&nbsp;</li>\n\
<li id="x-shapes-event-messageend" title="Message End">&nbsp;</li>\n\
<li id="x-shapes-event-errorend" title="Error End">&nbsp;</li>\n\
<li id="x-shapes-event-compend" title="Compensation End">&nbsp;</li>\n\
<li id="x-shapes-event-terminate" title="Terminate">&nbsp;</li>\n\
<li id="x-shapes-event-endsignal" title="End signal">&nbsp;</li>\n\
<li id="x-shapes-event-multipleend" title="Multiple end">&nbsp;</li>\n\
<li id="x-shapes-event-cancelend" title="Cancel end">&nbsp;</li>\n\
<li id="x-shapes-event-linkend" title="Link end">&nbsp;</li></ul>',
cls:'empty'
},
{
title: 'Gateway',
//html: 'Exclusive Data-Based<br>Exclusive Event-Based<br>Inclusive Data-Based<br>Parallel<br> Complex<br>',
html:'<ul id="x-gateways-shapes"><li id="x-shapes-gateways-exc-data" title="Exclusive Data-Based" >&nbsp;</li>\n\
<li id="x-shapes-gateways-exc-event" title="Exclusive Event-Based">&nbsp;</li>\n\
<li id="x-shapes-gateways-inc-data" title="Inclusive Data-Based">&nbsp;</li>\n\
<li id="x-shapes-gateways-parallel" title="Parallel">&nbsp;</li>\n\
<li id="x-shapes-gateways-complex" title="Complex">&nbsp;</li></ul>',
cls:'empty'
}]
}
};
var north= {xtype : "panel",
initialSize: 60,
split:false,
titlebar: false,
collapsible: false,
animate: false,
region : "north",
};
var south= {xtype : "panel",
initialSize: 120,
height: 100,
split:true,
titlebar: false,
collapsible: true,
autoScroll:true,
animate: true,
region : "south",
items: {
region: 'center',
xtype: 'tabpanel',
items: [{
title: 'Properties',
html: 'Properties'
},
{
title: 'Debug Console',
html: 'Debug Console'
}]
}
};
var center= {width:100,
height:200,
xtype : "panel",
titlebar: true,
title : "center region" ,
autoScroll:true,
fitToFrame:true,
region : "center"
};
var main = new Ext.Panel({
tbar: [
{text:'Save'},
{text:'Save as'},
{text:'Undo'},
{text:'Redo'}
],
renderTo : "center1",
layout : "border",
height : 1000,
width :1000,
items : [west,north,south,center]
});
var canvas = Ext.get('ext-gen68');
contextCanvasMenu = new Ext.menu.Menu({
items: [{
text: 'Edit Process',
handler: workflow.editProcess,
scope: this
}, {
text: 'Export Process',
handler: workflow.exportProcess,
scope: this
}, {
text: 'Add Task',
handler: workflow.addTask,
scope: this
}, {
text: 'Add Subprocess',
handler: workflow.subProcess,
scope: this
}, {
text: 'Horizontal Line',
handler: workflow.horiLine,
scope: this
}, {
text: 'Vertical Line',
handler: workflow.vertiLine,
scope: this
}, {
text: 'Delete All Lines',
handler: workflow.delLines,
scope: this
}, {
text: 'Process Permission',
handler: workflow.processPermission,
scope: this
}, {
text: 'Web Entry',
handler: workflow.webEntry,
scope: this
}, {
text: 'Case Tracker',
handler: workflow.caseTracker,
scope: this
}, {
text: 'Process File Manager',
handler: workflow.processFileManager,
scope: this
}, {
text: 'Events',
handler: workflow.events,
scope: this
}]
});
canvas.on('contextmenu', function(e) {
e.stopEvent();
this.contextCanvasMenu.showAt(e.getXY());
}, this);
var simpleToolbar = new Ext.Toolbar('toolbar');
simpleToolbar.addButton({ text: 'Save', cls: 'x-btn-text-icon scroll-bottom'});
simpleToolbar.addButton({ text: 'Save As', cls: 'x-btn-text-icon scroll-bottom'});
simpleToolbar.addButton({ text: 'Undo', cls: 'x-btn-text-icon'});
simpleToolbar.addButton({ text: 'Redo', cls: 'x-btn-text-icon'});
var menu = new FlowMenu(workflow);
workflow.addSelectionListener(menu);
workflow.scrollArea = document.getElementById("ext-gen68").parentNode;
var dragsource=new Ext.dd.DragSource("x-shapes-text", {ddGroup:'TreeDD',dragData:{name: "bpmnAnnotation"}});
var dragsource=new Ext.dd.DragSource("x-shapes-task", {ddGroup:'TreeDD',dragData:{name: "bpmnTask"}});
var dragsource=new Ext.dd.DragSource("x-shapes-loop", {ddGroup:'TreeDD',dragData:{name: "bpmnLoopingTask"}});
var dragsource=new Ext.dd.DragSource("x-shapes-flow", {ddGroup:'TreeDD',dragData:{name: "bpmnFlowConnector"}});
var dragsource=new Ext.dd.DragSource("x-shapes-group", {ddGroup:'TreeDD',dragData:{name: "bpmnGroup"}});
var dragsource=new Ext.dd.DragSource("x-shapes-loopsub", {ddGroup:'TreeDD',dragData:{name: "bpmnLoopingSubProcess"}});
var dragsource=new Ext.dd.DragSource("x-shapes-event-empty", {ddGroup:'TreeDD',dragData:{name: "bpmnEventEmptyStart"}});
var dragsource=new Ext.dd.DragSource("x-shapes-event-msgstart", {ddGroup:'TreeDD',dragData:{name: "bpmnEventMessageStart"}});
var dragsource=new Ext.dd.DragSource("x-shapes-event-rule", {ddGroup:'TreeDD',dragData:{name: "bpmnEventRuleStart"}});
var dragsource=new Ext.dd.DragSource("x-shapes-event-timerstart", {ddGroup:'TreeDD',dragData:{name: "bpmnEventTimerStart"}});
var dragsource=new Ext.dd.DragSource("x-shapes-event-sigstart", {ddGroup:'TreeDD',dragData:{name: "bpmnEventSignalStart"}});
var dragsource=new Ext.dd.DragSource("x-shapes-event-mulstart", {ddGroup:'TreeDD',dragData:{name: "bpmnEventMulStart"}});
var dragsource=new Ext.dd.DragSource("x-shapes-event-linkstart", {ddGroup:'TreeDD',dragData:{name: "bpmnEventLinkStart"}});
var dragsource=new Ext.dd.DragSource("x-shapes-event-emptyinter", {ddGroup:'TreeDD',dragData:{name: "bpmnEventEmptyInter"}});
var dragsource=new Ext.dd.DragSource("x-shapes-event-msgconn", {ddGroup:'TreeDD',dragData:{name: "bpmnEventMessageInter"}});
var dragsource=new Ext.dd.DragSource("x-shapes-event-timerinter", {ddGroup:'TreeDD',dragData:{name: "bpmnEventTimerInter"}});
var dragsource=new Ext.dd.DragSource("x-shapes-event-errorinter", {ddGroup:'TreeDD',dragData:{name: "bpmnEventErrorInter"}});
var dragsource=new Ext.dd.DragSource("x-shapes-event-compinter", {ddGroup:'TreeDD',dragData:{name: "bpmnEventCompInter"}});
var dragsource=new Ext.dd.DragSource("x-shapes-event-ruleinter", {ddGroup:'TreeDD',dragData:{name: "bpmnEventRuleInter"}});
var dragsource=new Ext.dd.DragSource("x-shapes-event-caninter", {ddGroup:'TreeDD',dragData:{name: "bpmnEventCancelInter"}});
var dragsource=new Ext.dd.DragSource("x-shapes-event-intersig", {ddGroup:'TreeDD',dragData:{name: "bpmnEventInterSignal"}});
var dragsource=new Ext.dd.DragSource("x-shapes-event-mulinter", {ddGroup:'TreeDD',dragData:{name: "bpmnEventMultipleInter"}});
var dragsource=new Ext.dd.DragSource("x-shapes-event-linkinter", {ddGroup:'TreeDD',dragData:{name: "bpmnEventLinkInter"}});
var dragsource=new Ext.dd.DragSource("x-shapes-event-emptyend", {ddGroup:'TreeDD',dragData:{name: "bpmnEventEmptyEnd"}});
var dragsource=new Ext.dd.DragSource("x-shapes-event-messageend", {ddGroup:'TreeDD',dragData:{name: "bpmnEventMessageEnd"}});
var dragsource=new Ext.dd.DragSource("x-shapes-event-errorend", {ddGroup:'TreeDD',dragData:{name: "bpmnEventErrorEnd"}});
var dragsource=new Ext.dd.DragSource("x-shapes-event-compend", {ddGroup:'TreeDD',dragData:{name: "bpmnEventCompEnd"}});
var dragsource=new Ext.dd.DragSource("x-shapes-event-terminate", {ddGroup:'TreeDD',dragData:{name: "bpmnEventTerminate"}});
var dragsource=new Ext.dd.DragSource("x-shapes-event-endsignal", {ddGroup:'TreeDD',dragData:{name: "bpmnEventEndSignal"}});
var dragsource=new Ext.dd.DragSource("x-shapes-event-multipleend", {ddGroup:'TreeDD',dragData:{name: "bpmnEventMultipleEnd"}});
var dragsource=new Ext.dd.DragSource("x-shapes-event-cancelend", {ddGroup:'TreeDD',dragData:{name: "bpmnEventCancelEnd"}});
var dragsource=new Ext.dd.DragSource("x-shapes-event-linkend", {ddGroup:'TreeDD',dragData:{name: "bpmnEventLinkEnd"}});
var dragsource=new Ext.dd.DragSource("x-shapes-gateways-exc-data", {ddGroup:'TreeDD',dragData:{name: "bpmnExclusiveData"}});
var dragsource=new Ext.dd.DragSource("x-shapes-gateways-exc-event", {ddGroup:'TreeDD',dragData:{name: "bpmnExclusiveEvent"}});
var dragsource=new Ext.dd.DragSource("x-shapes-gateways-inc-data", {ddGroup:'TreeDD',dragData:{name: "bpmnInclusiveData"}});
var dragsource=new Ext.dd.DragSource("x-shapes-gateways-parallel", {ddGroup:'TreeDD',dragData:{name: "bpmnEventParallel"}});
var dragsource=new Ext.dd.DragSource("x-shapes-gateways-complex", {ddGroup:'TreeDD',dragData:{name: "bpmnEventComplex"}});
var droptarget=new Ext.dd.DropTarget("ext-gen68",{ddGroup:'TreeDD'});
workflow.taskNo= 0; //Initializing Count for the bpmnTask
var count = 0;
this.taskName='';
droptarget.notifyDrop=function(dd, e, data)
{
if(data.name)
{
if(data.name == 'bpmnTask')
{
count = ++workflow.taskNo; //Incrementing Task No and assigning it to a local variable
}
var xOffset = workflow.getAbsoluteX();
var yOffset = workflow.getAbsoluteY();
var scrollLeft = workflow.getScrollLeft();
var scrollTop = workflow.getScrollTop();
workflow.addFigure(eval("new "+data.name+"("+count+")"),e.xy[0]-xOffset+scrollLeft,e.xy[1]-yOffset+scrollTop);
return true;
}
}
});
/*
End=function(){
ImageFigure.call(this,this.type+".png");
this.inputPort=null;
this.setDimension(50,50);
};
End.prototype=new ImageFigure;
End.prototype.type="End";
End.prototype.setWorkflow=function(_4087){
ImageFigure.prototype.setWorkflow.call(this,_4087);
if(_4087!=null&&this.inputPort==null){
this.inputPort=new MyInputPort();
this.inputPort.setWorkflow(_4087);
this.inputPort.setBackgroundColor(new Color(115,115,245));
this.inputPort.setColor(null);
this.addPort(this.inputPort,0,this.height/2);
this.inputPort2=new MyInputPort();
this.inputPort2.setWorkflow(_4087);
this.inputPort2.setBackgroundColor(new Color(115,115,245));
this.inputPort2.setColor(null);
this.addPort(this.inputPort2,this.width/2,0);
this.inputPort3=new MyInputPort();
this.inputPort3.setWorkflow(_4087);
this.inputPort3.setBackgroundColor(new Color(115,115,245));
this.inputPort3.setColor(null);
this.addPort(this.inputPort3,this.width,this.height/2);
this.inputPort4=new MyInputPort();
this.inputPort4.setWorkflow(_4087);
this.inputPort4.setBackgroundColor(new Color(115,115,245));
this.inputPort4.setColor(null);
this.addPort(this.inputPort4,this.width/2,this.height);
}
};*/
/*
MyOutputPort=function(_32c8){
OutputPort.call(this,_32c8);
};
MyOutputPort.prototype=new OutputPort;
MyOutputPort.prototype.type="MyOutputPort";
MyOutputPort.prototype.onDrop=function(port){
if(this.getMaxFanOut()<=this.getFanOut()){
return;
}
if(this.parentNode.id==port.parentNode.id){
}else{
var _32ca=new CommandConnect(this.parentNode.workflow,this,port);
_32ca.setConnection(new ContextmenuConnection());
this.parentNode.workflow.getCommandStack().execute(_32ca);
}
};
MyInputPort=function(_3e4f){
InputPort.call(this,_3e4f);
};
MyInputPort.prototype=new InputPort;
MyInputPort.prototype.type="MyInputPort";
MyInputPort.prototype.onDrop=function(port){
if(port.getMaxFanOut&&port.getMaxFanOut()<=port.getFanOut()){
return;
}
if(this.parentNode.id==port.parentNode.id){
}else{
var _3e51=new CommandConnect(this.parentNode.workflow,port,this);
_3e51.setConnection(new ContextmenuConnection());
this.parentNode.workflow.getCommandStack().execute(_3e51);
}
};
*/
/*
ResizeImage=function(url){
this.url=url;
Node.call(this);
this.outputPort1=null;
this.outputPort2=null;
this.setDimension(100,100);
this.setColor(null);
};
ResizeImage.prototype=new Node;
ResizeImage.prototype.type="ResizeImage";
ResizeImage.prototype.createHTMLElement=function(){
var item=Node.prototype.createHTMLElement.call(this);
if(navigator.appName.toUpperCase()=="MICROSOFT INTERNET EXPLORER"){
this.d=document.createElement("div");
this.d.style.position="absolute";
this.d.style.left="0px";
this.d.style.top="0px";
this.d.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader (src='"+this.url+"', sizingMethod='scale')";
item.appendChild(this.d);
}else{
this.img=document.createElement("img");
this.img.style.position="absolute";
this.img.style.left="0px";
this.img.style.top="0px";
this.img.src=this.url;
item.appendChild(this.img);
this.d=document.createElement("div");
this.d.style.position="absolute";
this.d.style.left="0px";
this.d.style.top="0px";
item.appendChild(this.d);
}
item.style.left=this.x+"px";
item.style.top=this.y+"px";
return item;
};
ResizeImage.prototype.setDimension=function(w,h){
Node.prototype.setDimension.call(this,w,h);
if(this.d!=null){
this.d.style.width=this.width+"px";
this.d.style.height=this.height+"px";
}
if(this.img!=null){
this.img.width=this.width;
this.img.height=this.height;
}
if(this.outputPort1!=null){
this.outputPort1.setPosition(this.width+3,this.height/3);
this.outputPort2.setPosition(this.width+3,this.height/3*2);
}
};
ResizeImage.prototype.setWorkflow=function(_309d){
Node.prototype.setWorkflow.call(this,_309d);
if(_309d!=null){
this.outputPort1=new OutputPort();
this.outputPort1.setMaxFanOut(1);
this.outputPort1.setWorkflow(_309d);
this.outputPort1.setBackgroundColor(new Color(245,115,115));
this.addPort(this.outputPort1,this.width+3,this.height/3);
this.outputPort2=new OutputPort();
this.outputPort2.setMaxFanOut(1);
this.outputPort2.setWorkflow(_309d);
this.outputPort2.setBackgroundColor(new Color(245,115,115));
this.addPort(this.outputPort2,this.width+3,this.height/3*2);
}
};
*/
ContextmenuConnection=function(){
Connection.call(this);
this.sourcePort=null;
this.targetPort=null;
this.lineSegments=new Array();
this.setColor(new Color(128,128,255));
this.setLineWidth(1);
};
ContextmenuConnection.prototype=new Connection();
ContextmenuConnection.prototype.getContextMenu=function(){
var menu=new Menu();
var oThis=this;
menu.appendMenuItem(new MenuItem("NULL Router",null,function(){
oThis.setRouter(null);
}));
menu.appendMenuItem(new MenuItem("Manhatten Router",null,function(){
oThis.setRouter(new ManhattanConnectionRouter());
}));
menu.appendMenuItem(new MenuItem("Bezier Router",null,function(){
oThis.setRouter(new BezierConnectionRouter());
}));
menu.appendMenuItem(new MenuItem("Fan Router",null,function(){
oThis.setRouter(new FanConnectionRouter());
}));
return menu;
};
function debug(msg)
{
var console = document.getElementById("debug");
console.innerHTML=console.innerHTML+"<br>"+msg;
}

View File

@@ -0,0 +1,304 @@
Ext.onReady(function () {
/**********************************************************************************
*
* Do the Ext (Yahoo UI) Stuff
*
**********************************************************************************/
var west = {
xtype: "panel",
title: 'Palette',
region: 'west',
split: true,
width: 75,
collapsible: true,
margins: '3 0 3 3',
cmargins: '3 3 3 3',
items: {
html: '<ul id="x-shapes"><li id="x-shapes-task" title="Task" >&nbsp;</li>\n\
<li id="x-shapes-startEvent" title="Start">&nbsp;</li>\n\
<li id="x-shapes-interEvent" title="Intermediate Event">&nbsp;</li>\n\
<li id="x-shapes-endEvent" title="End Event">&nbsp;</li>\n\
<li id="x-shapes-gateways" title="Gateway">&nbsp;</li></ul>'
}
};
var north = {
xtype: "panel",
initialSize: 60,
split: false,
titlebar: false,
collapsible: false,
animate: false,
region: "north"
};
var south = {
xtype: "panel",
initialSize: 120,
height: 100,
split: true,
titlebar: false,
collapsible: true,
autoScroll: true,
animate: true,
region: "south",
items: {
region: 'center',
xtype: 'tabpanel',
items: [{
title: 'Properties',
html: 'Properties'
},
{
title: 'Debug Console',
html: 'Debug Console'
}]
}
};
var center = {
width: 100,
height: 200,
xtype: "panel",
titlebar: true,
title: "center region",
autoScroll: true,
fitToFrame: true,
region: "center"
};
main = function () {
var layout;
return {
init: function () {
layout = new Ext.Panel({
tbar: [{
text: 'Save'
},
{
text: 'Save as'
},
{
text: 'Undo'
},
{
text: 'Redo'
}
],
renderTo: "center1",
layout: "border",
height: 1000,
width: 1000,
scope: menu,
items: [west, north, south, center]
});
workflow = new MyWorkflow("paintarea");
workflow.setEnableSmoothFigureHandling(true);
workflow.scrollArea.width = 2000;
var simpleToolbar = new Ext.Toolbar('toolbar');
simpleToolbar.addButton({
text: 'Save',
cls: 'x-btn-text-icon scroll-bottom'
});
simpleToolbar.addButton({
text: 'Save As',
cls: 'x-btn-text-icon scroll-bottom'
});
simpleToolbar.addButton({
text: 'Undo',
cls: 'x-btn-text-icon'
});
simpleToolbar.addButton({
text: 'Redo',
cls: 'x-btn-text-icon'
});
var dragsource = new Ext.dd.DragSource("x-shapes-task", {
ddGroup: 'TreeDD',
dragData: {
name: "bpmnTask"
}
});
var dragsource = new Ext.dd.DragSource("x-shapes-startEvent", {
ddGroup: 'TreeDD',
dragData: {
name: "bpmnEventEmptyStart"
}
});
var dragsource = new Ext.dd.DragSource("x-shapes-interEvent", {
ddGroup: 'TreeDD',
dragData: {
name: "bpmnEventEmptyInter"
}
});
var dragsource = new Ext.dd.DragSource("x-shapes-endEvent", {
ddGroup: 'TreeDD',
dragData: {
name: "bpmnEventEndSignal"
}
});
var dragsource = new Ext.dd.DragSource("x-shapes-gateways", {
ddGroup: 'TreeDD',
dragData: {
name: "bpmnGatewayExclusiveData"
}
});
var droptarget = new Ext.dd.DropTarget("ext-gen51", {
ddGroup: 'TreeDD'
});
workflow.taskNo = 0; //Initializing Count for the bpmnTask
var count = 0;
this.taskName = '';
droptarget.notifyDrop = function (dd, e, data) {
if (data.name) {
if (data.name == 'bpmnTask') {
count = ++workflow.taskNo; //Incrementing Task No and assigning it to a local variable
}
var xOffset = workflow.getAbsoluteX();
var yOffset = workflow.getAbsoluteY();
var scrollLeft = workflow.getScrollLeft();
var scrollTop = workflow.getScrollTop();
workflow.addFigure(eval("new " + data.name + "(workflow)"), e.xy[0] - xOffset + scrollLeft, e.xy[1] - yOffset + scrollTop);
return true;
}
}
}
}
}();
Ext.EventManager.onDocumentReady(main.init, main, true);
var menu = new FlowMenu(workflow);
workflow.addSelectionListener(menu);
workflow.flow = menu;
canvas = Ext.get('ext-gen51');
contextCanvasMenu = new Ext.menu.Menu({
items: [{
text: 'Edit Process',
handler: workflow.editProcess,
icon: '/skins/ext/images/gray/shapes/more.gif',
scope: this
},
{
text: 'Export Process',
handler: workflow.exportProcess,
scope: this
},
{
text: 'Add Task',
handler: workflow.addTask,
scope: this
},
{
text: 'Add Subprocess',
handler: workflow.subProcess,
scope: this
},
{
text: 'Horizontal Line',
handler: workflow.horiLine,
scope: this
},
{
text: 'Vertical Line',
handler: workflow.vertiLine,
scope: this
},
{
text: 'Delete All Lines',
handler: workflow.delLines,
scope: this
},
{
text: 'Process Permission',
handler: workflow.processPermission,
scope: this
},
{
text: 'Web Entry',
handler: workflow.webEntry,
scope: this
},
{
text: 'Case Tracker',
handler: workflow.caseTracker,
scope: this
},
{
text: 'Process File Manager',
handler: workflow.processFileManager,
scope: this
},
{
text: 'Events',
handler: workflow.events,
scope: this
}]
});
canvas.on('contextmenu', function (e) {
e.stopEvent();
this.contextCanvasMenu.showAt(e.getXY());
}, this);
canvas.on('click', function (e) {
e.stopEvent();
if (this.workflow.flow != null) {
/*this.currentFigure = this.workflow.currentSelection;
this.workflow.flow.myworkflow.removeFigure(this.workflow.flow);
this.added=false;
// this.currentFigure.detachMoveListener(this.workflow.flow);*/
}
}, this);
});
ContextmenuConnection = function () {
Connection.call(this);
this.sourcePort = null;
this.targetPort = null;
this.lineSegments = new Array();
this.setColor(new Color(128, 128, 255));
this.setLineWidth(1);
};
ContextmenuConnection.prototype = new Connection();
ContextmenuConnection.prototype.getContextMenu = function () {
var menu = new Menu();
var oThis = this;
menu.appendMenuItem(new MenuItem("NULL Router", null, function () {
oThis.setRouter(null);
}));
menu.appendMenuItem(new MenuItem("Manhatten Router", null, function () {
oThis.setRouter(new ManhattanConnectionRouter());
}));
menu.appendMenuItem(new MenuItem("Bezier Router", null, function () {
oThis.setRouter(new BezierConnectionRouter());
}));
menu.appendMenuItem(new MenuItem("Fan Router", null, function () {
oThis.setRouter(new FanConnectionRouter());
}));
return menu;
};
function debug(msg) {
var console = document.getElementById("debug");
console.innerHTML = console.innerHTML + "<br>" + msg;
}

View File

@@ -0,0 +1,982 @@
/**
* SWFUpload: http://www.swfupload.org, http://swfupload.googlecode.com
*
* mmSWFUpload 1.0: Flash upload dialog - http://profandesign.se/swfupload/, http://www.vinterwebb.se/
*
* SWFUpload is (c) 2006-2007 Lars Huring, Olov Nilz<6C>n and Mammon Media and is released under the MIT License:
* http://www.opensource.org/licenses/mit-license.php
*
* SWFUpload 2 is (c) 2007-2008 Jake Roberts and is released under the MIT License:
* http://www.opensource.org/licenses/mit-license.php
*
*/
/* ******************* */
/* Constructor & Init */
/* ******************* */
var SWFUpload;
if (SWFUpload == undefined) {
SWFUpload = function (settings) {
this.initSWFUpload(settings);
};
}
SWFUpload.prototype.initSWFUpload = function (settings) {
try {
this.customSettings = {}; // A container where developers can place their own settings associated with this instance.
this.settings = settings;
this.eventQueue = [];
this.movieName = "SWFUpload_" + SWFUpload.movieCount++;
this.movieElement = null;
// Setup global control tracking
SWFUpload.instances[this.movieName] = this;
// Load the settings. Load the Flash movie.
this.initSettings();
this.loadFlash();
this.displayDebugInfo();
} catch (ex) {
// console.log('Exception!!');
delete SWFUpload.instances[this.movieName];
throw ex;
}
};
/* *************** */
/* Static Members */
/* *************** */
SWFUpload.instances = {};
SWFUpload.movieCount = 0;
SWFUpload.version = "2.2.0 2009-03-25";
SWFUpload.QUEUE_ERROR = {
QUEUE_LIMIT_EXCEEDED : -100,
FILE_EXCEEDS_SIZE_LIMIT : -110,
ZERO_BYTE_FILE : -120,
INVALID_FILETYPE : -130
};
SWFUpload.UPLOAD_ERROR = {
HTTP_ERROR : -200,
MISSING_UPLOAD_URL : -210,
IO_ERROR : -220,
SECURITY_ERROR : -230,
UPLOAD_LIMIT_EXCEEDED : -240,
UPLOAD_FAILED : -250,
SPECIFIED_FILE_ID_NOT_FOUND : -260,
FILE_VALIDATION_FAILED : -270,
FILE_CANCELLED : -280,
UPLOAD_STOPPED : -290
};
SWFUpload.FILE_STATUS = {
QUEUED : -1,
IN_PROGRESS : -2,
ERROR : -3,
COMPLETE : -4,
CANCELLED : -5
};
SWFUpload.BUTTON_ACTION = {
SELECT_FILE : -100,
SELECT_FILES : -110,
START_UPLOAD : -120
};
SWFUpload.CURSOR = {
ARROW : -1,
HAND : -2
};
SWFUpload.WINDOW_MODE = {
WINDOW : "window",
TRANSPARENT : "transparent",
OPAQUE : "opaque"
};
// Private: takes a URL, determines if it is relative and converts to an absolute URL
// using the current site. Only processes the URL if it can, otherwise returns the URL untouched
SWFUpload.completeURL = function(url) {
if (typeof(url) !== "string" || url.match(/^https?:\/\//i) || url.match(/^\//)) {
return url;
}
var currentURL = window.location.protocol + "//" + window.location.hostname + (window.location.port ? ":" + window.location.port : "");
var indexSlash = window.location.pathname.lastIndexOf("/");
if (indexSlash <= 0) {
path = "/";
} else {
path = window.location.pathname.substr(0, indexSlash) + "/";
}
return /*currentURL +*/ path + url;
};
/* ******************** */
/* Instance Members */
/* ******************** */
// Private: initSettings ensures that all the
// settings are set, getting a default value if one was not assigned.
SWFUpload.prototype.initSettings = function () {
this.ensureDefault = function (settingName, defaultValue) {
this.settings[settingName] = (this.settings[settingName] == undefined) ? defaultValue : this.settings[settingName];
};
// Upload backend settings
this.ensureDefault("upload_url", "");
this.ensureDefault("preserve_relative_urls", false);
this.ensureDefault("file_post_name", "Filedata");
this.ensureDefault("post_params", {});
this.ensureDefault("use_query_string", false);
this.ensureDefault("requeue_on_error", false);
this.ensureDefault("http_success", []);
this.ensureDefault("assume_success_timeout", 0);
// File Settings
this.ensureDefault("file_types", "*.*");
this.ensureDefault("file_types_description", "All Files");
this.ensureDefault("file_size_limit", 0); // Default zero means "unlimited"
this.ensureDefault("file_upload_limit", 0);
this.ensureDefault("file_queue_limit", 0);
// Flash Settings
this.ensureDefault("flash_url", "swfupload.swf");
this.ensureDefault("prevent_swf_caching", true);
// Button Settings
this.ensureDefault("button_image_url", "");
this.ensureDefault("button_width", 1);
this.ensureDefault("button_height", 1);
this.ensureDefault("button_text", "");
this.ensureDefault("button_text_style", "color: #000000; font-size: 16pt;");
this.ensureDefault("button_text_top_padding", 0);
this.ensureDefault("button_text_left_padding", 0);
this.ensureDefault("button_action", SWFUpload.BUTTON_ACTION.SELECT_FILES);
this.ensureDefault("button_disabled", false);
this.ensureDefault("button_placeholder_id", "");
this.ensureDefault("button_placeholder", null);
this.ensureDefault("button_cursor", SWFUpload.CURSOR.ARROW);
this.ensureDefault("button_window_mode", SWFUpload.WINDOW_MODE.WINDOW);
// Debug Settings
this.ensureDefault("debug", false);
this.settings.debug_enabled = this.settings.debug; // Here to maintain v2 API
// Event Handlers
this.settings.return_upload_start_handler = this.returnUploadStart;
this.ensureDefault("swfupload_loaded_handler", null);
this.ensureDefault("file_dialog_start_handler", null);
this.ensureDefault("file_queued_handler", null);
this.ensureDefault("file_queue_error_handler", null);
this.ensureDefault("file_dialog_complete_handler", null);
this.ensureDefault("upload_start_handler", null);
this.ensureDefault("upload_progress_handler", null);
this.ensureDefault("upload_error_handler", null);
this.ensureDefault("upload_success_handler", null);
this.ensureDefault("upload_complete_handler", null);
this.ensureDefault("debug_handler", this.debugMessage);
this.ensureDefault("custom_settings", {});
// Other settings
this.customSettings = this.settings.custom_settings;
// Update the flash url if needed
if (!!this.settings.prevent_swf_caching) {
this.settings.flash_url = this.settings.flash_url + (this.settings.flash_url.indexOf("?") < 0 ? "?" : "&") + "preventswfcaching=" + new Date().getTime();
}
if (!this.settings.preserve_relative_urls) {
//this.settings.flash_url = SWFUpload.completeURL(this.settings.flash_url); // Don't need to do this one since flash doesn't look at it
this.settings.upload_url = SWFUpload.completeURL(this.settings.upload_url);
this.settings.button_image_url = SWFUpload.completeURL(this.settings.button_image_url);
}
delete this.ensureDefault;
};
// Private: loadFlash replaces the button_placeholder element with the flash movie.
SWFUpload.prototype.loadFlash = function () {
var targetElement, tempParent;
// Make sure an element with the ID we are going to use doesn't already exist
if (document.getElementById(this.movieName) !== null) {
throw "ID " + this.movieName + " is already in use. The Flash Object could not be added";
}
// Get the element where we will be placing the flash movie
targetElement = document.getElementById(this.settings.button_placeholder_id) || this.settings.button_placeholder;
if (targetElement == undefined) {
throw "Could not find the placeholder element: " + this.settings.button_placeholder_id;
}
// Append the container and load the flash
tempParent = document.createElement("div");
// console.log('Adding flash HTML');
tempParent.innerHTML = this.getFlashHTML(); // Using innerHTML is non-standard but the only sensible way to dynamically add Flash in IE (and maybe other browsers)
targetElement.parentNode.replaceChild(tempParent.firstChild, targetElement);
// Fix IE Flash/Form bug
if (window[this.movieName] == undefined) {
window[this.movieName] = this.getMovieElement();
}
};
// Private: getFlashHTML generates the object tag needed to embed the flash in to the document
SWFUpload.prototype.getFlashHTML = function () {
// Flash Satay object syntax: http://www.alistapart.com/articles/flashsatay
return ['<object id="', this.movieName, '" type="application/x-shockwave-flash" data="', this.settings.flash_url, '" width="', this.settings.button_width, '" height="', this.settings.button_height, '" class="swfupload">',
'<param name="wmode" value="', this.settings.button_window_mode, '" />',
'<param name="movie" value="', this.settings.flash_url, '" />',
'<param name="quality" value="high" />',
'<param name="menu" value="false" />',
'<param name="allowScriptAccess" value="always" />',
'<param name="flashvars" value="' + this.getFlashVars() + '" />',
'</object>'].join("");
};
// Private: getFlashVars builds the parameter string that will be passed
// to flash in the flashvars param.
SWFUpload.prototype.getFlashVars = function () {
// Build a string from the post param object
var paramString = this.buildParamString();
var httpSuccessString = this.settings.http_success.join(",");
// Build the parameter string
return ["movieName=", encodeURIComponent(this.movieName),
"&amp;uploadURL=", encodeURIComponent(this.settings.upload_url),
"&amp;useQueryString=", encodeURIComponent(this.settings.use_query_string),
"&amp;requeueOnError=", encodeURIComponent(this.settings.requeue_on_error),
"&amp;httpSuccess=", encodeURIComponent(httpSuccessString),
"&amp;assumeSuccessTimeout=", encodeURIComponent(this.settings.assume_success_timeout),
"&amp;params=", encodeURIComponent(paramString),
"&amp;filePostName=", encodeURIComponent(this.settings.file_post_name),
"&amp;fileTypes=", encodeURIComponent(this.settings.file_types),
"&amp;fileTypesDescription=", encodeURIComponent(this.settings.file_types_description),
"&amp;fileSizeLimit=", encodeURIComponent(this.settings.file_size_limit),
"&amp;fileUploadLimit=", encodeURIComponent(this.settings.file_upload_limit),
"&amp;fileQueueLimit=", encodeURIComponent(this.settings.file_queue_limit),
"&amp;debugEnabled=", encodeURIComponent(this.settings.debug_enabled),
"&amp;buttonImageURL=", encodeURIComponent(this.settings.button_image_url),
"&amp;buttonWidth=", encodeURIComponent(this.settings.button_width),
"&amp;buttonHeight=", encodeURIComponent(this.settings.button_height),
"&amp;buttonText=", encodeURIComponent(this.settings.button_text),
"&amp;buttonTextTopPadding=", encodeURIComponent(this.settings.button_text_top_padding),
"&amp;buttonTextLeftPadding=", encodeURIComponent(this.settings.button_text_left_padding),
"&amp;buttonTextStyle=", encodeURIComponent(this.settings.button_text_style),
"&amp;buttonAction=", encodeURIComponent(this.settings.button_action),
"&amp;buttonDisabled=", encodeURIComponent(this.settings.button_disabled),
"&amp;buttonCursor=", encodeURIComponent(this.settings.button_cursor)
].join("");
};
// Public: getMovieElement retrieves the DOM reference to the Flash element added by SWFUpload
// The element is cached after the first lookup
SWFUpload.prototype.getMovieElement = function () {
if (this.movieElement == undefined) {
this.movieElement = document.getElementById(this.movieName);
}
if (this.movieElement === null) {
throw "Could not find Flash element";
}
return this.movieElement;
};
// Private: buildParamString takes the name/value pairs in the post_params setting object
// and joins them up in to a string formatted "name=value&amp;name=value"
SWFUpload.prototype.buildParamString = function () {
var postParams = this.settings.post_params;
var paramStringPairs = [];
if (typeof(postParams) === "object") {
for (var name in postParams) {
if (postParams.hasOwnProperty(name)) {
paramStringPairs.push(encodeURIComponent(name.toString()) + "=" + encodeURIComponent(postParams[name].toString()));
}
}
}
return paramStringPairs.join("&amp;");
};
// Public: Used to remove a SWFUpload instance from the page. This method strives to remove
// all references to the SWF, and other objects so memory is properly freed.
// Returns true if everything was destroyed. Returns a false if a failure occurs leaving SWFUpload in an inconsistant state.
// Credits: Major improvements provided by steffen
SWFUpload.prototype.destroy = function () {
try {
// Make sure Flash is done before we try to remove it
this.cancelUpload(null, false);
// Remove the SWFUpload DOM nodes
var movieElement = null;
movieElement = this.getMovieElement();
if (movieElement && typeof(movieElement.CallFunction) === "unknown") { // We only want to do this in IE
// Loop through all the movie's properties and remove all function references (DOM/JS IE 6/7 memory leak workaround)
for (var i in movieElement) {
try {
if (typeof(movieElement[i]) === "function") {
movieElement[i] = null;
}
} catch (ex1) {}
}
// Remove the Movie Element from the page
try {
movieElement.parentNode.removeChild(movieElement);
} catch (ex) {}
}
// Remove IE form fix reference
window[this.movieName] = null;
// Destroy other references
SWFUpload.instances[this.movieName] = null;
delete SWFUpload.instances[this.movieName];
this.movieElement = null;
this.settings = null;
this.customSettings = null;
this.eventQueue = null;
this.movieName = null;
return true;
} catch (ex2) {
return false;
}
};
// Public: displayDebugInfo prints out settings and configuration
// information about this SWFUpload instance.
// This function (and any references to it) can be deleted when placing
// SWFUpload in production.
SWFUpload.prototype.displayDebugInfo = function () {
this.debug(
[
"---SWFUpload Instance Info---\n",
"Version: ", SWFUpload.version, "\n",
"Movie Name: ", this.movieName, "\n",
"Settings:\n",
"\t", "upload_url: ", this.settings.upload_url, "\n",
"\t", "flash_url: ", this.settings.flash_url, "\n",
"\t", "use_query_string: ", this.settings.use_query_string.toString(), "\n",
"\t", "requeue_on_error: ", this.settings.requeue_on_error.toString(), "\n",
"\t", "http_success: ", this.settings.http_success.join(", "), "\n",
"\t", "assume_success_timeout: ", this.settings.assume_success_timeout, "\n",
"\t", "file_post_name: ", this.settings.file_post_name, "\n",
"\t", "post_params: ", this.settings.post_params.toString(), "\n",
"\t", "file_types: ", this.settings.file_types, "\n",
"\t", "file_types_description: ", this.settings.file_types_description, "\n",
"\t", "file_size_limit: ", this.settings.file_size_limit, "\n",
"\t", "file_upload_limit: ", this.settings.file_upload_limit, "\n",
"\t", "file_queue_limit: ", this.settings.file_queue_limit, "\n",
"\t", "debug: ", this.settings.debug.toString(), "\n",
"\t", "prevent_swf_caching: ", this.settings.prevent_swf_caching.toString(), "\n",
"\t", "button_placeholder_id: ", this.settings.button_placeholder_id.toString(), "\n",
"\t", "button_placeholder: ", (this.settings.button_placeholder ? "Set" : "Not Set"), "\n",
"\t", "button_image_url: ", this.settings.button_image_url.toString(), "\n",
"\t", "button_width: ", this.settings.button_width.toString(), "\n",
"\t", "button_height: ", this.settings.button_height.toString(), "\n",
"\t", "button_text: ", this.settings.button_text.toString(), "\n",
"\t", "button_text_style: ", this.settings.button_text_style.toString(), "\n",
"\t", "button_text_top_padding: ", this.settings.button_text_top_padding.toString(), "\n",
"\t", "button_text_left_padding: ", this.settings.button_text_left_padding.toString(), "\n",
"\t", "button_action: ", this.settings.button_action.toString(), "\n",
"\t", "button_disabled: ", this.settings.button_disabled.toString(), "\n",
"\t", "custom_settings: ", this.settings.custom_settings.toString(), "\n",
"Event Handlers:\n",
"\t", "swfupload_loaded_handler assigned: ", (typeof this.settings.swfupload_loaded_handler === "function").toString(), "\n",
"\t", "file_dialog_start_handler assigned: ", (typeof this.settings.file_dialog_start_handler === "function").toString(), "\n",
"\t", "file_queued_handler assigned: ", (typeof this.settings.file_queued_handler === "function").toString(), "\n",
"\t", "file_queue_error_handler assigned: ", (typeof this.settings.file_queue_error_handler === "function").toString(), "\n",
"\t", "upload_start_handler assigned: ", (typeof this.settings.upload_start_handler === "function").toString(), "\n",
"\t", "upload_progress_handler assigned: ", (typeof this.settings.upload_progress_handler === "function").toString(), "\n",
"\t", "upload_error_handler assigned: ", (typeof this.settings.upload_error_handler === "function").toString(), "\n",
"\t", "upload_success_handler assigned: ", (typeof this.settings.upload_success_handler === "function").toString(), "\n",
"\t", "upload_complete_handler assigned: ", (typeof this.settings.upload_complete_handler === "function").toString(), "\n",
"\t", "debug_handler assigned: ", (typeof this.settings.debug_handler === "function").toString(), "\n"
].join("")
);
};
/* Note: addSetting and getSetting are no longer used by SWFUpload but are included
the maintain v2 API compatibility
*/
// Public: (Deprecated) addSetting adds a setting value. If the value given is undefined or null then the default_value is used.
SWFUpload.prototype.addSetting = function (name, value, default_value) {
if (value == undefined) {
return (this.settings[name] = default_value);
} else {
return (this.settings[name] = value);
}
};
// Public: (Deprecated) getSetting gets a setting. Returns an empty string if the setting was not found.
SWFUpload.prototype.getSetting = function (name) {
if (this.settings[name] != undefined) {
return this.settings[name];
}
return "";
};
// Private: callFlash handles function calls made to the Flash element.
// Calls are made with a setTimeout for some functions to work around
// bugs in the ExternalInterface library.
SWFUpload.prototype.callFlash = function (functionName, argumentArray) {
argumentArray = argumentArray || [];
var movieElement = this.getMovieElement();
var returnValue, returnString;
// Flash's method if calling ExternalInterface methods (code adapted from MooTools).
try {
returnString = movieElement.CallFunction('<invoke name="' + functionName + '" returntype="javascript">' + __flash__argumentsToXML(argumentArray, 0) + '</invoke>');
returnValue = eval(returnString);
} catch (ex) {
throw "Call to " + functionName + " failed";
}
// Unescape file post param values
if (returnValue != undefined && typeof returnValue.post === "object") {
returnValue = this.unescapeFilePostParams(returnValue);
}
return returnValue;
};
/* *****************************
-- Flash control methods --
Your UI should use these
to operate SWFUpload
***************************** */
// WARNING: this function does not work in Flash Player 10
// Public: selectFile causes a File Selection Dialog window to appear. This
// dialog only allows 1 file to be selected.
SWFUpload.prototype.selectFile = function () {
this.callFlash("SelectFile");
};
// WARNING: this function does not work in Flash Player 10
// Public: selectFiles causes a File Selection Dialog window to appear/ This
// dialog allows the user to select any number of files
// Flash Bug Warning: Flash limits the number of selectable files based on the combined length of the file names.
// If the selection name length is too long the dialog will fail in an unpredictable manner. There is no work-around
// for this bug.
SWFUpload.prototype.selectFiles = function () {
this.callFlash("SelectFiles");
};
// Public: startUpload starts uploading the first file in the queue unless
// the optional parameter 'fileID' specifies the ID
SWFUpload.prototype.startUpload = function (fileID) {
this.callFlash("StartUpload", [fileID]);
};
// Public: cancelUpload cancels any queued file. The fileID parameter may be the file ID or index.
// If you do not specify a fileID the current uploading file or first file in the queue is cancelled.
// If you do not want the uploadError event to trigger you can specify false for the triggerErrorEvent parameter.
SWFUpload.prototype.cancelUpload = function (fileID, triggerErrorEvent) {
if (triggerErrorEvent !== false) {
triggerErrorEvent = true;
}
this.callFlash("CancelUpload", [fileID, triggerErrorEvent]);
};
// Public: stopUpload stops the current upload and requeues the file at the beginning of the queue.
// If nothing is currently uploading then nothing happens.
SWFUpload.prototype.stopUpload = function () {
this.callFlash("StopUpload");
};
/* ************************
* Settings methods
* These methods change the SWFUpload settings.
* SWFUpload settings should not be changed directly on the settings object
* since many of the settings need to be passed to Flash in order to take
* effect.
* *********************** */
// Public: getStats gets the file statistics object.
SWFUpload.prototype.getStats = function () {
return this.callFlash("GetStats");
};
// Public: setStats changes the SWFUpload statistics. You shouldn't need to
// change the statistics but you can. Changing the statistics does not
// affect SWFUpload accept for the successful_uploads count which is used
// by the upload_limit setting to determine how many files the user may upload.
SWFUpload.prototype.setStats = function (statsObject) {
this.callFlash("SetStats", [statsObject]);
};
// Public: getFile retrieves a File object by ID or Index. If the file is
// not found then 'null' is returned.
SWFUpload.prototype.getFile = function (fileID) {
if (typeof(fileID) === "number") {
return this.callFlash("GetFileByIndex", [fileID]);
} else {
return this.callFlash("GetFile", [fileID]);
}
};
// Public: addFileParam sets a name/value pair that will be posted with the
// file specified by the Files ID. If the name already exists then the
// exiting value will be overwritten.
SWFUpload.prototype.addFileParam = function (fileID, name, value) {
return this.callFlash("AddFileParam", [fileID, name, value]);
};
// Public: removeFileParam removes a previously set (by addFileParam) name/value
// pair from the specified file.
SWFUpload.prototype.removeFileParam = function (fileID, name) {
this.callFlash("RemoveFileParam", [fileID, name]);
};
// Public: setUploadUrl changes the upload_url setting.
SWFUpload.prototype.setUploadURL = function (url) {
this.settings.upload_url = url.toString();
this.callFlash("SetUploadURL", [url]);
};
// Public: setPostParams changes the post_params setting
SWFUpload.prototype.setPostParams = function (paramsObject) {
this.settings.post_params = paramsObject;
this.callFlash("SetPostParams", [paramsObject]);
};
// Public: addPostParam adds post name/value pair. Each name can have only one value.
SWFUpload.prototype.addPostParam = function (name, value) {
this.settings.post_params[name] = value;
this.callFlash("SetPostParams", [this.settings.post_params]);
};
// Public: removePostParam deletes post name/value pair.
SWFUpload.prototype.removePostParam = function (name) {
delete this.settings.post_params[name];
this.callFlash("SetPostParams", [this.settings.post_params]);
};
// Public: setFileTypes changes the file_types setting and the file_types_description setting
SWFUpload.prototype.setFileTypes = function (types, description) {
this.settings.file_types = types;
this.settings.file_types_description = description;
this.callFlash("SetFileTypes", [types, description]);
};
// Public: setFileSizeLimit changes the file_size_limit setting
SWFUpload.prototype.setFileSizeLimit = function (fileSizeLimit) {
this.settings.file_size_limit = fileSizeLimit;
this.callFlash("SetFileSizeLimit", [fileSizeLimit]);
};
// Public: setFileUploadLimit changes the file_upload_limit setting
SWFUpload.prototype.setFileUploadLimit = function (fileUploadLimit) {
this.settings.file_upload_limit = fileUploadLimit;
this.callFlash("SetFileUploadLimit", [fileUploadLimit]);
};
// Public: setFileQueueLimit changes the file_queue_limit setting
SWFUpload.prototype.setFileQueueLimit = function (fileQueueLimit) {
this.settings.file_queue_limit = fileQueueLimit;
this.callFlash("SetFileQueueLimit", [fileQueueLimit]);
};
// Public: setFilePostName changes the file_post_name setting
SWFUpload.prototype.setFilePostName = function (filePostName) {
this.settings.file_post_name = filePostName;
this.callFlash("SetFilePostName", [filePostName]);
};
// Public: setUseQueryString changes the use_query_string setting
SWFUpload.prototype.setUseQueryString = function (useQueryString) {
this.settings.use_query_string = useQueryString;
this.callFlash("SetUseQueryString", [useQueryString]);
};
// Public: setRequeueOnError changes the requeue_on_error setting
SWFUpload.prototype.setRequeueOnError = function (requeueOnError) {
this.settings.requeue_on_error = requeueOnError;
this.callFlash("SetRequeueOnError", [requeueOnError]);
};
// Public: setHTTPSuccess changes the http_success setting
SWFUpload.prototype.setHTTPSuccess = function (http_status_codes) {
if (typeof http_status_codes === "string") {
http_status_codes = http_status_codes.replace(" ", "").split(",");
}
this.settings.http_success = http_status_codes;
this.callFlash("SetHTTPSuccess", [http_status_codes]);
};
// Public: setHTTPSuccess changes the http_success setting
SWFUpload.prototype.setAssumeSuccessTimeout = function (timeout_seconds) {
this.settings.assume_success_timeout = timeout_seconds;
this.callFlash("SetAssumeSuccessTimeout", [timeout_seconds]);
};
// Public: setDebugEnabled changes the debug_enabled setting
SWFUpload.prototype.setDebugEnabled = function (debugEnabled) {
this.settings.debug_enabled = debugEnabled;
this.callFlash("SetDebugEnabled", [debugEnabled]);
};
// Public: setButtonImageURL loads a button image sprite
SWFUpload.prototype.setButtonImageURL = function (buttonImageURL) {
if (buttonImageURL == undefined) {
buttonImageURL = "";
}
this.settings.button_image_url = buttonImageURL;
this.callFlash("SetButtonImageURL", [buttonImageURL]);
};
// Public: setButtonDimensions resizes the Flash Movie and button
SWFUpload.prototype.setButtonDimensions = function (width, height) {
this.settings.button_width = width;
this.settings.button_height = height;
var movie = this.getMovieElement();
if (movie != undefined) {
movie.style.width = width + "px";
movie.style.height = height + "px";
}
this.callFlash("SetButtonDimensions", [width, height]);
};
// Public: setButtonText Changes the text overlaid on the button
SWFUpload.prototype.setButtonText = function (html) {
this.settings.button_text = html;
this.callFlash("SetButtonText", [html]);
};
// Public: setButtonTextPadding changes the top and left padding of the text overlay
SWFUpload.prototype.setButtonTextPadding = function (left, top) {
this.settings.button_text_top_padding = top;
this.settings.button_text_left_padding = left;
this.callFlash("SetButtonTextPadding", [left, top]);
};
// Public: setButtonTextStyle changes the CSS used to style the HTML/Text overlaid on the button
SWFUpload.prototype.setButtonTextStyle = function (css) {
this.settings.button_text_style = css;
this.callFlash("SetButtonTextStyle", [css]);
};
// Public: setButtonDisabled disables/enables the button
SWFUpload.prototype.setButtonDisabled = function (isDisabled) {
this.settings.button_disabled = isDisabled;
this.callFlash("SetButtonDisabled", [isDisabled]);
};
// Public: setButtonAction sets the action that occurs when the button is clicked
SWFUpload.prototype.setButtonAction = function (buttonAction) {
this.settings.button_action = buttonAction;
this.callFlash("SetButtonAction", [buttonAction]);
};
// Public: setButtonCursor changes the mouse cursor displayed when hovering over the button
SWFUpload.prototype.setButtonCursor = function (cursor) {
this.settings.button_cursor = cursor;
this.callFlash("SetButtonCursor", [cursor]);
};
/* *******************************
Flash Event Interfaces
These functions are used by Flash to trigger the various
events.
All these functions a Private.
Because the ExternalInterface library is buggy the event calls
are added to a queue and the queue then executed by a setTimeout.
This ensures that events are executed in a determinate order and that
the ExternalInterface bugs are avoided.
******************************* */
SWFUpload.prototype.queueEvent = function (handlerName, argumentArray) {
// Warning: Don't call this.debug inside here or you'll create an infinite loop
if (argumentArray == undefined) {
argumentArray = [];
} else if (!(argumentArray instanceof Array)) {
argumentArray = [argumentArray];
}
var self = this;
if (typeof this.settings[handlerName] === "function") {
// Queue the event
this.eventQueue.push(function () {
this.settings[handlerName].apply(this, argumentArray);
});
// Execute the next queued event
setTimeout(function () {
self.executeNextEvent();
}, 0);
} else if (this.settings[handlerName] !== null) {
throw "Event handler " + handlerName + " is unknown or is not a function";
}
};
// Private: Causes the next event in the queue to be executed. Since events are queued using a setTimeout
// we must queue them in order to garentee that they are executed in order.
SWFUpload.prototype.executeNextEvent = function () {
// Warning: Don't call this.debug inside here or you'll create an infinite loop
var f = this.eventQueue ? this.eventQueue.shift() : null;
if (typeof(f) === "function") {
f.apply(this);
}
};
// Private: unescapeFileParams is part of a workaround for a flash bug where objects passed through ExternalInterface cannot have
// properties that contain characters that are not valid for JavaScript identifiers. To work around this
// the Flash Component escapes the parameter names and we must unescape again before passing them along.
SWFUpload.prototype.unescapeFilePostParams = function (file) {
var reg = /[$]([0-9a-f]{4})/i;
var unescapedPost = {};
var uk;
if (file != undefined) {
for (var k in file.post) {
if (file.post.hasOwnProperty(k)) {
uk = k;
var match;
while ((match = reg.exec(uk)) !== null) {
uk = uk.replace(match[0], String.fromCharCode(parseInt("0x" + match[1], 16)));
}
unescapedPost[uk] = file.post[k];
}
}
file.post = unescapedPost;
}
return file;
};
// Private: Called by Flash to see if JS can call in to Flash (test if External Interface is working)
SWFUpload.prototype.testExternalInterface = function () {
try {
return this.callFlash("TestExternalInterface");
} catch (ex) {
return false;
}
};
// Private: This event is called by Flash when it has finished loading. Don't modify this.
// Use the swfupload_loaded_handler event setting to execute custom code when SWFUpload has loaded.
SWFUpload.prototype.flashReady = function () {
// Check that the movie element is loaded correctly with its ExternalInterface methods defined
var movieElement = this.getMovieElement();
if (!movieElement) {
this.debug("Flash called back ready but the flash movie can't be found.");
return;
}
this.cleanUp(movieElement);
this.queueEvent("swfupload_loaded_handler");
};
// Private: removes Flash added fuctions to the DOM node to prevent memory leaks in IE.
// This function is called by Flash each time the ExternalInterface functions are created.
SWFUpload.prototype.cleanUp = function (movieElement) {
// Pro-actively unhook all the Flash functions
try {
if (this.movieElement && typeof(movieElement.CallFunction) === "unknown") { // We only want to do this in IE
this.debug("Removing Flash functions hooks (this should only run in IE and should prevent memory leaks)");
for (var key in movieElement) {
try {
if (typeof(movieElement[key]) === "function") {
movieElement[key] = null;
}
} catch (ex) {
}
}
}
} catch (ex1) {
}
// Fix Flashes own cleanup code so if the SWFMovie was removed from the page
// it doesn't display errors.
window["__flash__removeCallback"] = function (instance, name) {
try {
if (instance) {
instance[name] = null;
}
} catch (flashEx) {
}
};
};
/* This is a chance to do something before the browse window opens */
SWFUpload.prototype.fileDialogStart = function () {
this.queueEvent("file_dialog_start_handler");
};
/* Called when a file is successfully added to the queue. */
SWFUpload.prototype.fileQueued = function (file) {
file = this.unescapeFilePostParams(file);
this.queueEvent("file_queued_handler", file);
};
/* Handle errors that occur when an attempt to queue a file fails. */
SWFUpload.prototype.fileQueueError = function (file, errorCode, message) {
file = this.unescapeFilePostParams(file);
this.queueEvent("file_queue_error_handler", [file, errorCode, message]);
};
/* Called after the file dialog has closed and the selected files have been queued.
You could call startUpload here if you want the queued files to begin uploading immediately. */
SWFUpload.prototype.fileDialogComplete = function (numFilesSelected, numFilesQueued, numFilesInQueue) {
this.queueEvent("file_dialog_complete_handler", [numFilesSelected, numFilesQueued, numFilesInQueue]);
};
SWFUpload.prototype.uploadStart = function (file) {
file = this.unescapeFilePostParams(file);
this.queueEvent("return_upload_start_handler", file);
};
SWFUpload.prototype.returnUploadStart = function (file) {
var returnValue;
if (typeof this.settings.upload_start_handler === "function") {
file = this.unescapeFilePostParams(file);
returnValue = this.settings.upload_start_handler.call(this, file);
} else if (this.settings.upload_start_handler != undefined) {
throw "upload_start_handler must be a function";
}
// Convert undefined to true so if nothing is returned from the upload_start_handler it is
// interpretted as 'true'.
if (returnValue === undefined) {
returnValue = true;
}
returnValue = !!returnValue;
this.callFlash("ReturnUploadStart", [returnValue]);
};
SWFUpload.prototype.uploadProgress = function (file, bytesComplete, bytesTotal) {
file = this.unescapeFilePostParams(file);
this.queueEvent("upload_progress_handler", [file, bytesComplete, bytesTotal]);
};
SWFUpload.prototype.uploadError = function (file, errorCode, message) {
file = this.unescapeFilePostParams(file);
this.queueEvent("upload_error_handler", [file, errorCode, message]);
};
SWFUpload.prototype.uploadSuccess = function (file, serverData, responseReceived) {
file = this.unescapeFilePostParams(file);
this.queueEvent("upload_success_handler", [file, serverData, responseReceived]);
};
SWFUpload.prototype.uploadComplete = function (file) {
file = this.unescapeFilePostParams(file);
this.queueEvent("upload_complete_handler", file);
};
/* Called by SWFUpload JavaScript and Flash functions when debug is enabled. By default it writes messages to the
internal debug console. You can override this event and have messages written where you want. */
SWFUpload.prototype.debug = function (message) {
this.queueEvent("debug_handler", message);
};
/* **********************************
Debug Console
The debug console is a self contained, in page location
for debug message to be sent. The Debug Console adds
itself to the body if necessary.
The console is automatically scrolled as messages appear.
If you are using your own debug handler or when you deploy to production and
have debug disabled you can remove these functions to reduce the file size
and complexity.
********************************** */
// Private: debugMessage is the default debug_handler. If you want to print debug messages
// call the debug() function. When overriding the function your own function should
// check to see if the debug setting is true before outputting debug information.
SWFUpload.prototype.debugMessage = function (message) {
if (this.settings.debug) {
var exceptionMessage, exceptionValues = [];
// Check for an exception object and print it nicely
if (typeof message === "object" && typeof message.name === "string" && typeof message.message === "string") {
for (var key in message) {
if (message.hasOwnProperty(key)) {
exceptionValues.push(key + ": " + message[key]);
}
}
exceptionMessage = exceptionValues.join("\n") || "";
exceptionValues = exceptionMessage.split("\n");
exceptionMessage = "EXCEPTION: " + exceptionValues.join("\nEXCEPTION: ");
SWFUpload.Console.writeLine(exceptionMessage);
} else {
SWFUpload.Console.writeLine(message);
}
}
};
SWFUpload.Console = {};
SWFUpload.Console.writeLine = function (message) {
var console, documentForm;
try {
console = document.getElementById("SWFUpload_Console");
if (!console) {
documentForm = document.createElement("form");
document.getElementsByTagName("body")[0].appendChild(documentForm);
console = document.createElement("textarea");
console.id = "SWFUpload_Console";
console.style.fontFamily = "monospace";
console.setAttribute("wrap", "off");
console.wrap = "off";
console.style.overflow = "auto";
console.style.width = "700px";
console.style.height = "350px";
console.style.margin = "5px";
documentForm.appendChild(console);
}
console.value += message + "\n";
console.scrollTop = console.scrollHeight - console.clientHeight;
} catch (ex) {
alert("Exception: " + ex.name + " Message: " + ex.message);
}
};

File diff suppressed because one or more lines are too long