CODE STYLE removing the xpdl class and related files

This commit is contained in:
Fernando Ontiveros
2012-10-17 13:43:05 -04:00
parent 20cf857b28
commit d0806cfe65
89 changed files with 30 additions and 30250 deletions

View File

@@ -1,860 +0,0 @@
<?php
require_once PATH_TRUNK . 'gulliver/thirdparty/smarty/libs/Smarty.class.php';
require_once PATH_TRUNK . 'gulliver/system/class.xmlform.php';
require_once PATH_TRUNK . 'gulliver/system/class.xmlDocument.php';
require_once PATH_TRUNK . 'gulliver/system/class.form.php';
require_once PATH_TRUNK . 'gulliver/system/class.dbconnection.php';
require_once PATH_TRUNK . 'gulliver/thirdparty/propel/Propel.php';
require_once PATH_TRUNK . 'gulliver/thirdparty/creole/Creole.php';
require_once PATH_TRUNK . 'gulliver/thirdparty/pear/PEAR.php';
require_once PATH_TRUNK . 'workflow/engine/classes/class.xpdl.php';
/**
* Generated by ProcessMaker Test Unit Generator on 2012-07-12 at 22:32:31.
*/
class classXpdlTest extends PHPUnit_Framework_TestCase
{
/**
* @var Xpdl
*/
protected $object;
/**
* Sets up the fixture, for example, opens a network connection.
* This method is called before a test is executed.
*/
protected function setUp()
{
$this->object = new Xpdl();
}
/**
* Tears down the fixture, for example, closes a network connection.
* This method is called after a test is executed.
*/
protected function tearDown()
{
}
/**
* This is the default method to test, if the class still having
* the same number of methods.
*/
public function testNumberOfMethodsInThisClass()
{
$methods = get_class_methods('Xpdl'); $this->assertTrue( count($methods) == 185);
}
/**
* @covers Xpdl::createProcessFromDataXpdl
* @todo Implement testcreateProcessFromDataXpdl().
*/
public function testcreateProcessFromDataXpdl()
{
$methods = get_class_methods($this->object);
$this->assertTrue( in_array('createProcessFromDataXpdl', $methods ), 'exists method createProcessFromDataXpdl' );
$r = new ReflectionMethod('Xpdl', 'createProcessFromDataXpdl');
$params = $r->getParameters();
$this->assertTrue( $params[0]->getName() == 'oData');
$this->assertTrue( $params[0]->isArray() == false);
$this->assertTrue( $params[0]->isOptional () == false);
$this->assertTrue( $params[1]->getName() == 'tasks');
$this->assertTrue( $params[1]->isArray() == false);
$this->assertTrue( $params[1]->isOptional () == false);
}
/**
* @covers Xpdl::updateProcessFromDataXpdl
* @todo Implement testupdateProcessFromDataXpdl().
*/
public function testupdateProcessFromDataXpdl()
{
$methods = get_class_methods($this->object);
$this->assertTrue( in_array('updateProcessFromDataXpdl', $methods ), 'exists method updateProcessFromDataXpdl' );
$r = new ReflectionMethod('Xpdl', 'updateProcessFromDataXpdl');
$params = $r->getParameters();
$this->assertTrue( $params[0]->getName() == 'oData');
$this->assertTrue( $params[0]->isArray() == false);
$this->assertTrue( $params[0]->isOptional () == false);
$this->assertTrue( $params[1]->getName() == 'tasks');
$this->assertTrue( $params[1]->isArray() == false);
$this->assertTrue( $params[1]->isOptional () == false);
}
/**
* @covers Xpdl::createProcessFromDataPmxml
* @todo Implement testcreateProcessFromDataPmxml().
*/
public function testcreateProcessFromDataPmxml()
{
$methods = get_class_methods($this->object);
$this->assertTrue( in_array('createProcessFromDataPmxml', $methods ), 'exists method createProcessFromDataPmxml' );
$r = new ReflectionMethod('Xpdl', 'createProcessFromDataPmxml');
$params = $r->getParameters();
$this->assertTrue( $params[0]->getName() == 'oData');
$this->assertTrue( $params[0]->isArray() == false);
$this->assertTrue( $params[0]->isOptional () == false);
}
/**
* @covers Xpdl::createSubProcessFromDataXpdl
* @todo Implement testcreateSubProcessFromDataXpdl().
*/
public function testcreateSubProcessFromDataXpdl()
{
$methods = get_class_methods($this->object);
$this->assertTrue( in_array('createSubProcessFromDataXpdl', $methods ), 'exists method createSubProcessFromDataXpdl' );
$r = new ReflectionMethod('Xpdl', 'createSubProcessFromDataXpdl');
$params = $r->getParameters();
$this->assertTrue( $params[0]->getName() == 'oData');
$this->assertTrue( $params[0]->isArray() == false);
$this->assertTrue( $params[0]->isOptional () == false);
$this->assertTrue( $params[1]->getName() == 'tasks');
$this->assertTrue( $params[1]->isArray() == false);
$this->assertTrue( $params[1]->isOptional () == false);
}
/**
* @covers Xpdl::verifyTasks
* @todo Implement testverifyTasks().
*/
public function testverifyTasks()
{
$methods = get_class_methods($this->object);
$this->assertTrue( in_array('verifyTasks', $methods ), 'exists method verifyTasks' );
$r = new ReflectionMethod('Xpdl', 'verifyTasks');
$params = $r->getParameters();
$this->assertTrue( $params[0]->getName() == 'sProUid');
$this->assertTrue( $params[0]->isArray() == false);
$this->assertTrue( $params[0]->isOptional () == false);
$this->assertTrue( $params[1]->getName() == 'fieldsTasks');
$this->assertTrue( $params[1]->isArray() == false);
$this->assertTrue( $params[1]->isOptional () == false);
}
/**
* @covers Xpdl::createRouteRowsXpdl
* @todo Implement testcreateRouteRowsXpdl().
*/
public function testcreateRouteRowsXpdl()
{
$methods = get_class_methods($this->object);
$this->assertTrue( in_array('createRouteRowsXpdl', $methods ), 'exists method createRouteRowsXpdl' );
$r = new ReflectionMethod('Xpdl', 'createRouteRowsXpdl');
$params = $r->getParameters();
$this->assertTrue( $params[0]->getName() == 'sProUid');
$this->assertTrue( $params[0]->isArray() == false);
$this->assertTrue( $params[0]->isOptional () == false);
$this->assertTrue( $params[1]->getName() == 'routes');
$this->assertTrue( $params[1]->isArray() == false);
$this->assertTrue( $params[1]->isOptional () == false);
$this->assertTrue( $params[2]->getName() == 'fieldsTasks');
$this->assertTrue( $params[2]->isArray() == false);
$this->assertTrue( $params[2]->isOptional () == false);
}
/**
* @covers Xpdl::createSubProcessRowsXpdl
* @todo Implement testcreateSubProcessRowsXpdl().
*/
public function testcreateSubProcessRowsXpdl()
{
$methods = get_class_methods($this->object);
$this->assertTrue( in_array('createSubProcessRowsXpdl', $methods ), 'exists method createSubProcessRowsXpdl' );
$r = new ReflectionMethod('Xpdl', 'createSubProcessRowsXpdl');
$params = $r->getParameters();
$this->assertTrue( $params[0]->getName() == 'sProUid');
$this->assertTrue( $params[0]->isArray() == false);
$this->assertTrue( $params[0]->isOptional () == false);
$this->assertTrue( $params[1]->getName() == 'SubProcess');
$this->assertTrue( $params[1]->isArray() == false);
$this->assertTrue( $params[1]->isOptional () == false);
$this->assertTrue( $params[2]->getName() == 'tasks');
$this->assertTrue( $params[2]->isArray() == false);
$this->assertTrue( $params[2]->isOptional () == false);
}
/**
* @covers Xpdl::findIdTask
* @todo Implement testfindIdTask().
*/
public function testfindIdTask()
{
$methods = get_class_methods($this->object);
$this->assertTrue( in_array('findIdTask', $methods ), 'exists method findIdTask' );
$r = new ReflectionMethod('Xpdl', 'findIdTask');
$params = $r->getParameters();
$this->assertTrue( $params[0]->getName() == 'idTask');
$this->assertTrue( $params[0]->isArray() == false);
$this->assertTrue( $params[0]->isOptional () == false);
$this->assertTrue( $params[1]->getName() == 'routes');
$this->assertTrue( $params[1]->isArray() == false);
$this->assertTrue( $params[1]->isOptional () == false);
}
/**
* @covers Xpdl::xmdlProcess
* @todo Implement testxmdlProcess().
*/
public function testxmdlProcess()
{
$methods = get_class_methods($this->object);
$this->assertTrue( in_array('xmdlProcess', $methods ), 'exists method xmdlProcess' );
$r = new ReflectionMethod('Xpdl', 'xmdlProcess');
$params = $r->getParameters();
$this->assertTrue( $params[0]->getName() == 'sProUid');
$this->assertTrue( $params[0]->isArray() == false);
$this->assertTrue( $params[0]->isOptional () == true);
$this->assertTrue( $params[0]->getDefaultValue() == '');
}
/**
* @covers Xpdl::createPool
* @todo Implement testcreatePool().
*/
public function testcreatePool()
{
$methods = get_class_methods($this->object);
$this->assertTrue( in_array('createPool', $methods ), 'exists method createPool' );
$r = new ReflectionMethod('Xpdl', 'createPool');
$params = $r->getParameters();
$this->assertTrue( $params[0]->getName() == 'process');
$this->assertTrue( $params[0]->isArray() == false);
$this->assertTrue( $params[0]->isOptional () == false);
$this->assertTrue( $params[1]->getName() == 'coordinateMaximumX');
$this->assertTrue( $params[1]->isArray() == false);
$this->assertTrue( $params[1]->isOptional () == false);
$this->assertTrue( $params[2]->getName() == 'coordinateMaximumY');
$this->assertTrue( $params[2]->isArray() == false);
$this->assertTrue( $params[2]->isOptional () == false);
}
/**
* @covers Xpdl::createArtifacts
* @todo Implement testcreateArtifacts().
*/
public function testcreateArtifacts()
{
$methods = get_class_methods($this->object);
$this->assertTrue( in_array('createArtifacts', $methods ), 'exists method createArtifacts' );
$r = new ReflectionMethod('Xpdl', 'createArtifacts');
$params = $r->getParameters();
$this->assertTrue( $params[0]->getName() == 'lanes');
$this->assertTrue( $params[0]->isArray() == false);
$this->assertTrue( $params[0]->isOptional () == false);
$this->assertTrue( $params[1]->getName() == 'id');
$this->assertTrue( $params[1]->isArray() == false);
$this->assertTrue( $params[1]->isOptional () == false);
}
/**
* @covers Xpdl::createSubProcessesXpdl
* @todo Implement testcreateSubProcessesXpdl().
*/
public function testcreateSubProcessesXpdl()
{
$methods = get_class_methods($this->object);
$this->assertTrue( in_array('createSubProcessesXpdl', $methods ), 'exists method createSubProcessesXpdl' );
$r = new ReflectionMethod('Xpdl', 'createSubProcessesXpdl');
$params = $r->getParameters();
$this->assertTrue( $params[0]->getName() == 'subProcess');
$this->assertTrue( $params[0]->isArray() == false);
$this->assertTrue( $params[0]->isOptional () == false);
$this->assertTrue( $params[1]->getName() == 'tasks');
$this->assertTrue( $params[1]->isArray() == false);
$this->assertTrue( $params[1]->isOptional () == false);
}
/**
* @covers Xpdl::createActivitiesXpdl
* @todo Implement testcreateActivitiesXpdl().
*/
public function testcreateActivitiesXpdl()
{
$methods = get_class_methods($this->object);
$this->assertTrue( in_array('createActivitiesXpdl', $methods ), 'exists method createActivitiesXpdl' );
$r = new ReflectionMethod('Xpdl', 'createActivitiesXpdl');
$params = $r->getParameters();
$this->assertTrue( $params[0]->getName() == 'tasks');
$this->assertTrue( $params[0]->isArray() == false);
$this->assertTrue( $params[0]->isOptional () == false);
$this->assertTrue( $params[1]->getName() == 'events');
$this->assertTrue( $params[1]->isArray() == false);
$this->assertTrue( $params[1]->isOptional () == false);
$this->assertTrue( $params[2]->getName() == 'scheduler');
$this->assertTrue( $params[2]->isArray() == false);
$this->assertTrue( $params[2]->isOptional () == false);
}
/**
* @covers Xpdl::createTransitionsXpdl
* @todo Implement testcreateTransitionsXpdl().
*/
public function testcreateTransitionsXpdl()
{
$methods = get_class_methods($this->object);
$this->assertTrue( in_array('createTransitionsXpdl', $methods ), 'exists method createTransitionsXpdl' );
$r = new ReflectionMethod('Xpdl', 'createTransitionsXpdl');
$params = $r->getParameters();
$this->assertTrue( $params[0]->getName() == 'routes');
$this->assertTrue( $params[0]->isArray() == false);
$this->assertTrue( $params[0]->isOptional () == false);
$this->assertTrue( $params[1]->getName() == 'tasks');
$this->assertTrue( $params[1]->isArray() == false);
$this->assertTrue( $params[1]->isOptional () == false);
$this->assertTrue( $params[2]->getName() == 'taskHidden');
$this->assertTrue( $params[2]->isArray() == false);
$this->assertTrue( $params[2]->isOptional () == false);
}
/**
* @covers Xpdl::getProcessDataXpdl
* @todo Implement testgetProcessDataXpdl().
*/
public function testgetProcessDataXpdl()
{
$methods = get_class_methods($this->object);
$this->assertTrue( in_array('getProcessDataXpdl', $methods ), 'exists method getProcessDataXpdl' );
$r = new ReflectionMethod('Xpdl', 'getProcessDataXpdl');
$params = $r->getParameters();
$this->assertTrue( $params[0]->getName() == 'pmFilename');
$this->assertTrue( $params[0]->isArray() == false);
$this->assertTrue( $params[0]->isOptional () == false);
}
/**
* @covers Xpdl::sortArray
* @todo Implement testsortArray().
*/
public function testsortArray()
{
$methods = get_class_methods($this->object);
$this->assertTrue( in_array('sortArray', $methods ), 'exists method sortArray' );
$r = new ReflectionMethod('Xpdl', 'sortArray');
$params = $r->getParameters();
$this->assertTrue( $params[0]->getName() == 'fields');
$this->assertTrue( $params[0]->isArray() == false);
$this->assertTrue( $params[0]->isOptional () == false);
}
/**
* @covers Xpdl::verifyRoutes
* @todo Implement testverifyRoutes().
*/
public function testverifyRoutes()
{
$methods = get_class_methods($this->object);
$this->assertTrue( in_array('verifyRoutes', $methods ), 'exists method verifyRoutes' );
$r = new ReflectionMethod('Xpdl', 'verifyRoutes');
$params = $r->getParameters();
$this->assertTrue( $params[0]->getName() == 'routeTransitions');
$this->assertTrue( $params[0]->isArray() == false);
$this->assertTrue( $params[0]->isOptional () == false);
$this->assertTrue( $params[1]->getName() == 'endArray');
$this->assertTrue( $params[1]->isArray() == false);
$this->assertTrue( $params[1]->isOptional () == false);
$this->assertTrue( $params[2]->getName() == 'taskHidden');
$this->assertTrue( $params[2]->isArray() == false);
$this->assertTrue( $params[2]->isOptional () == false);
}
/**
* @covers Xpdl::createProcess
* @todo Implement testcreateProcess().
*/
public function testcreateProcess()
{
$methods = get_class_methods($this->object);
$this->assertTrue( in_array('createProcess', $methods ), 'exists method createProcess' );
$r = new ReflectionMethod('Xpdl', 'createProcess');
$params = $r->getParameters();
$this->assertTrue( $params[0]->getName() == 'fields');
$this->assertTrue( $params[0]->isArray() == false);
$this->assertTrue( $params[0]->isOptional () == false);
}
/**
* @covers Xpdl::createSubProcesses
* @todo Implement testcreateSubProcesses().
*/
public function testcreateSubProcesses()
{
$methods = get_class_methods($this->object);
$this->assertTrue( in_array('createSubProcesses', $methods ), 'exists method createSubProcesses' );
$r = new ReflectionMethod('Xpdl', 'createSubProcesses');
$params = $r->getParameters();
$this->assertTrue( $params[0]->getName() == 'contentNode');
$this->assertTrue( $params[0]->isArray() == false);
$this->assertTrue( $params[0]->isOptional () == false);
$this->assertTrue( $params[1]->getName() == 'arrayLanes');
$this->assertTrue( $params[1]->isArray() == false);
$this->assertTrue( $params[1]->isOptional () == false);
}
/**
* @covers Xpdl::createTask
* @todo Implement testcreateTask().
*/
public function testcreateTask()
{
$methods = get_class_methods($this->object);
$this->assertTrue( in_array('createTask', $methods ), 'exists method createTask' );
$r = new ReflectionMethod('Xpdl', 'createTask');
$params = $r->getParameters();
$this->assertTrue( $params[0]->getName() == 'fields');
$this->assertTrue( $params[0]->isArray() == false);
$this->assertTrue( $params[0]->isOptional () == false);
}
/**
* @covers Xpdl::createDataTask
* @todo Implement testcreateDataTask().
*/
public function testcreateDataTask()
{
$methods = get_class_methods($this->object);
$this->assertTrue( in_array('createDataTask', $methods ), 'exists method createDataTask' );
$r = new ReflectionMethod('Xpdl', 'createDataTask');
$params = $r->getParameters();
$this->assertTrue( $params[0]->getName() == 'fields');
$this->assertTrue( $params[0]->isArray() == false);
$this->assertTrue( $params[0]->isOptional () == false);
}
/**
* @covers Xpdl::createRoute
* @todo Implement testcreateRoute().
*/
public function testcreateRoute()
{
$methods = get_class_methods($this->object);
$this->assertTrue( in_array('createRoute', $methods ), 'exists method createRoute' );
$r = new ReflectionMethod('Xpdl', 'createRoute');
$params = $r->getParameters();
$this->assertTrue( $params[0]->getName() == 'fields');
$this->assertTrue( $params[0]->isArray() == false);
$this->assertTrue( $params[0]->isOptional () == false);
}
/**
* @covers Xpdl::createSubProcess
* @todo Implement testcreateSubProcess().
*/
public function testcreateSubProcess()
{
$methods = get_class_methods($this->object);
$this->assertTrue( in_array('createSubProcess', $methods ), 'exists method createSubProcess' );
$r = new ReflectionMethod('Xpdl', 'createSubProcess');
$params = $r->getParameters();
$this->assertTrue( $params[0]->getName() == 'fields');
$this->assertTrue( $params[0]->isArray() == false);
$this->assertTrue( $params[0]->isOptional () == false);
}
/**
* @covers Xpdl::createGateways
* @todo Implement testcreateGateways().
*/
public function testcreateGateways()
{
$methods = get_class_methods($this->object);
$this->assertTrue( in_array('createGateways', $methods ), 'exists method createGateways' );
$r = new ReflectionMethod('Xpdl', 'createGateways');
$params = $r->getParameters();
$this->assertTrue( $params[0]->getName() == 'routeTransitions');
$this->assertTrue( $params[0]->isArray() == false);
$this->assertTrue( $params[0]->isOptional () == false);
$this->assertTrue( $params[1]->getName() == 'endArray');
$this->assertTrue( $params[1]->isArray() == false);
$this->assertTrue( $params[1]->isOptional () == false);
$this->assertTrue( $params[2]->getName() == 'dataRoutes');
$this->assertTrue( $params[2]->isArray() == false);
$this->assertTrue( $params[2]->isOptional () == false);
$this->assertTrue( $params[3]->getName() == 'numberRoutes');
$this->assertTrue( $params[3]->isArray() == false);
$this->assertTrue( $params[3]->isOptional () == false);
$this->assertTrue( $params[4]->getName() == 'idProcess');
$this->assertTrue( $params[4]->isArray() == false);
$this->assertTrue( $params[4]->isOptional () == false);
$this->assertTrue( $params[5]->getName() == 'taskHidden');
$this->assertTrue( $params[5]->isArray() == false);
$this->assertTrue( $params[5]->isOptional () == false);
}
/**
* @covers Xpdl::createLanesPM
* @todo Implement testcreateLanesPM().
*/
public function testcreateLanesPM()
{
$methods = get_class_methods($this->object);
$this->assertTrue( in_array('createLanesPM', $methods ), 'exists method createLanesPM' );
$r = new ReflectionMethod('Xpdl', 'createLanesPM');
$params = $r->getParameters();
$this->assertTrue( $params[0]->getName() == 'array');
$this->assertTrue( $params[0]->isArray() == false);
$this->assertTrue( $params[0]->isOptional () == false);
$this->assertTrue( $params[1]->getName() == 'idProcess');
$this->assertTrue( $params[1]->isArray() == false);
$this->assertTrue( $params[1]->isOptional () == false);
}
/**
* @covers Xpdl::createLanes
* @todo Implement testcreateLanes().
*/
public function testcreateLanes()
{
$methods = get_class_methods($this->object);
$this->assertTrue( in_array('createLanes', $methods ), 'exists method createLanes' );
$r = new ReflectionMethod('Xpdl', 'createLanes');
$params = $r->getParameters();
$this->assertTrue( $params[0]->getName() == 'lanes');
$this->assertTrue( $params[0]->isArray() == false);
$this->assertTrue( $params[0]->isOptional () == false);
}
/**
* @covers Xpdl::createLanesNewPM
* @todo Implement testcreateLanesNewPM().
*/
public function testcreateLanesNewPM()
{
$methods = get_class_methods($this->object);
$this->assertTrue( in_array('createLanesNewPM', $methods ), 'exists method createLanesNewPM' );
$r = new ReflectionMethod('Xpdl', 'createLanesNewPM');
$params = $r->getParameters();
$this->assertTrue( $params[0]->getName() == 'array');
$this->assertTrue( $params[0]->isArray() == false);
$this->assertTrue( $params[0]->isOptional () == false);
}
/**
* @covers Xpdl::createActivities
* @todo Implement testcreateActivities().
*/
public function testcreateActivities()
{
$methods = get_class_methods($this->object);
$this->assertTrue( in_array('createActivities', $methods ), 'exists method createActivities' );
$r = new ReflectionMethod('Xpdl', 'createActivities');
$params = $r->getParameters();
$this->assertTrue( $params[0]->getName() == 'contentNode');
$this->assertTrue( $params[0]->isArray() == false);
$this->assertTrue( $params[0]->isOptional () == false);
$this->assertTrue( $params[1]->getName() == 'idProcess');
$this->assertTrue( $params[1]->isArray() == false);
$this->assertTrue( $params[1]->isOptional () == false);
$this->assertTrue( $params[2]->getName() == 'activitySet');
$this->assertTrue( $params[2]->isArray() == false);
$this->assertTrue( $params[2]->isOptional () == false);
}
/**
* @covers Xpdl::createEventMessages
* @todo Implement testcreateEventMessages().
*/
public function testcreateEventMessages()
{
$methods = get_class_methods($this->object);
$this->assertTrue( in_array('createEventMessages', $methods ), 'exists method createEventMessages' );
$r = new ReflectionMethod('Xpdl', 'createEventMessages');
$params = $r->getParameters();
$this->assertTrue( $params[0]->getName() == 'fields');
$this->assertTrue( $params[0]->isArray() == false);
$this->assertTrue( $params[0]->isOptional () == false);
$this->assertTrue( $params[1]->getName() == 'idProcess');
$this->assertTrue( $params[1]->isArray() == false);
$this->assertTrue( $params[1]->isOptional () == false);
}
/**
* @covers Xpdl::createScheduler
* @todo Implement testcreateScheduler().
*/
public function testcreateScheduler()
{
$methods = get_class_methods($this->object);
$this->assertTrue( in_array('createScheduler', $methods ), 'exists method createScheduler' );
$r = new ReflectionMethod('Xpdl', 'createScheduler');
$params = $r->getParameters();
$this->assertTrue( $params[0]->getName() == 'fields');
$this->assertTrue( $params[0]->isArray() == false);
$this->assertTrue( $params[0]->isOptional () == false);
$this->assertTrue( $params[1]->getName() == 'idProcess');
$this->assertTrue( $params[1]->isArray() == false);
$this->assertTrue( $params[1]->isOptional () == false);
}
/**
* @covers Xpdl::calculateTimeScheduler
* @todo Implement testcalculateTimeScheduler().
*/
public function testcalculateTimeScheduler()
{
$methods = get_class_methods($this->object);
$this->assertTrue( in_array('calculateTimeScheduler', $methods ), 'exists method calculateTimeScheduler' );
$r = new ReflectionMethod('Xpdl', 'calculateTimeScheduler');
$params = $r->getParameters();
$this->assertTrue( $params[0]->getName() == 'time');
$this->assertTrue( $params[0]->isArray() == false);
$this->assertTrue( $params[0]->isOptional () == false);
}
/**
* @covers Xpdl::createArrayScheduler
* @todo Implement testcreateArrayScheduler().
*/
public function testcreateArrayScheduler()
{
$methods = get_class_methods($this->object);
$this->assertTrue( in_array('createArrayScheduler', $methods ), 'exists method createArrayScheduler' );
$r = new ReflectionMethod('Xpdl', 'createArrayScheduler');
$params = $r->getParameters();
$this->assertTrue( $params[0]->getName() == 'fields');
$this->assertTrue( $params[0]->isArray() == false);
$this->assertTrue( $params[0]->isOptional () == false);
$this->assertTrue( $params[1]->getName() == 'idProcess');
$this->assertTrue( $params[1]->isArray() == false);
$this->assertTrue( $params[1]->isOptional () == false);
}
/**
* @covers Xpdl::createTransitions
* @todo Implement testcreateTransitions().
*/
public function testcreateTransitions()
{
$methods = get_class_methods($this->object);
$this->assertTrue( in_array('createTransitions', $methods ), 'exists method createTransitions' );
$r = new ReflectionMethod('Xpdl', 'createTransitions');
$params = $r->getParameters();
$this->assertTrue( $params[0]->getName() == 'contentNode');
$this->assertTrue( $params[0]->isArray() == false);
$this->assertTrue( $params[0]->isOptional () == false);
$this->assertTrue( $params[1]->getName() == 'dataTasks');
$this->assertTrue( $params[1]->isArray() == false);
$this->assertTrue( $params[1]->isOptional () == false);
$this->assertTrue( $params[2]->getName() == 'arrayRoutes');
$this->assertTrue( $params[2]->isArray() == false);
$this->assertTrue( $params[2]->isOptional () == false);
$this->assertTrue( $params[3]->getName() == 'endArray');
$this->assertTrue( $params[3]->isArray() == false);
$this->assertTrue( $params[3]->isOptional () == false);
$this->assertTrue( $params[4]->getName() == 'startArray');
$this->assertTrue( $params[4]->isArray() == false);
$this->assertTrue( $params[4]->isOptional () == false);
$this->assertTrue( $params[5]->getName() == 'idProcess');
$this->assertTrue( $params[5]->isArray() == false);
$this->assertTrue( $params[5]->isOptional () == false);
$this->assertTrue( $params[6]->getName() == 'schedulerArray');
$this->assertTrue( $params[6]->isArray() == false);
$this->assertTrue( $params[6]->isOptional () == false);
$this->assertTrue( $params[7]->getName() == 'messages');
$this->assertTrue( $params[7]->isArray() == false);
$this->assertTrue( $params[7]->isOptional () == false);
}
/**
* @covers Xpdl::createActivity
* @todo Implement testcreateActivity().
*/
public function testcreateActivity()
{
$methods = get_class_methods($this->object);
$this->assertTrue( in_array('createActivity', $methods ), 'exists method createActivity' );
$r = new ReflectionMethod('Xpdl', 'createActivity');
$params = $r->getParameters();
$this->assertTrue( $params[0]->getName() == 'contentNode');
$this->assertTrue( $params[0]->isArray() == false);
$this->assertTrue( $params[0]->isOptional () == false);
}
/**
* @covers Xpdl::createExtended
* @todo Implement testcreateExtended().
*/
public function testcreateExtended()
{
$methods = get_class_methods($this->object);
$this->assertTrue( in_array('createExtended', $methods ), 'exists method createExtended' );
$r = new ReflectionMethod('Xpdl', 'createExtended');
$params = $r->getParameters();
$this->assertTrue( $params[0]->getName() == 'contentNode');
$this->assertTrue( $params[0]->isArray() == false);
$this->assertTrue( $params[0]->isOptional () == false);
}
/**
* @covers Xpdl::findCoordinates
* @todo Implement testfindCoordinates().
*/
public function testfindCoordinates()
{
$methods = get_class_methods($this->object);
$this->assertTrue( in_array('findCoordinates', $methods ), 'exists method findCoordinates' );
$r = new ReflectionMethod('Xpdl', 'findCoordinates');
$params = $r->getParameters();
$this->assertTrue( $params[0]->getName() == 'contentNode');
$this->assertTrue( $params[0]->isArray() == false);
$this->assertTrue( $params[0]->isOptional () == false);
}
/**
* @covers Xpdl::findCoordinatesTransition
* @todo Implement testfindCoordinatesTransition().
*/
public function testfindCoordinatesTransition()
{
$methods = get_class_methods($this->object);
$this->assertTrue( in_array('findCoordinatesTransition', $methods ), 'exists method findCoordinatesTransition' );
$r = new ReflectionMethod('Xpdl', 'findCoordinatesTransition');
$params = $r->getParameters();
$this->assertTrue( $params[0]->getName() == 'idRoute');
$this->assertTrue( $params[0]->isArray() == false);
$this->assertTrue( $params[0]->isOptional () == false);
$this->assertTrue( $params[1]->getName() == 'aRoutes');
$this->assertTrue( $params[1]->isArray() == false);
$this->assertTrue( $params[1]->isOptional () == false);
}
/**
* @covers Xpdl::createArrayRoutes
* @todo Implement testcreateArrayRoutes().
*/
public function testcreateArrayRoutes()
{
$methods = get_class_methods($this->object);
$this->assertTrue( in_array('createArrayRoutes', $methods ), 'exists method createArrayRoutes' );
$r = new ReflectionMethod('Xpdl', 'createArrayRoutes');
$params = $r->getParameters();
$this->assertTrue( $params[0]->getName() == 'dataTasks');
$this->assertTrue( $params[0]->isArray() == false);
$this->assertTrue( $params[0]->isOptional () == false);
$this->assertTrue( $params[1]->getName() == 'arrayRoutes');
$this->assertTrue( $params[1]->isArray() == false);
$this->assertTrue( $params[1]->isOptional () == false);
$this->assertTrue( $params[2]->getName() == 'aEvents');
$this->assertTrue( $params[2]->isArray() == false);
$this->assertTrue( $params[2]->isOptional () == false);
$this->assertTrue( $params[3]->getName() == 'aGateways');
$this->assertTrue( $params[3]->isArray() == false);
$this->assertTrue( $params[3]->isOptional () == false);
$this->assertTrue( $params[4]->getName() == 'aEnd');
$this->assertTrue( $params[4]->isArray() == false);
$this->assertTrue( $params[4]->isOptional () == false);
$this->assertTrue( $params[5]->getName() == 'idProcess');
$this->assertTrue( $params[5]->isArray() == false);
$this->assertTrue( $params[5]->isOptional () == false);
}
/**
* @covers Xpdl::convertArrayEnd
* @todo Implement testconvertArrayEnd().
*/
public function testconvertArrayEnd()
{
$methods = get_class_methods($this->object);
$this->assertTrue( in_array('convertArrayEnd', $methods ), 'exists method convertArrayEnd' );
$r = new ReflectionMethod('Xpdl', 'convertArrayEnd');
$params = $r->getParameters();
$this->assertTrue( $params[0]->getName() == 'aEvents');
$this->assertTrue( $params[0]->isArray() == false);
$this->assertTrue( $params[0]->isOptional () == false);
$this->assertTrue( $params[1]->getName() == 'idProcess');
$this->assertTrue( $params[1]->isArray() == false);
$this->assertTrue( $params[1]->isOptional () == false);
}
/**
* @covers Xpdl::createTransitionsPM
* @todo Implement testcreateTransitionsPM().
*/
public function testcreateTransitionsPM()
{
$methods = get_class_methods($this->object);
$this->assertTrue( in_array('createTransitionsPM', $methods ), 'exists method createTransitionsPM' );
$r = new ReflectionMethod('Xpdl', 'createTransitionsPM');
$params = $r->getParameters();
$this->assertTrue( $params[0]->getName() == 'tasks');
$this->assertTrue( $params[0]->isArray() == false);
$this->assertTrue( $params[0]->isOptional () == false);
$this->assertTrue( $params[1]->getName() == 'routes');
$this->assertTrue( $params[1]->isArray() == false);
$this->assertTrue( $params[1]->isOptional () == false);
$this->assertTrue( $params[2]->getName() == 'events');
$this->assertTrue( $params[2]->isArray() == false);
$this->assertTrue( $params[2]->isOptional () == false);
$this->assertTrue( $params[3]->getName() == 'countEvents');
$this->assertTrue( $params[3]->isArray() == false);
$this->assertTrue( $params[3]->isOptional () == false);
$this->assertTrue( $params[4]->getName() == 'arrayRoutes');
$this->assertTrue( $params[4]->isArray() == false);
$this->assertTrue( $params[4]->isOptional () == false);
$this->assertTrue( $params[5]->getName() == 'countRoutes');
$this->assertTrue( $params[5]->isArray() == false);
$this->assertTrue( $params[5]->isOptional () == false);
}
/**
* @covers Xpdl::super_unique
* @todo Implement testsuper_unique().
*/
public function testsuper_unique()
{
$methods = get_class_methods($this->object);
$this->assertTrue( in_array('super_unique', $methods ), 'exists method super_unique' );
$r = new ReflectionMethod('Xpdl', 'super_unique');
$params = $r->getParameters();
$this->assertTrue( $params[0]->getName() == 'array');
$this->assertTrue( $params[0]->isArray() == false);
$this->assertTrue( $params[0]->isOptional () == false);
}
/**
* @covers Xpdl::createProcessPM
* @todo Implement testcreateProcessPM().
*/
public function testcreateProcessPM()
{
$methods = get_class_methods($this->object);
$this->assertTrue( in_array('createProcessPM', $methods ), 'exists method createProcessPM' );
$r = new ReflectionMethod('Xpdl', 'createProcessPM');
$params = $r->getParameters();
$this->assertTrue( $params[0]->getName() == 'array');
$this->assertTrue( $params[0]->isArray() == false);
$this->assertTrue( $params[0]->isOptional () == false);
}
/**
* @covers Xpdl::createSubProcessesPM
* @todo Implement testcreateSubProcessesPM().
*/
public function testcreateSubProcessesPM()
{
$methods = get_class_methods($this->object);
$this->assertTrue( in_array('createSubProcessesPM', $methods ), 'exists method createSubProcessesPM' );
$r = new ReflectionMethod('Xpdl', 'createSubProcessesPM');
$params = $r->getParameters();
$this->assertTrue( $params[0]->getName() == 'array');
$this->assertTrue( $params[0]->isArray() == false);
$this->assertTrue( $params[0]->isOptional () == false);
}
/**
* @covers Xpdl::saveWebEntry
* @todo Implement testsaveWebEntry().
*/
public function testsaveWebEntry()
{
$methods = get_class_methods($this->object);
$this->assertTrue( in_array('saveWebEntry', $methods ), 'exists method saveWebEntry' );
$r = new ReflectionMethod('Xpdl', 'saveWebEntry');
$params = $r->getParameters();
$this->assertTrue( $params[0]->getName() == 'array');
$this->assertTrue( $params[0]->isArray() == false);
$this->assertTrue( $params[0]->isOptional () == false);
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -1,60 +0,0 @@
<?php
/**
* BPMN Designer v1.1
* @date Feb 2th, 2011
* @author Erik A. O. <erik@colosa.com>
*/
class BpmnDesigner extends Controller
{
function index($httpData)
{
if( ! isset($httpData->id) )
throw new Exception('The Process ID was not set!');
require_once 'classes/model/Process.php';
$process = ProcessPeer::retrieveByPK($httpData->id);
if( get_class($process) != 'Process' ) {
throw new Exception("The Process with UID: {$httpData->id} doesn't exist!");
}
$_SESSION['PROCESS'] = $httpData->id;
$_SESSION['PROCESSMAP'] = 'BPMN';
$this->includeExtJS('bpmn/MyWorkflow',true );
$this->includeExtJS('bpmn/pmosExt', true );
$this->includeExtJS('bpmn/TaskContext', true );
$this->includeExtJS('bpmn/designerComponents', true );
$this->includeExtJS('bpmn/designer', true );
$this->includeExtJS('bpmn/Annotation',true );
$this->includeExtJS('bpmn/bpmnShapes', true);
$this->includeExtJS('bpmn/EventEmptyStart');
$this->includeExtJS('bpmn/EventMessageStart');
$this->includeExtJS('bpmn/EventTimerStart');
$this->includeExtJS('bpmn/EventEmptyInter');
$this->includeExtJS('bpmn/EventMessageRecInter');
$this->includeExtJS('bpmn/EventMessageSendInter');
$this->includeExtJS('bpmn/EventTimerInter');
$this->includeExtJS('bpmn/EventEmptyEnd');
$this->includeExtJS('bpmn/EventMessageEnd');
$this->includeExtJS('bpmn/GatewayInclusive' );
$this->includeExtJS('bpmn/GatewayExclusiveData');
$this->includeExtJS('bpmn/GatewayParallel' );
$this->includeExtJS('bpmn/GridPanel');
$this->includeExtJS('bpmn/SubProcess' );
$this->includeExtJS('bpmn/ProcessOptions',true);
$this->includeExtJS('bpmn/ProcessMapContext', true );
$this->includeExtJS('bpmn/ProcessOptions', true);
$this->setJSVar('pro_uid', $httpData->id);
$this->setJSVar('pro_title', $process->getProTitle());
$this->setView('bpmn/designer');
G::RenderPage('publish', 'extJs');
}
}

View File

@@ -1,255 +0,0 @@
<?php
/**
* BpmnProxy Controller
* @author Erik Amaru Ortiz <erik@colosa.com, aortiz.erik@gmail.com>
*/
class BpmnProxy extends HttpProxyController
{
function openProcess($httpData)
{
G::LoadClass('xpdl');
$processUID = $httpData->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;
$arrayEvents[$count]['4'] = $value['TAS_UID'];
$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);
//Get Standalone Events and routes
$countEvent = count($fields['EVENTS']);
$countRoutes = count($fields['TRANSITION']);
foreach($oData->event as $id => $value) {
if($value['TAS_UID'] == '' && $value['EVN_TAS_UID_FROM'] != '' && $value['EVN_TAS_UID_TO'] != ''){ //Check for Intermediate Events
$evn_uid = $value['EVN_UID'];
$idTaskFrom = $value['EVN_TAS_UID_FROM'];
$idTaskTo = $value['EVN_TAS_UID_TO'];
$fields['EVENTS'][$countEvent]['0'] = $value['EVN_UID'];
$fields['EVENTS'][$countEvent]['1'] = $value['EVN_TYPE'];
$fields['EVENTS'][$countEvent]['2'] = $value['EVN_POSX'];
$fields['EVENTS'][$countEvent]['3'] = $value['EVN_POSY'];
$fields['EVENTS'][$countEvent]['4'] = $value['TAS_UID'];
$countEvent = $countEvent + 1;
$fields['TRANSITION'][$countRoutes]['0']= G::generateUniqueID();
$fields['TRANSITION'][$countRoutes]['1']= $idTaskFrom;
$fields['TRANSITION'][$countRoutes]['2']= $evn_uid;
$fields['TRANSITION'][$countRoutes]['3']= '1';
$fields['TRANSITION'][$countRoutes]['4']= '2';
$countRoutes = $countRoutes + 1;
$fields['TRANSITION'][$countRoutes]['0']= G::generateUniqueID();
$fields['TRANSITION'][$countRoutes]['1']= $evn_uid;
$fields['TRANSITION'][$countRoutes]['2']= $idTaskTo;
$fields['TRANSITION'][$countRoutes]['3']= '2';
$fields['TRANSITION'][$countRoutes]['4']= '1';
$countRoutes = $countRoutes + 1;
}
else if($value['TAS_UID'] == '' && $value['EVN_TAS_UID_TO'] != '' && ! preg_match("/Start/", $value['EVN_TYPE'])){
$evn_uid = $value['EVN_UID'];
$idTask = $value['EVN_TAS_UID_TO'];
$fields['EVENTS'][$countEvent]['0'] = $value['EVN_UID'];
$fields['EVENTS'][$countEvent]['1'] = $value['EVN_TYPE'];
$fields['EVENTS'][$countEvent]['2'] = $value['EVN_POSX'];
$fields['EVENTS'][$countEvent]['3'] = $value['EVN_POSY'];
$fields['EVENTS'][$countEvent]['4'] = $value['TAS_UID'];
$countEvent = $countEvent + 1;
$fields['TRANSITION'][$countRoutes]['0']= G::generateUniqueID();
$fields['TRANSITION'][$countRoutes]['1']= $evn_uid;
$fields['TRANSITION'][$countRoutes]['2']= $idTask;
$fields['TRANSITION'][$countRoutes]['3']= '2';
$fields['TRANSITION'][$countRoutes]['4']= '1';
$countRoutes = $countRoutes + 1;
}
else if($value['TAS_UID'] == '' && $value['EVN_TAS_UID_FROM'] != '' && ! preg_match("/End/", $value['EVN_TYPE'])){ //Check for Intermediate Events
$evn_uid = $value['EVN_UID'];
$idTask = $value['EVN_TAS_UID_FROM'];
$fields['EVENTS'][$countEvent]['0'] = $value['EVN_UID'];
$fields['EVENTS'][$countEvent]['1'] = $value['EVN_TYPE'];
$fields['EVENTS'][$countEvent]['2'] = $value['EVN_POSX'];
$fields['EVENTS'][$countEvent]['3'] = $value['EVN_POSY'];
$fields['EVENTS'][$countEvent]['4'] = $value['TAS_UID'];
$countEvent = $countEvent + 1;
$fields['TRANSITION'][$countRoutes]['0']= G::generateUniqueID();
$fields['TRANSITION'][$countRoutes]['1']= $idTask;
$fields['TRANSITION'][$countRoutes]['2']= $evn_uid;
$fields['TRANSITION'][$countRoutes]['3']= '1';
$fields['TRANSITION'][$countRoutes]['4']= '2';
$countRoutes = $countRoutes + 1;
}
else if($value['TAS_UID'] == '' && $value['EVN_TAS_UID_FROM'] == '' && $value['EVN_TAS_UID_TO'] == ''){
$fields['EVENTS'][$countEvent]['0'] = $value['EVN_UID'];
$fields['EVENTS'][$countEvent]['1'] = $value['EVN_TYPE'];
$fields['EVENTS'][$countEvent]['2'] = $value['EVN_POSX'];
$fields['EVENTS'][$countEvent]['3'] = $value['EVN_POSY'];
$fields['EVENTS'][$countEvent]['4'] = $value['TAS_UID'];
$countEvent = $countEvent + 1;
}
}
//Get all the standalone Gateway
$countGateway = count($fields['GATEWAYS']);
$countTransitions = count($fields['TRANSITION']);
foreach($oData->gateways as $id => $value) {
if($value['GAT_NEXT_TASK'] != '' && $value['TAS_UID'] != '' && $value['GAT_TYPE'] != ''){
$fields['GATEWAYS'][$countGateway]['0'] = $value['GAT_UID'];
$fields['GATEWAYS'][$countGateway]['1'] = $value['GAT_TYPE'];
$fields['GATEWAYS'][$countGateway]['2'] = $value['GAT_X'];
$fields['GATEWAYS'][$countGateway]['3'] = $value['GAT_Y'];
$fields['GATEWAYS'][$countGateway]['4'] = $value['TAS_UID'];
$fields['GATEWAYS'][$countGateway]['5'] = $value['TAS_UID'];
$countGateway+=1;
$fields['TRANSITION'][$countTransitions]['0'] = G::generateUniqueID();
$fields['TRANSITION'][$countTransitions]['1'] = $value['TAS_UID'];
$fields['TRANSITION'][$countTransitions]['2'] = $value['GAT_UID'];
$fields['TRANSITION'][$countTransitions]['3'] = '1';
$fields['TRANSITION'][$countTransitions]['4'] = '2';
$countTransitions += 1;
$fields['TRANSITION'][$countTransitions]['0'] = G::generateUniqueID();
$fields['TRANSITION'][$countTransitions]['1'] = $value['GAT_UID'];
$fields['TRANSITION'][$countTransitions]['2'] = $value['GAT_NEXT_TASK'];
$fields['TRANSITION'][$countTransitions]['3'] = '2';
$fields['TRANSITION'][$countTransitions]['4'] = '1';
$countTransitions += 1;
}
//creating gateway and route from gateway to task i.e if target task is not NULL
else if($value['GAT_NEXT_TASK'] != '' && $value['TAS_UID'] == ''){
$fields['GATEWAYS'][$countGateway]['0'] = $value['GAT_UID'];
$fields['GATEWAYS'][$countGateway]['1'] = $value['GAT_TYPE'];
$fields['GATEWAYS'][$countGateway]['2'] = $value['GAT_X'];
$fields['GATEWAYS'][$countGateway]['3'] = $value['GAT_Y'];
$fields['GATEWAYS'][$countGateway]['4'] = $value['TAS_UID'];
$fields['GATEWAYS'][$countGateway]['5'] = $value['GAT_NEXT_TASK'];
$fields['TRANSITION'][$countTransitions]['0'] = G::generateUniqueID();
$fields['TRANSITION'][$countTransitions]['1'] = $value['GAT_UID'];
$fields['TRANSITION'][$countTransitions]['2'] = $value['GAT_NEXT_TASK'];
$fields['TRANSITION'][$countTransitions]['3'] = '2';
$fields['TRANSITION'][$countTransitions]['4'] = '1';
$countGateway+=1;
$countTransitions += 1;
}
//creating gateway and route from task to gateway i.e if source task is not NULL
else if($value['GAT_NEXT_TASK'] == '' && $value['TAS_UID'] != ''){
$fields['GATEWAYS'][$countGateway]['0'] = $value['GAT_UID'];
$fields['GATEWAYS'][$countGateway]['1'] = $value['GAT_TYPE'];
$fields['GATEWAYS'][$countGateway]['2'] = $value['GAT_X'];
$fields['GATEWAYS'][$countGateway]['3'] = $value['GAT_Y'];
$fields['GATEWAYS'][$countGateway]['4'] = $value['TAS_UID'];
$fields['GATEWAYS'][$countGateway]['5'] = $value['GAT_NEXT_TASK'];
$fields['TRANSITION'][$countTransitions]['0'] = G::generateUniqueID();
$fields['TRANSITION'][$countTransitions]['1'] = $value['TAS_UID'];
$fields['TRANSITION'][$countTransitions]['2'] = $value['GAT_UID'];
$fields['TRANSITION'][$countTransitions]['3'] = '1';
$fields['TRANSITION'][$countTransitions]['4'] = '2';
$countGateway+=1;
$countTransitions += 1;
}
else if($value['GAT_NEXT_TASK'] == '' && $value['TAS_UID'] == ''){
$fields['GATEWAYS'][$countGateway]['0'] = $value['GAT_UID'];
$fields['GATEWAYS'][$countGateway]['1'] = $value['GAT_TYPE'];
$fields['GATEWAYS'][$countGateway]['2'] = $value['GAT_X'];
$fields['GATEWAYS'][$countGateway]['3'] = $value['GAT_Y'];
$countGateway += 1;
}
}
//Create Annotation route
foreach($oData->lanes as $id => $value)
{
if($value['SWI_NEXT_UID'] != '') {
$fields['TRANSITION'][$countTransitions]['0'] = G::generateUniqueID();
$fields['TRANSITION'][$countTransitions]['1'] = $value['SWI_NEXT_UID'];
$fields['TRANSITION'][$countTransitions]['2'] = $value['SWI_UID'];
$fields['TRANSITION'][$countTransitions]['3'] = '1';
$fields['TRANSITION'][$countTransitions]['4'] = '2';
$countTransitions += 1;
}
}
//$subProcess = $oProcess->createSubProcessesPM($oData->subProcess);
$arrayEvents = $fields['EVENTS'];
$arrayGateways = $fields['GATEWAYS'];
$arrayRoutes = $fields['TRANSITION'];
$data['tasks'] = $arrayTasks;
$data['subprocess'] = $arraySubProcess;
$data['routes'] = $arrayRoutes;
$data['events'] = $arrayEvents;
$data['gateways'] = $arrayGateways;
$data['process'] = $process;
$data['annotations'] = $lanes;
return $data;
}
}

View File

@@ -1,301 +0,0 @@
<?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

@@ -1,249 +0,0 @@
<?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

@@ -1,56 +0,0 @@
<?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

@@ -1,170 +0,0 @@
<?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 G::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 G::json_encode($steps);

View File

@@ -1,124 +0,0 @@
<?php
try
{
G::LoadClass('processMap');
$oProcessMap = new processMap(new DBConnection);
$start = isset($_POST['start'])? $_POST['start']: 0;
$limit = isset($_POST['limit'])? $_POST['limit']: '';
if ( isset($_GET['tid'] ) )
{
$rows = $oProcessMap->getExtStepsCriteria($start, $limit, $_GET['tid']); //Getting all assigned steps on a task
array_shift($rows);
}
}
catch ( Exception $e ) {
print G::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
);
echo G::json_encode($steps);

View File

@@ -1,272 +0,0 @@
<?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;
$arrayEvents[$count]['4'] = $value['TAS_UID'];
$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);
//Get Standalone Events and routes
$countEvent = count($fields['EVENTS']);
$countRoutes = count($fields['TRANSITION']);
foreach($oData->event as $id => $value)
{
if($value['TAS_UID'] == '' && $value['EVN_TAS_UID_FROM'] != '' && $value['EVN_TAS_UID_TO'] != ''){ //Check for Intermediate Events
$evn_uid = $value['EVN_UID'];
$idTaskFrom = $value['EVN_TAS_UID_FROM'];
$idTaskTo = $value['EVN_TAS_UID_TO'];
$fields['EVENTS'][$countEvent]['0'] = $value['EVN_UID'];
$fields['EVENTS'][$countEvent]['1'] = $value['EVN_TYPE'];
$fields['EVENTS'][$countEvent]['2'] = $value['EVN_POSX'];
$fields['EVENTS'][$countEvent]['3'] = $value['EVN_POSY'];
$fields['EVENTS'][$countEvent]['4'] = $value['TAS_UID'];
$countEvent = $countEvent + 1;
$fields['TRANSITION'][$countRoutes]['0']= G::generateUniqueID();
$fields['TRANSITION'][$countRoutes]['1']= $idTaskFrom;
$fields['TRANSITION'][$countRoutes]['2']= $evn_uid;
$fields['TRANSITION'][$countRoutes]['3']= '1';
$fields['TRANSITION'][$countRoutes]['4']= '2';
$countRoutes = $countRoutes + 1;
$fields['TRANSITION'][$countRoutes]['0']= G::generateUniqueID();
$fields['TRANSITION'][$countRoutes]['1']= $evn_uid;
$fields['TRANSITION'][$countRoutes]['2']= $idTaskTo;
$fields['TRANSITION'][$countRoutes]['3']= '2';
$fields['TRANSITION'][$countRoutes]['4']= '1';
$countRoutes = $countRoutes + 1;
}
else if($value['TAS_UID'] == '' && $value['EVN_TAS_UID_TO'] != '' && ! preg_match("/Start/", $value['EVN_TYPE'])){
$evn_uid = $value['EVN_UID'];
$idTask = $value['EVN_TAS_UID_TO'];
$fields['EVENTS'][$countEvent]['0'] = $value['EVN_UID'];
$fields['EVENTS'][$countEvent]['1'] = $value['EVN_TYPE'];
$fields['EVENTS'][$countEvent]['2'] = $value['EVN_POSX'];
$fields['EVENTS'][$countEvent]['3'] = $value['EVN_POSY'];
$fields['EVENTS'][$countEvent]['4'] = $value['TAS_UID'];
$countEvent = $countEvent + 1;
$fields['TRANSITION'][$countRoutes]['0']= G::generateUniqueID();
$fields['TRANSITION'][$countRoutes]['1']= $evn_uid;
$fields['TRANSITION'][$countRoutes]['2']= $idTask;
$fields['TRANSITION'][$countRoutes]['3']= '2';
$fields['TRANSITION'][$countRoutes]['4']= '1';
$countRoutes = $countRoutes + 1;
}
else if($value['TAS_UID'] == '' && $value['EVN_TAS_UID_FROM'] != '' && ! preg_match("/End/", $value['EVN_TYPE'])){ //Check for Intermediate Events
$evn_uid = $value['EVN_UID'];
$idTask = $value['EVN_TAS_UID_FROM'];
$fields['EVENTS'][$countEvent]['0'] = $value['EVN_UID'];
$fields['EVENTS'][$countEvent]['1'] = $value['EVN_TYPE'];
$fields['EVENTS'][$countEvent]['2'] = $value['EVN_POSX'];
$fields['EVENTS'][$countEvent]['3'] = $value['EVN_POSY'];
$fields['EVENTS'][$countEvent]['4'] = $value['TAS_UID'];
$countEvent = $countEvent + 1;
$fields['TRANSITION'][$countRoutes]['0']= G::generateUniqueID();
$fields['TRANSITION'][$countRoutes]['1']= $idTask;
$fields['TRANSITION'][$countRoutes]['2']= $evn_uid;
$fields['TRANSITION'][$countRoutes]['3']= '1';
$fields['TRANSITION'][$countRoutes]['4']= '2';
$countRoutes = $countRoutes + 1;
}
else if($value['TAS_UID'] == '' && $value['EVN_TAS_UID_FROM'] == '' && $value['EVN_TAS_UID_TO'] == ''){
$fields['EVENTS'][$countEvent]['0'] = $value['EVN_UID'];
$fields['EVENTS'][$countEvent]['1'] = $value['EVN_TYPE'];
$fields['EVENTS'][$countEvent]['2'] = $value['EVN_POSX'];
$fields['EVENTS'][$countEvent]['3'] = $value['EVN_POSY'];
$fields['EVENTS'][$countEvent]['4'] = $value['TAS_UID'];
$countEvent = $countEvent + 1;
}
}
//Get all the standalone Gateway
$countGateway = count($fields['GATEWAYS']);
$countTransitions = count($fields['TRANSITION']);
foreach($oData->gateways as $id => $value)
{
if($value['GAT_NEXT_TASK'] != '' && $value['TAS_UID'] != '' && $value['GAT_TYPE'] != ''){
$fields['GATEWAYS'][$countGateway]['0'] = $value['GAT_UID'];
$fields['GATEWAYS'][$countGateway]['1'] = $value['GAT_TYPE'];
$fields['GATEWAYS'][$countGateway]['2'] = $value['GAT_X'];
$fields['GATEWAYS'][$countGateway]['3'] = $value['GAT_Y'];
$fields['GATEWAYS'][$countGateway]['4'] = $value['TAS_UID'];
$fields['GATEWAYS'][$countGateway]['5'] = $value['TAS_UID'];
$countGateway+=1;
$fields['TRANSITION'][$countTransitions]['0'] = G::generateUniqueID();
$fields['TRANSITION'][$countTransitions]['1'] = $value['TAS_UID'];
$fields['TRANSITION'][$countTransitions]['2'] = $value['GAT_UID'];
$fields['TRANSITION'][$countTransitions]['3'] = '1';
$fields['TRANSITION'][$countTransitions]['4'] = '2';
$countTransitions += 1;
$fields['TRANSITION'][$countTransitions]['0'] = G::generateUniqueID();
$fields['TRANSITION'][$countTransitions]['1'] = $value['GAT_UID'];
$fields['TRANSITION'][$countTransitions]['2'] = $value['GAT_NEXT_TASK'];
$fields['TRANSITION'][$countTransitions]['3'] = '2';
$fields['TRANSITION'][$countTransitions]['4'] = '1';
$countTransitions += 1;
}
//creating gateway and route from gateway to task i.e if target task is not NULL
else if($value['GAT_NEXT_TASK'] != '' && $value['TAS_UID'] == ''){
$fields['GATEWAYS'][$countGateway]['0'] = $value['GAT_UID'];
$fields['GATEWAYS'][$countGateway]['1'] = $value['GAT_TYPE'];
$fields['GATEWAYS'][$countGateway]['2'] = $value['GAT_X'];
$fields['GATEWAYS'][$countGateway]['3'] = $value['GAT_Y'];
$fields['GATEWAYS'][$countGateway]['4'] = $value['TAS_UID'];
$fields['GATEWAYS'][$countGateway]['5'] = $value['GAT_NEXT_TASK'];
$fields['TRANSITION'][$countTransitions]['0'] = G::generateUniqueID();
$fields['TRANSITION'][$countTransitions]['1'] = $value['GAT_UID'];
$fields['TRANSITION'][$countTransitions]['2'] = $value['GAT_NEXT_TASK'];
$fields['TRANSITION'][$countTransitions]['3'] = '2';
$fields['TRANSITION'][$countTransitions]['4'] = '1';
$countGateway+=1;
$countTransitions += 1;
}
//creating gateway and route from task to gateway i.e if source task is not NULL
else if($value['GAT_NEXT_TASK'] == '' && $value['TAS_UID'] != ''){
$fields['GATEWAYS'][$countGateway]['0'] = $value['GAT_UID'];
$fields['GATEWAYS'][$countGateway]['1'] = $value['GAT_TYPE'];
$fields['GATEWAYS'][$countGateway]['2'] = $value['GAT_X'];
$fields['GATEWAYS'][$countGateway]['3'] = $value['GAT_Y'];
$fields['GATEWAYS'][$countGateway]['4'] = $value['TAS_UID'];
$fields['GATEWAYS'][$countGateway]['5'] = $value['GAT_NEXT_TASK'];
$fields['TRANSITION'][$countTransitions]['0'] = G::generateUniqueID();
$fields['TRANSITION'][$countTransitions]['1'] = $value['TAS_UID'];
$fields['TRANSITION'][$countTransitions]['2'] = $value['GAT_UID'];
$fields['TRANSITION'][$countTransitions]['3'] = '1';
$fields['TRANSITION'][$countTransitions]['4'] = '2';
$countGateway+=1;
$countTransitions += 1;
}
else if($value['GAT_NEXT_TASK'] == '' && $value['TAS_UID'] == ''){
$fields['GATEWAYS'][$countGateway]['0'] = $value['GAT_UID'];
$fields['GATEWAYS'][$countGateway]['1'] = $value['GAT_TYPE'];
$fields['GATEWAYS'][$countGateway]['2'] = $value['GAT_X'];
$fields['GATEWAYS'][$countGateway]['3'] = $value['GAT_Y'];
$countGateway += 1;
}
}
//Create Annotation route
foreach($oData->lanes as $id => $value)
{
if($value['SWI_NEXT_UID'] != '') {
$fields['TRANSITION'][$countTransitions]['0'] = G::generateUniqueID();
$fields['TRANSITION'][$countTransitions]['1'] = $value['SWI_NEXT_UID'];
$fields['TRANSITION'][$countTransitions]['2'] = $value['SWI_UID'];
$fields['TRANSITION'][$countTransitions]['3'] = '1';
$fields['TRANSITION'][$countTransitions]['4'] = '2';
$countTransitions += 1;
}
}
//$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 = G::json_encode($arrayTasks);
$aSubProcess = G::json_encode($arraySubProcess);
$aRoutes = G::json_encode($arrayRoutes);
$aEvents = G::json_encode($arrayEvents);
$aGateways = G::json_encode($arrayGateways);
$aProcess = G::json_encode($process);
$aLanes = G::json_encode($lanes);
echo "tasks:$aTasks|gateways:$aGateways|events:$aEvents|annotations:$aLanes|process:$aProcess|subprocess:$aSubProcess|routes:$aRoutes";
?>

View File

@@ -1,190 +0,0 @@
<?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');
G::LoadClass('processMap');
$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']);
}
//Saving Gateway details into Gateway table
if($aData['ROU_TYPE'] != 'SEQUENTIAL')
{
$oProcessMap = new processMap();
//$sGatewayUID = $oProcessMap->saveNewGateway($aData['PROCESS'], $aData['TASK'][0], $aData['ROU_NEXT_TASK'][0]);
require_once 'classes/model/Gateway.php';
$oGateway = new Gateway ( );
$aGatewayFields = array();
$aGatewayFields['GAT_UID'] = $aData['GAT_UID'];
$aGatewayFields['TAS_UID'] = $aData['TASK'][0];
$aGatewayFields['GAT_NEXT_TASK'] = $aData['ROU_NEXT_TASK'][0];
$aGatewayFields['GAT_TYPE'] = '';
$oGateway->update($aGatewayFields);
//$sGatewayUID = $oProcessMap->saveNewGateway($aData['PROCESS'], $aData['TASK'][0], $aData['ROU_NEXT_TASK'][0]);
//echo $sGatewayUID.'|';
}
//else
// echo $aData['ROU_EVN_UID'].'|'; //sending route_event_uid in response
G::LoadClass('tasks');
$oTasks = new Tasks();
$rou_id = 0;
$aFields['GAT_UID'] = $aData['GAT_UID'];
switch ($aData['action']) {
case 'savePattern':
foreach ($aData['TASK'] as $iKey => $aRow)
{
$oTasks->deleteAllRoutesOfTask($aData['PROCESS'], $aRow);
}
require_once 'classes/model/Route.php';
require_once 'classes/model/Event.php';
$oEvent = new Event ( );
$oRoute = new Route();
switch ($aData['ROU_TYPE']) {
case 'SEQUENTIAL':
case 'SEC-JOIN':
$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']) && $aData['ROU_EVN_UID'] != ''){
$aFields['ROU_EVN_UID'] = $aData['ROU_EVN_UID'];
$aDataEvent = array();
$aDataEvent['EVN_UID'] = $aData['ROU_EVN_UID'];
$aDataEvent['EVN_TAS_UID_FROM'] = $aData['TASK'][0];
$aDataEvent['EVN_RELATED_TO'] = 'MULTIPLE';
$oEvent->update($aDataEvent);
}
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);
break;
case 'SELECT':
foreach ($aData['GRID_SELECT_TYPE'] 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'];
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 'EVALUATE':
foreach ($aData['ROU_NEXT_TASK'] as $iKey => $aRow)
{
$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'];
$aFields['ROU_CONDITION'] = $aRow['ROU_CONDITION'];
$aFields['GAT_UID'] = $aData['GAT_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'] = $aRow['ROU_TO_LAST_USER'];
$rou_id = $oRoute->create($aFields);
unset($aFields);
}
break;
case 'PARALLEL':
foreach ($aData['ROU_NEXT_TASK'] as $iKey => $aRow)
{
$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'];
$aFields['GAT_UID'] = $aData['GAT_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'];
$rou_id = $oRoute->create($aFields);
unset($aFields);
}
break;
case 'PARALLEL-BY-EVALUATION':
foreach ($aData['ROU_NEXT_TASK'] as $iKey => $aRow)
{
$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'];
$aFields['GAT_UID'] = $aData['GAT_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'];
$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'];
$aFields['GAT_UID'] = $aData['GAT_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'];
$routeData = $oTasks->getRouteByType($aData['PROCESS'], $aData['ROU_NEXT_TASK'][0], $aData['ROU_TYPE']);
foreach($routeData as $route)
{
$sFields['ROU_UID'] = $route['ROU_UID'];
$rou_id = $oRoute->update($sFields);
}
$rou_id =$oRoute->create($aFields);
unset($aFields);
}
break;
}
echo $rou_id;
}
?>

View File

@@ -1,398 +0,0 @@
<?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,$oData->cordinate->x,$oData->cordinate->y);
echo $sOutput;
break;
case 'saveTaskPosition':
$sOutput = $oProcessMap->saveTaskPosition($oData->uid, $oData->position->x, $oData->position->y);
echo $sOutput;
break;
case 'saveEventPosition':
$sOutput = $oProcessMap->saveEventPosition($oData->uid, $oData->position->x, $oData->position->y);
echo $sOutput;
break;
case 'saveGatewayPosition':
$sOutput = $oProcessMap->saveGatewayPosition($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 'addGateway':
$sOutput = $oProcessMap->addGateway($oData);
echo $sOutput;
break;
case 'deleteGateway':
$sOutput = $oProcessMap->deleteGateway($oData->pro_uid, $oData->gat_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,$oData->task_uid);
echo $sOutput;
break;
case 'updateText':
$sOutput = $oProcessMap->updateText($oData->uid, $oData->label, $oData->next_uid);
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 'assignProcessUser':
$oProcessMap->assignProcessUser($oData->PRO_UID, $oData->USR_UID);
break;
case 'removeProcessUser':
$oProcessMap->removeProcessUser($oData->PU_UID);
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 'editObjectPermission':
// we also need the process uid variable for the function.
$oProcessMap->editObjectPermission($oData->op_uid,$oData->pro_uid);
break;
case 'triggersList':
$sOutput = $oProcessMap->getTriggers($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 'deleteStartEvent':
$aData['TAS_UID'] = $oData->tas_uid;
$aData['TAS_START'] = $oData->tas_start;
$aData['TAS_EVN_UID'] = '';
$oTask->update($aData);
if(isset($oData->evn_uid))
$oEvent->remove($oData->evn_uid);
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 'saveEvents':
$sOutput = $oProcessMap->saveExtEvents($oData);
echo $sOutput;
break;
case 'addEvent':
$sOutput = $oProcessMap->saveExtddEvents($oData);
echo $sOutput;
/*
$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)){
$oEvn_uid='';
$aData['EVN_RELATED_TO'] = 'SINGLE';
$aData['TAS_UID'] = $oData->tas_uid;
$oTaskData = $oTask->load($aData['TAS_UID']);
if($oTaskData['TAS_EVN_UID'] == ''){
$oEvn_uid = $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']);
$out = array();
$in = array();
if(isset($_POST['VAR_OUT']) && $_POST['VAR_OUT'] != ''){
$varOut = explode('|',$_POST['VAR_OUT']);
$aVarOut1 = G::json_decode($varOut[0]);
$aVarOut2 = G::json_decode($varOut[1]);
for($i=1; $i<=count($aVarOut1); $i++){
$out[$aVarOut1[$i-1]]= $aVarOut2[$i-1];
}
}
if(isset($_POST['VAR_IN']) && $_POST['VAR_IN'] != ''){
$varIn = explode('|',$_POST['VAR_IN']);
$aVarIn1 = G::json_decode($varIn[0]);
$aVarIn2 = G::json_decode($varIn[1]);
for($i=1; $i<=count($aVarIn1); $i++){
$in[$aVarIn1[$i-1]]= $aVarIn2[$i-1];
}
}
if($_POST['VAR_IN'] == '')
$in[$_POST['VAR_IN']] = '';
//Getting first Tasks of selected process
$aNewCase = $oProcessMap->subProcess_TaskIni($_POST['PRO_UID']);
$i = 0;
foreach ($aNewCase as $aRow) {
if ($i > 0 && $aRow['pro_uid'] == $_POST['sProcessUID']) {
$sTASKS = $aRow['uid'];
}
$i++;
}
//$aTask=($_POST['TASKS']!=0)?$oTask->load($_POST['TASKS']):0;
$aTask=($sTASKS!=0)?$oTask->load($sTASKS):0;
//$aTask['PRO_UID']=0;
if ( isset ( $_POST['SP_SYNCHRONOUS']) && $_POST['SP_SYNCHRONOUS'] == '' ) {
$_POST['SP_SYNCHRONOUS'] = '0';
}
if ( !isset ( $_POST['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' => $sTASKS,
'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);
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;
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;
case 'deleteTriggers':
try{
require_once('classes/model/Triggers.php');
require_once('classes/model/StepTrigger.php');
$TRI_UIDS = explode(',', $_POST['TRI_UID']);
foreach($TRI_UIDS as $i=>$TRI_UID) {
$oTrigger = new Triggers();
$triggerObj=$oTrigger->load($TRI_UID);
$oTrigger->remove($TRI_UID);
$oStepTrigger = new StepTrigger();
$oStepTrigger->removeTrigger($TRI_UID);
}
$result->success = true;
$result->message = G::LoadTranslation('ID_TRIGGERS_REMOVED');
}
catch (Exception $e) {
$result->success = false;
$result->message = $e->getMessage();
}
print G::json_encode($result);
break;
case 'getOutputDocsTemplates':
require_once 'classes/model/OutputDocument.php';
$ooutputDocument = new OutputDocument();
if (isset($_GET['OUT_DOC_UID'])) {
$rows = $ooutputDocument->load($_GET['OUT_DOC_UID']);
$tmpData = G::json_encode( $rows ) ;
$tmpData = str_replace("\\/","/",'{success:true,data:'.$tmpData.'}'); // unescape the slashes
$result = $tmpData;
echo $result;
break;
}
}
}
?>

View File

@@ -1,179 +0,0 @@
<?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:'.G::json_encode($message).'}');
}
?>

View File

@@ -1,67 +0,0 @@
<?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 = G::json_encode( $rows ) ;
$result = str_replace("\\/","/",'{success:true,data:'.$result.'}'); // unescape the slashes
}
else
{
$result = '{failure:true}'; // unescape the slashes
}
echo $result;
}
//print G::json_encode( $result ) ;
}
catch ( Exception $e ) {
print G::json_encode ( $e->getMessage() );
}
?>

View File

@@ -1,18 +0,0 @@
<?php
G::LoadClass('processMap');
$oProcessMap = new processMap(new DBConnection);
if (isset($_GET['pid'] ))
{
$rows = $oProcessMap->getExtCaseTrackerObjectsCriteria($_GET['pid']);
}
if (isset($_GET['tid'] ))
{
$rows = $oProcessMap->getAvailableExtCaseTrackerObjects($_GET['tid']);
}
array_shift($rows);
$result['totalCount'] = count($rows);
$result['data'] = $rows;
print G::json_encode($result);
?>

View File

@@ -1,27 +0,0 @@
<?php
try
{
G::LoadClass('processMap');
$oProcessMap = new processMap(new DBConnection);
if ( isset($_GET['pid']) )
{
$rows = $oProcessMap->getExtCriteriaDBSList($_GET['pid']);
}
if(isset($_GET['tid']))
{
require_once 'classes/model/DbSource.php';
$o = new DbSource();
$rows = $o->load($_GET['tid']);
}
$tmpData = G::json_encode( $rows ) ;
$tmpData = str_replace("\\/","/",'{success:true,data:'.$tmpData.'}'); // unescape the slashes
$result = $tmpData;
echo $result;
}
catch ( Exception $e ) {
print G::json_encode ( $e->getMessage() );
}
?>

View File

@@ -1,37 +0,0 @@
<?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;
}
}
}
//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 G::json_encode( $result ) ;
}
catch ( Exception $e ) {
print G::json_encode ( $e->getMessage() );
}

View File

@@ -1,27 +0,0 @@
<?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 = G::json_encode( $aRows );
$result = str_replace("\\/","/",'{success:true,data:'.$result.'}'); // unescape the slashes
/*else
{
$result = '{failure:true}'; // unescape the slashes
}*/
echo $result;
}
//print G::json_encode( $result ) ;
}
catch ( Exception $e ) {
print G::json_encode ( $e->getMessage() );
}
?>

View File

@@ -1,454 +0,0 @@
<?php
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];
}
//$_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];
}
$start = isset($_POST['start'])? $_POST['start']: 0;
$limit = isset($_POST['limit'])? $_POST['limit']: '';
switch( $_GET['action'] ) {
case 'getDynaformList' :
$result = $oProcessMap->getExtDynaformsList($start, $limit, $_GET['pid']);
print G::json_encode( $result ) ;
break;
case 'getPMTableDynaform':
$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;
}
}
$result['totalCount'] = count($rows);
$result['data'] = $rows;
print G::json_encode( $result ) ;
break;
case 'getAdditionalTables':
$rows = $oProcessMap->getExtAdditionalTablesList();
$result['totalCount'] = count($rows);
$result['data'] = $rows;
print G::json_encode( $result ) ;
break;
case 'getInputDocumentList':
$rows = $oProcessMap->getExtInputDocumentsCriteria($start, $limit,$_GET['pid']);
$result['totalCount'] = $oProcessMap->getAllInputDocumentCount();
array_shift($rows);
$result['data'] = $rows;
print G::json_encode( $result ) ;
break;
case 'editInputDocument':
require_once 'classes/model/InputDocument.php';
$oInputDocument = new InputDocument();
$rows = $oInputDocument->load($_GET['INP_DOC_UID']);
$tmpData = G::json_encode( $rows ) ;
$tmpData = str_replace("\\/","/",'{success:true,data:'.$tmpData.'}'); // unescape the slashes
$result = $tmpData;
echo $result;
break;
case 'getOutputDocument':
$rows = $oProcessMap->getExtOutputDocumentsCriteria($start, $limit,$_GET['pid']);
$result['totalCount'] = $oProcessMap->getAllOutputDocumentCount();
array_shift($rows);
$result['data'] = $rows;
print G::json_encode( $result ) ;
break;
case 'editObjectPermission':
$rows = $oProcessMap->editExtObjectPermission($_GET['pid'],$_GET['op_uid']);
//array_shift($rows);
$tmpData = G::json_encode( $rows ) ;
$tmpData = str_replace("\\/","/",'{success:true,data:'.$tmpData.'}'); // unescape the slashes
$result = $tmpData;
echo $result;
break;
case 'editOutputDocument':
require_once 'classes/model/OutputDocument.php';
$oOutputDocument = new OutputDocument();
$rows = $oOutputDocument->load($_GET['tid']);
$tmpData = G::json_encode( $rows ) ;
$tmpData = str_replace("\\/","/",'{success:true,data:'.$tmpData.'}'); // unescape the slashes
$result = $tmpData;
echo $result;
break;
case 'getReportTables':
$rows = $oProcessMap->getExtReportTables($start, $limit,$_GET['pid']);
$result['totalCount'] = $oProcessMap->getAllReportTableCount();
$result['data'] = $rows;
print G::json_encode( $result ) ;
break;
case 'editReportTables':
require_once 'classes/model/ReportTable.php';
$oReportTable = new ReportTable();
$rows = $oReportTable->load($_GET['REP_TAB_UID'],$_GET['pid']);
$tmpData = G::json_encode( $rows ) ;
$tmpData = str_replace("\\/","/",'{success:true,data:'.$tmpData.'}'); // unescape the slashes
$result = $tmpData;
echo $result;
break;
case 'getReportTableType':
if(isset($_GET['pid']) && $_GET['type'] == 'NORMAL')
{
$aTheFields = array();
$aTheFields = getDynaformsVars($_GET['pid'], false);
foreach ($aTheFields as $aField)
{
$rows[] = array('FIELD_UID' => $aField['sName'] . '-' . $aField['sType'],
'FIELD_NAME' => $aField['sName']);
}
}
else if (isset($_GET['pid']) && $_GET['type'] == 'GRID')
{
$aTheFields = array();
$aTheFields = getGridsVars($_GET['pid']);
foreach ($aTheFields as $aField)
{
$rows[] = array('FIELD_UID' => $aField['sName'] . '-' . $aField['sXmlForm'],
'FIELD_NAME' => $aField['sName']);
}
}
$result['totalCount'] = count($rows);
$result['data'] = $rows;
print G::json_encode( $result ) ;
break;
case 'getDatabaseConnectionList':
$rows = $oProcessMap->getExtCriteriaDBSList($start, $limit,$_GET['pid']);
$result['totalCount'] = $oProcessMap->getAllDbSourceCount();
$result['data'] = $rows;
print G::json_encode( $result ) ;
break;
case 'editDatabaseConnection':
require_once 'classes/model/DbSource.php';
$o = new DbSource();
$rows = $o->load($_GET['dbs_uid'],$_GET['pid']);
$tmpData = G::json_encode( $rows ) ;
$tmpData = str_replace("\\/","/",'{success:true,data:'.$tmpData.'}'); // unescape the slashes
$result = $tmpData;
echo $result;
break;
case 'process_Supervisors':
$rows = $oProcessMap->listExtProcessesSupervisors($start, $limit, $_GET['pid']);
$result['totalCount'] = $oProcessMap->getAllProcessSupervisorsCount();
$result['data'] = $rows;
print G::json_encode( $result ) ;
break;
case 'availableProcessesSupervisors':
$rows = $oProcessMap->listExtNoProcessesUser($_GET['pid']);
$result['totalCount'] = count($rows);
$result['data'] = $rows;
print G::json_encode( $result ) ;
break;
case 'supervisorDynaforms':
$rows = $oProcessMap->getExtSupervisorDynaformsList($start, $limit,$_GET['pid']);
$result['totalCount'] = $oProcessMap->getAllSupervisorDynaformsCount();
$result['data'] = $rows;
print G::json_encode( $result ) ;
break;
case 'availableSupervisorDynaforms':
$rows = $oProcessMap->getExtAvailableSupervisorDynaformsList($_GET['pid']);
$result['totalCount'] = count($rows);
$result['data'] = $rows;
print G::json_encode( $result ) ;
break;
case 'supervisorInputDoc':
$rows = $oProcessMap->getExtSupervisorInputsList($start, $limit,$_GET['pid']);
$result['totalCount'] = $oProcessMap->getAllSupervisorInputsCount();
$result['data'] = $rows;
print G::json_encode( $result ) ;
break;
case 'availableSupervisorInputDoc':
$rows = $oProcessMap->getExtAvailableSupervisorInputsList($_GET['pid']);
$result['totalCount'] = count($rows);
$result['data'] = $rows;
print G::json_encode( $result ) ;
break;
case 'getAssignedCaseTrackerObjects':
$rows = $oProcessMap->getExtCaseTrackerObjectsCriteria($start, $limit, $_GET['pid']);
$result['totalCount'] = $oProcessMap->getAllCaseTrackerObjectCount();
array_shift($rows);
$result['data'] = $rows;
print G::json_encode( $result ) ;
break;
case 'getAvailableCaseTrackerObjects':
$rows = $oProcessMap->getAvailableExtCaseTrackerObjects($_GET['pid']);
array_shift($rows);
$result['totalCount'] = count($rows);
$result['data'] = $rows;
print G::json_encode( $result ) ;
break;
case 'getAvailableSteps':
$rows = $oProcessMap->getExtAvailableBBCriteria($_GET['pid'], $_GET['tid']);
array_shift($rows);
$result['totalCount'] = count($rows);
$result['data'] = $rows;
print G::json_encode( $result ) ;
break;
case 'getAssignedSteps':
$rows = $oProcessMap->getExtStepsCriteria($start, $limit,$_GET['tid']);
$result['totalCount'] = $oProcessMap->getAllStepCount();
array_shift($rows);
$result['data'] = $rows;
print G::json_encode( $result ) ;
break;
case 'getAssignedUsersList':
$rows = $oProcessMap->usersExtList($start, $limit, $_GET['pid'], $_GET['tid']);
$result['totalCount'] = $oProcessMap->getAllTaskUserCount();
array_shift($rows);
$result['data'] = $rows;
print G::json_encode( $result ) ;
break;
case 'getAvailableUsersList':
$rows = $oProcessMap->getAvailableExtUsersCriteria($_GET['tid']);
$result['totalCount'] = count($rows);
$result['data'] = $rows;
print G::json_encode( $result ) ;
break;
case 'getAvailableStepTriggers':
$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);
$result['totalCount'] = count($rows);
$result['data'] = $rows;
print G::json_encode( $result ) ;
break;
case 'getAssignedStepTriggers':
$rows = $oProcessMap->getExtStepTriggersCriteria($start, $limit, $sStep, $_GET['tid'], $sType);
$result['totalCount'] = $oProcessMap->getAllStepTriggerCount();
$result['data'] = $rows;
print G::json_encode( $result ) ;
break;
case 'availableUsers':
$rows = $oProcessMap->getExtAvailableUsersList($_GET['tid']);
array_shift($rows);
$result['totalCount'] = count($rows);
$result['data'] = $rows;
print G::json_encode( $result ) ;
break;
case 'assignedUsers':
$rows = $oProcessMap->getExtusersadhoc($start, $limit,$_GET['pid'], $_GET['tid']);
$result['totalCount'] = $oProcessMap->getAllTaskUserCount();
array_shift($rows);
$result['data'] = $rows;
print G::json_encode( $result ) ;
break;
case 'getTaskPropertiesList':
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_TYPE' && $value == 'NORMAL')
$rows[$key] = false;
else if($key == 'TAS_TYPE' && $value == 'ADHOC')
$rows[$key] = true;
}
$tmpData = G::json_encode( $rows ) ;
$tmpData = str_replace("\\/","/",'{success:true,data:'.$tmpData.'}'); // unescape the slashes
$result = $tmpData;
echo $result;
break;
case 'getSubProcessProperties':
if($_GET['type'] == 2) //Loading sub process details
{
$rows = $oProcessMap->subProcessExtProperties($_GET['pid'], $_GET['tid'],'','0');
$tmpData = G::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 G::json_encode( $result ) ;
}
break;
case 'getObjectPermission':
$rows = $oProcessMap->getExtObjectsPermissions($start, $limit,$_GET['pid']);
$result['totalCount'] = $oProcessMap->getAllObjectPermissionCount();
$result['data'] = $rows;
print G::json_encode( $result ) ;
break;
case 'getObjectPermissionType':
$rows = $oProcessMap->newExtObjectPermission($_GET['pid'],$_GET['objectType']);
array_shift($rows);
$result['totalCount'] = count($rows);
$result['data'] = $rows;
print G::json_encode( $result ) ;
break;
case 'process_Edit':
$rows = $oProcessMap->editProcessNew($_GET['pid']);
$tmpData = G::json_encode( $rows ) ;
$tmpData = str_replace("\\/","/",'{success:true,data:'.$tmpData.'}'); // unescape the slashes
$result = $tmpData;
echo $result;
break;
case 'getTriggersList':
$rows = $oProcessMap->getExtTriggersList($start, $limit, $_GET['pid']);
$result['totalCount'] = $oProcessMap->getAllTriggersCount();
array_shift($rows);
$result['data'] = $rows;
print G::json_encode( $result ) ;
break;
case 'editTriggers':
require_once('classes/model/Triggers.php');
if (isset($_GET['TRI_UID']))
{
$oTrigger = new Triggers();
$rows = $oTrigger->load($_GET['TRI_UID']);
}
$tmpData = G::json_encode( $rows ) ;
$tmpData = str_replace("\\/","/",'{success:true,data:'.$tmpData.'}'); // unescape the slashes
$result = $tmpData;
echo $result;
break;
case 'getCaseTracker':
//$rows = $oProcessMap->caseTracker($_GET['pid']);
$oCaseTracker = new CaseTracker ( );
$rows = $oCaseTracker->load($_GET['pid']);
$tmpData = G::json_encode( $rows ) ;
$tmpData = str_replace("\\/","/",'{success:true,data:'.$tmpData.'}'); // unescape the slashes
$result = $tmpData;
echo $result;
break;
case 'getVariables':
$aFields = getDynaformsVars($_GET['pid']);
if(isset ($_GET['type']))
$aType = $_GET['type'];
else $aType='';
$rows[0] = Array (
'fieldname' => 'char',
'variable' => 'char',
'type' => 'type',
'label' => 'char'
);
foreach ( $aFields as $aField ) {
switch ($aType){
case "system":
if($aField['sType']=="system"){
$rows[] = Array (
'fieldname' => $_GET['sFieldName'],
'variable' => $_GET['sSymbol'] . $aField['sName'],
'variable_label' => '<div class="pm__dynavars"> <a id="dynalink" href=# onclick="insertFormVar(\''.$_GET['sFieldName'].'\',\''.$_GET['sSymbol'] . $aField['sName'].'\');">'.$_GET['sSymbol'] . $aField['sName'].'</a></div>',
'type' => $aField['sType'],
'label' => $aField['sLabel']
);
}
break;
case "process":
if($aField['sType']!="system"){
$rows[] = Array (
'fieldname' => $_GET['sFieldName'],
'variable' => $_GET['sSymbol'] . $aField['sName'],
'variable_label' => '<div class="pm__dynavars"> <a id="dynalink" href=# onclick="insertFormVar(\''.$_GET['sFieldName'].'\',\''.$_GET['sSymbol'] . $aField['sName'].'\');">'.$_GET['sSymbol'] . $aField['sName'].'</a></div>',
'type' => $aField['sType'],
'label' => $aField['sLabel']
);
}
break;
default:
$rows[] = Array (
'fieldname' => $_GET['sFieldName'],
'variable' => $_GET['sSymbol'] . $aField['sName'],
'variable_label' => '<div class="pm__dynavars"> <a id="dynalink" href=# onclick="insertFormVar(\''.$_GET['sFieldName'].'\',\''.$_GET['sSymbol'] . $aField['sName'].'\');">'.$_GET['sSymbol'] . $aField['sName'].'</a></div>',
'type' => $aField['sType'],
'label' => $aField['sLabel']
);
break;
}
}
array_shift($rows);
$result['totalCount'] = count($rows);
$result['data'] = $rows;
print G::json_encode($result);
break;
}
//$result['data'] = $rows;
//print G::json_encode( $result ) ;
/*$tmpData = G::json_encode( $rows ) ;
$tmpData = str_replace("\\/","/",'{success:true,data:'.$tmpData.'}'); // unescape the slashes
$result = $tmpData;
echo $result;*/

View File

@@ -1,30 +0,0 @@
<?php
try
{
G::LoadClass('processMap');
$oProcessMap = new processMap(new DBConnection);
if ( isset($_GET['pid'] ) )
{
$rows = $oProcessMap->getExtInputDocumentsCriteria($_GET['pid']);
array_shift($rows);
}
if (isset($_GET['INP_DOC_UID'])) {
require_once 'classes/model/InputDocument.php';
$oInputDocument = new InputDocument();
$rows = $oInputDocument->load($_GET['INP_DOC_UID']);
}
// $result['totalCount'] = count($rows);
// $result['data'] = $rows;
// print G::json_encode( $result) ;
$tmpData = G::json_encode( $rows ) ;
$tmpData = str_replace("\\/","/",'{success:true,data:'.$tmpData.'}'); // unescape the slashes
$result = $tmpData;
echo $result;
}
catch ( Exception $e ) {
print G::json_encode ( $e->getMessage() );
}

View File

@@ -1,18 +0,0 @@
<?php
G::LoadClass('processMap');
$oProcessMap = new processMap(new DBConnection);
if ( isset($_GET['pid'] ) && !isset($_GET ['action']))
{
$rows = $oProcessMap->getExtObjectsPermissions($_GET['pid']);
}
if ( isset($_GET['pid'] )&& isset($_GET['action']) )
{
$rows = $oProcessMap->newExtObjectPermission($_GET['pid'],$_GET['action']);
array_shift($rows);
}
$result['totalCount'] = count($rows);
$result['data'] = $rows;
print G::json_encode($result);
?>

View File

@@ -1,36 +0,0 @@
<?php
try
{
G::LoadClass('processMap');
$oProcessMap = new processMap(new DBConnection);
if ( isset($_GET['pid'] ) )
{
$rows = $oProcessMap->getExtOutputDocumentsCriteria($_GET['pid']);
array_shift($rows);
}
// else
// {
// $rows = $oProcessMap->getExtInputDocumentsCriteria($_GET['pid']);
// }
if (isset($_GET['tid']))
{
require_once 'classes/model/OutputDocument.php';
$oOutputDocument = new OutputDocument();
$rows = $oOutputDocument->load($_GET['tid']);
}
$tmpData = G::json_encode( $rows ) ;
$tmpData = str_replace("\\/","/",'{success:true,data:'.$tmpData.'}'); // unescape the slashes
$result = $tmpData;
echo $result;
/* $result['totalCount'] = count($rows);
$result['data'] = $rows;
print G::json_encode( $result) ;*/
}
catch ( Exception $e ) {
print G::json_encode ( $e->getMessage() );
}

View File

@@ -1,40 +0,0 @@
<?php
try
{
G::LoadClass('processMap');
$oProcessMap = new processMap(new DBConnection);
$processUID = $_GET['pid'];
$action = $_GET['action'];
switch($action)
{
case 'process_User':
$rows = $oProcessMap->listExtProcessesUser($processUID);
break;
case 'availableProcessesUser':
$rows = $oProcessMap->listExtNoProcessesUser($processUID);
break;
case 'supervisorDynaforms':
$rows = $oProcessMap->getExtSupervisorDynaformsList($processUID);
break;
case 'availableSupervisorDynaforms':
$rows = $oProcessMap->getExtAvailableSupervisorDynaformsList($processUID);
break;
case 'supervisorInputDoc':
$rows = $oProcessMap->getExtSupervisorInputsList($processUID);
break;
case 'availableSupervisorInputDoc':
$rows = $oProcessMap->getExtAvailableSupervisorInputsList($processUID);
break;
}
$result['totalCount'] = count($rows);
$result['data'] = $rows;
print G::json_encode( $result ) ;
}
catch ( Exception $e ) {
print G::json_encode ( $e->getMessage() );
}
?>

View File

@@ -1,58 +0,0 @@
<?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');
$oProcess = new Processes();
$proFields = $oProcess->serializeProcess( $sProUid );
$Fields = $oProcess->saveSerializedProcess ( $proFields );
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'];
$result = G::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

@@ -1,45 +0,0 @@
<?php
try
{
G::LoadClass('processMap');
$oProcessMap = new processMap(new DBConnection);
if(isset($_GET['pid']) && !isset($_GET['type'])){
$rows = $oProcessMap->getExtReportTables($_GET['pid']);
}
else if(isset($_GET['pid']) && $_GET['type'] == 'NORMAL')
{
$aTheFields = array();
$aTheFields = getDynaformsVars($_GET['pid'], false);
foreach ($aTheFields as $aField) {
$rows[] = array('FIELD_UID' => $aField['sName'] . '-' . $aField['sType'],
'FIELD_NAME' => $aField['sName']);
}
}
else if(isset($_GET['pid']) && $_GET['type'] == 'GRID'){
$aTheFields = array();
$aTheFields = getGridsVars($_GET['pid']);
foreach ($aTheFields as $aField) {
$rows[] = array('FIELD_UID' => $aField['sName'] . '-' . $aField['sXmlForm'],
'FIELD_NAME' => $aField['sName']);
}
}
if(isset($_GET['tid']))
{
require_once 'classes/model/ReportTable.php';
$o = new ReportTable();
$rows = $o->load($_GET['tid']);
}
$result['totalCount'] = count($rows);
$result['data'] = $rows;
print G::json_encode( $result ) ;
}
catch ( Exception $e ) {
print G::json_encode ( $e->getMessage() );
}
?>

View File

@@ -1,40 +0,0 @@
<?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 G::json_encode( $result ) ;
}
catch ( Exception $e ) {
print G::json_encode ( $e->getMessage() );
}
?>

View File

@@ -1,31 +0,0 @@
<?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 = G::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 G::json_encode( $result ) ;
}
}
catch ( Exception $e ) {
print G::json_encode ( $e->getMessage() );
}
?>

View File

@@ -1,64 +0,0 @@
<?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 = G::json_encode( $rows ) ;
$tmpData = str_replace("\\/","/",'{success:true,data:'.$tmpData.'}'); // unescape the slashes
$result = $tmpData;
echo $result;
}
catch ( Exception $e ) {
print G::json_encode ( $e->getMessage() );
}
?>

View File

@@ -1,28 +0,0 @@
<?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 G::json_encode( $result ) ;
}
catch ( Exception $e ) {
print G::json_encode ( $e->getMessage() );
}
?>

View File

@@ -1,24 +0,0 @@
<?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']);
}
$result['totalCount'] = count($rows);
$result['data'] = $rows;
print G::json_encode( $result ) ;
}
catch ( Exception $e ) {
print G::json_encode ( $e->getMessage() );
}
?>

View File

@@ -1,60 +0,0 @@
<?php
G::LoadClass('processMap');
G::LoadClass('XmlForm_Field');
//$oXMLfield = new XmlForm_Field_TextPM(new DBConnection);
$aFields = getDynaformsVars($_GET['pid']);
if(isset ($_GET['type']))
$aType = $_GET['type'];
else $aType='';
$aRows[0] = Array (
'fieldname' => 'char',
'variable' => 'char',
'type' => 'type',
'label' => 'char'
);
foreach ( $aFields as $aField ) {
switch ($aType){
case "system":
if($aField['sType']=="system"){
$aRows[] = Array (
'fieldname' => $_GET['sFieldName'],
'variable' => $_GET['sSymbol'] . $aField['sName'],
'variable_label' => '<div class="pm__dynavars"> <a id="dynalink" href=# onclick="insertFormVar(\''.$_GET['sFieldName'].'\',\''.$_GET['sSymbol'] . $aField['sName'].'\');">'.$_GET['sSymbol'] . $aField['sName'].'</a></div>',
'type' => $aField['sType'],
'label' => $aField['sLabel']
);
}
break;
case "process":
if($aField['sType']!="system"){
$aRows[] = Array (
'fieldname' => $_GET['sFieldName'],
'variable' => $_GET['sSymbol'] . $aField['sName'],
'variable_label' => '<div class="pm__dynavars"> <a id="dynalink" href=# onclick="insertFormVar(\''.$_GET['sFieldName'].'\',\''.$_GET['sSymbol'] . $aField['sName'].'\');">'.$_GET['sSymbol'] . $aField['sName'].'</a></div>',
'type' => $aField['sType'],
'label' => $aField['sLabel']
);
}
break;
default:
$aRows[] = Array (
'fieldname' => $_GET['sFieldName'],
'variable' => $_GET['sSymbol'] . $aField['sName'],
'variable_label' => '<div class="pm__dynavars"> <a id="dynalink" href=# onclick="insertFormVar(\''.$_GET['sFieldName'].'\',\''.$_GET['sSymbol'] . $aField['sName'].'\');">'.$_GET['sSymbol'] . $aField['sName'].'</a></div>',
'type' => $aField['sType'],
'label' => $aField['sLabel']
);
break;
}
}
array_shift($aRows);
$result['totalCount'] = count($aRows);
$result['data'] = $aRows;
print G::json_encode($result);
?>

View File

@@ -1,136 +0,0 @@
<?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 does not exist";
$result['timestamp'] = date('Y-m-d H:i:s');
echo G::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 G::json_encode($result);
die;
}
$aTasks = G::json_decode ( $_POST['tasks'] );
$aRoutes = G::json_decode ( $_POST['routes'] );
$aEvents = G::json_decode ( $_POST['events'] );
$aGateways = G::json_decode ( $_POST['gateways'] );
$aAnnotations = G::json_decode ( $_POST['annotations'] );
$aSubprocess = G::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);
$result->success = true;
$result->msg = G::LoadTranslation('ID_PROCESS_SAVE_SUCCESS');
} catch (Exception $e) {
$result->success = false;
$result->msg = $e->getMessage();
}
print G::json_encode($result);

View File

@@ -1,36 +0,0 @@
<?php
/**
* processes_DownloadFile.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.
*/
//add more security, and catch any error or exception
$sFileName = $_GET['p'] . '.xpdl';
$file = PATH_DOCUMENT . 'output' . PATH_SEP . $sFileName . 'tpm';
$filex = PATH_DOCUMENT . 'output' . PATH_SEP . $sFileName;
if (file_exists( $file )) {
rename( $file, $filex );
}
$realPath = PATH_DOCUMENT . 'output' . PATH_SEP . $sFileName;
G::streamFile( $realPath, true );

View File

@@ -1,132 +0,0 @@
<?php
/**
* processes_ImportFileExisting.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 {
//load the variables
G::LoadClass( 'xpdl' );
$oProcess = new Xpdl();
if (! isset( $_POST['form']['IMPORT_OPTION'] )) {
throw (new Exception( 'Please select an option before to continue' ));
}
if (! isset( $_POST['form']['GROUP_IMPORT_OPTION'] )) {
$action = "none";
} else {
$action = $_POST['form']['GROUP_IMPORT_OPTION'];
}
$option = $_POST['form']['IMPORT_OPTION'];
$filename = $_POST['form']['PRO_FILENAME'];
$ObjUid = $_POST['form']['OBJ_UID'];
$path = PATH_DOCUMENT . 'input' . PATH_SEP;
$oData = $oProcess->getProcessDataXpdl( $path . $filename );
$Fields['PRO_FILENAME'] = $filename;
$sProUid = $oData->process['PRO_UID'];
$oData->process['PRO_UID_OLD'] = $sProUid;
if (! isset( $oData->tasks ))
$oData->tasks = array ();
$tasks = $oData->tasks;
// code added by gustavo cruz gustavo-at-colosa-dot-com
// evaluate actions or import options
switch ($action) {
case "none":
$groupsDuplicated = $oProcess->checkExistingGroups( $oData->groupwfs );
break;
case "rename":
$oData->groupwfs = $oProcess->renameExistingGroups( $oData->groupwfs );
$groupsDuplicated = $oProcess->checkExistingGroups( $oData->groupwfs );
break;
case "merge":
$oBaseGroup = $oData->groupwfs;
$oNewGroup = $oProcess->mergeExistingGroups( $oData->groupwfs );
$oData->groupwfs = $oNewGroup;
$oData->taskusers = $oProcess->mergeExistingUsers( $oBaseGroup, $oNewGroup, $oData->taskusers );
break;
default:
$groupsDuplicated = $oProcess->checkExistingGroups( $oData->groupwfs );
break;
}
// if there are duplicated groups render the group importing options
if ($groupsDuplicated > 0) {
$Fields['PRO_FILENAME'] = $filename;
$Fields['PRO_PATH'] = $path;
$Fields['IMPORT_OPTION'] = $option;
$Fields['OBJ_UID'] = $ObjUid;
$G_MAIN_MENU = 'processmaker';
$G_ID_MENU_SELECTED = 'PROCESSES';
$G_PUBLISH = new Publisher();
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'processes/processes_ValidatingGroups', '', $Fields, 'processes_ImportExisting' );
G::RenderPage( 'publish', "blank" );
die();
}
//end added code
//Update the current Process, overwriting all tasks and steps
if ($option == 1) {
$oProcess->updateProcessFromData( $oData, $path . $filename );
if (file_exists( PATH_OUTTRUNK . 'compiled' . PATH_SEP . 'xmlform' . PATH_SEP . $sProUid )) {
$oDirectory = dir( PATH_OUTTRUNK . 'compiled' . PATH_SEP . 'xmlform' . PATH_SEP . $sProUid );
while ($sObjectName = $oDirectory->read()) {
if (($sObjectName != '.') && ($sObjectName != '..')) {
unlink( PATH_OUTTRUNK . 'compiled' . PATH_SEP . 'xmlform' . PATH_SEP . $sProUid . PATH_SEP . $sObjectName );
}
}
$oDirectory->close();
}
$sNewProUid = $sProUid;
}
//Disable current Process and create a new version of the Process
if ($option == 2) {
$oProcess->disablePreviousProcesses( $sProUid );
$sNewProUid = $oProcess->getUnusedProcessGUID();
$oProcess->setProcessGuid( $oData, $sNewProUid );
$oProcess->setProcessParent( $oData, $sProUid );
$oData->process['PRO_TITLE'] = "New - " . $oData->process['PRO_TITLE'] . ' - ' . date( 'M d, H:i' );
$oProcess->renewAll( $oData );
$oProcess->createProcessFromDataXpdl( $oData, $tasks );
}
//Create a completely new Process without change the current Process
if ($option == 3) {
//krumo ($oData); die;
$sNewProUid = $oProcess->getUnusedProcessGUID();
$oProcess->setProcessGuid( $oData, $sNewProUid );
$oData->process['PRO_TITLE'] = "Copy of - " . $oData->process['PRO_TITLE'] . ' - ' . date( 'M d, H:i' );
$oProcess->renewAll( $oData );
$oProcess->createProcessFromDataXpdl( $oData, $tasks );
}
G::header( 'Location: processes_Map?PRO_UID=' . $sNewProUid );
} catch (Exception $e) {
$G_PUBLISH = new Publisher();
$aMessage['MESSAGE'] = $e->getMessage();
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'login/showMessage', '', $aMessage );
G::RenderPage( 'publish', "blank" );
}

View File

@@ -1,105 +0,0 @@
<?php
/**
* processes_ImportFile.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 {
//load the variables
G::LoadClass( 'xpdl' );
$oProcess = new Xpdl();
if (isset( $_POST['form']['PRO_FILENAME'] )) {
$path = $_POST['form']['PRO_PATH'];
$filename = $_POST['form']['PRO_FILENAME'];
$action = $_POST['form']['GROUP_IMPORT_OPTION'];
} else {
//save the file, if it's not saved
if ($_FILES['form']['error']['PROCESS_FILENAME'] == 0) {
$filename = $_FILES['form']['name']['PROCESS_FILENAME'];
$path = PATH_DOCUMENT . 'input' . PATH_SEP;
$tempName = $_FILES['form']['tmp_name']['PROCESS_FILENAME'];
$action = "none";
G::uploadFile( $tempName, $path, $filename );
}
}
$oData = $oProcess->getProcessDataXpdl( $path . $filename );
$Fields['PRO_FILENAME'] = $filename;
$Fields['IMPORT_OPTION'] = 2;
$sProUid = $oData->process['PRO_UID'];
$oData->process['PRO_UID_OLD'] = $sProUid;
if ($oProcess->processExists( $sProUid )) {
$G_MAIN_MENU = 'processmaker';
$G_ID_MENU_SELECTED = 'PROCESSES';
$G_PUBLISH = new Publisher();
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'processes/processes_ImportExistingXpdl', '', $Fields, 'processes_ImportExistingXpdl' );
G::RenderPage( 'publish', "blank" );
die();
}
// code added by gustavo cruz gustavo-at-colosa-dot-com
// evaluate actions or import options
switch ($action) {
case "none":
$groupsDuplicated = $oProcess->checkExistingGroups( $oData->groupwfs );
break;
case "rename":
$oData->groupwfs = $oProcess->renameExistingGroups( $oData->groupwfs );
$groupsDuplicated = $oProcess->checkExistingGroups( $oData->groupwfs );
break;
case "merge":
$oBaseGroup = $oData->groupwfs;
$oNewGroup = $oProcess->mergeExistingGroups( $oData->groupwfs );
$oData->groupwfs = $oNewGroup;
$oData->taskusers = $oProcess->mergeExistingUsers( $oBaseGroup, $oNewGroup, $oData->taskusers );
break;
default:
$groupsDuplicated = $oProcess->checkExistingGroups( $oData->groupwfs );
break;
}
// if there are duplicated groups render the group importing options
if ($groupsDuplicated > 0) {
$Fields['PRO_FILENAME'] = $filename;
$Fields['PRO_PATH'] = $path;
$Fields['IMPORT_OPTION'] = 2;
$G_MAIN_MENU = 'processmaker';
$G_ID_MENU_SELECTED = 'PROCESSES';
$G_PUBLISH = new Publisher();
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'processes/processes_ValidatingGroups', '', $Fields, 'processes_ImportFile' );
G::RenderPage( 'publish', "blank" );
die();
}
// end added code
if (! isset( $oData->tasks ))
$oData->tasks = array ();
$tasks = $oData->tasks;
$oProcess->createProcessFromDataXpdl( $oData, $tasks );
G::header( 'Location: processes_Map?PRO_UID=' . $sProUid );
} catch (Exception $e) {
$G_PUBLISH = new Publisher();
$aMessage['MESSAGE'] = $e->getMessage();
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'login/showMessage', '', $aMessage );
G::RenderPage( 'publish', "blank" );
}

View File

@@ -61,7 +61,7 @@ $result->catchMessage = "";
if ($action == "uploadFileNewProcess") {
try {
//type of file, bpmn, xpdl, or pm
//type of file: only pm
$processFileType = $_REQUEST["processFileType"];
$oProcess = new stdClass();
$oData = new stdClass();
@@ -71,13 +71,12 @@ if ($action == "uploadFileNewProcess") {
if (isset( $_FILES['form']['type']['PROCESS_FILENAME'] )) {
$allowedExtensions = array ($processFileType
);
$allowedExtensions = array ('xpdl','bpmn','pm'
);
$allowedExtensions = array ('pm');
if (! in_array( end( explode( ".", $_FILES['form']['name']['PROCESS_FILENAME'] ) ), $allowedExtensions )) {
throw new Exception( G::LoadTranslation( "ID_FILE_UPLOAD_INCORRECT_EXTENSION" ) );
}
}
if ($processFileType != "pm" && $processFileType != "xpdl" && $processFileType != "bpmn") {
if ($processFileType != "pm") {
throw new Exception( G::LoadTranslation( "ID_ERROR_UPLOAD_FILE_CONTACT_ADMINISTRATOR" ) );
}
@@ -86,11 +85,6 @@ if ($action == "uploadFileNewProcess") {
$oProcess = new Processes();
}
if ($processFileType == "xpdl") {
G::LoadClass( 'xpdl' );
$oProcess = new Xpdl();
}
$result->success = true;
$result->ExistProcessInDatabase = ""; //"" -Default
//0 -Dont exist process
@@ -122,11 +116,9 @@ if ($action == "uploadFileNewProcess") {
die();
}
//if file is a .pm or .xpdl file continues normally the importing
//if file is a .pm file continues normally the importing
if ($processFileType == "pm") {
$oData = $oProcess->getProcessData( $path . $filename );
} else {
$oData = $oProcess->getProcessDataXpdl( $path . $filename );
}
reservedWordsSqlValidate( $oData );
@@ -169,11 +161,6 @@ if ($action == "uploadFileNewProcess") {
if ($result->ExistProcessInDatabase == 0 && $result->ExistGroupsInDatabase == 0) {
if ($processFileType == "pm") {
$oProcess->createProcessFromData( $oData, $path . $filename );
} else {
if (! isset( $oData->tasks ))
$oData->tasks = array ();
$tasks = $oData->tasks;
$oProcess->createProcessFromDataXpdl( $oData, $tasks );
}
}
@@ -202,7 +189,7 @@ if ($action == "uploadFileNewProcessExist") {
$sNewProUid = "";
$oProcess = new stdClass();
if ($processFileType != "pm" && $processFileType != "xpdl") {
if ($processFileType != "pm") {
throw new Exception( G::LoadTranslation( "ID_ERROR_UPLOAD_FILE_CONTACT_ADMINISTRATOR" ) );
}
@@ -210,17 +197,12 @@ if ($action == "uploadFileNewProcessExist") {
if ($processFileType == "pm") {
G::LoadClass( 'processes' );
$oProcess = new Processes();
} else {
G::LoadClass( 'xpdl' );
$oProcess = new Xpdl();
}
$path = PATH_DOCUMENT . 'input' . PATH_SEP;
if ($processFileType == "pm") {
$oData = $oProcess->getProcessData( $path . $filename );
} else {
$oData = $oProcess->getProcessDataXpdl( $path . $filename );
}
reservedWordsSqlValidate( $oData );
@@ -274,12 +256,6 @@ if ($action == "uploadFileNewProcessExist") {
if ($processFileType == "pm") {
$oProcess->createProcessFromData( $oData, $path . $filename );
} else {
if (! isset( $oData->tasks )) {
$oData->tasks = array ();
}
$tasks = $oData->tasks;
$oProcess->createProcessFromDataXpdl( $oData, $tasks );
}
}
@@ -293,12 +269,6 @@ if ($action == "uploadFileNewProcessExist") {
if ($processFileType == "pm") {
$oProcess->createProcessFromData( $oData, $path . $filename );
} else {
if (! isset( $oData->tasks )) {
$oData->tasks = array ();
}
$tasks = $oData->tasks;
$oProcess->createProcessFromDataXpdl( $oData, $tasks );
}
}
}

View File

@@ -1,184 +0,0 @@
<?php
function addNodox($obj, $padre, $indice, $contenido='', $atributos='')
{
if (is_object($padre)) {
if ($contenido=='') {
$nodo = $obj->createElement($indice);
} else {
$nodo = $obj->createElement($indice, $contenido);
}
$padre->appendChild($nodo);
} else {
if ($contenido=='') {
$nodo = $obj->createElement($indice);
} else {
$nodo = $obj->createElement($indice, $contenido);
}
$obj->appendChild($nodo);
}
if (is_array($atributos)) {
foreach ($atributos as $key => $value) {
$atributo = $obj->createAttribute($key);
$nodo->appendChild($atributo);
$texto = $obj->createTextNode($value);
$atributo->appendChild($texto);
}
}
return $nodo;
}
function derivationRules($aRoute, $doc, $nodo_derivationrule)
{
$tam = count($aRoute);
$c=0;
switch ($aRoute[$c]['ROU_TYPE'])
{
case 'SEQUENTIAL':
$nodo_routeType = addNodox($doc, $nodo_derivationrule, 'Sequential', '', '');
$nodo_nexttask = addNodox($doc, $nodo_routeType, 'NextTask', '', '');
if ($aRoute[$c]['ROU_NEXT_TASK'] != -1) {
$nodo_taskref = addNodox($doc, $nodo_nexttask, 'TaskRef', '',
array('TaskId'=> 'ID'.$aRoute[$c]['ROU_NEXT_TASK']));
} else {
$nodo_taskref = addNodox($doc, $nodo_nexttask, 'End', '', '');
}
break;
case 'EVALUATE':
$nodo_routeType = addNodox($doc, $nodo_derivationrule, 'Evaluations', '', '');
while ($c < $tam) {
$nodo_evaluation= addNodox($doc, $nodo_routeType, 'Evaluation', '', array('Condition'=> $aRoute[$c]['ROU_CONDITION']));
$nodo_nexttask = addNodox($doc, $nodo_evaluation, 'NextTask', '', '');
if ($aRoute[$c]['ROU_NEXT_TASK'] != -1) {
$nodo_taskref = addNodox($doc, $nodo_nexttask, 'TaskRef', '', array('TaskId'=> 'ID'.$aRoute[$c]['ROU_NEXT_TASK']));
} else {
$nodo_taskref = addNodox($doc, $nodo_nexttask, 'End', '', '');
}
$c++;
}
break;
case 'SELECT':
$nodo_routeType = addNodox($doc, $nodo_derivationrule, 'Selections', '', '');
while ($c < $tam) {
$nodo_selection= addNodox($doc, $nodo_routeType, 'Selection', '', array('Description'=> $aRoute[$c]['ROU_CONDITION']));
$nodo_nexttask = addNodox($doc, $nodo_selection, 'NextTask', '', '');
if ($aRoute[$c]['ROU_NEXT_TASK'] != -1) {
$nodo_taskref = addNodox($doc, $nodo_nexttask, 'TaskRef', '', array('TaskId'=> 'ID'.$aRoute[$c]['ROU_NEXT_TASK']));
} else {
$nodo_taskref = addNodox($doc, $nodo_nexttask, 'End', '', '');
}
$c++;
}
break;
case 'PARALLEL':
$nodo_routeType = addNodox($doc, $nodo_derivationrule, 'ParallelForks', '', '');
while ($c < $tam) {
$nodo_parallelfork= addNodox($doc, $nodo_routeType, 'ParallelFork', '', '');
$nodo_nexttask = addNodox($doc, $nodo_parallelfork, 'NextTask', '', '');
if ($aRoute[$c]['ROU_NEXT_TASK'] != -1) {
$nodo_taskref = addNodox($doc, $nodo_nexttask, 'TaskRef', '', array('TaskId'=> 'ID'.$aRoute[$c]['ROU_NEXT_TASK']));
} else {
$nodo_taskref = addNodox($doc, $nodo_nexttask, 'End', '', '');
}
$c++;
}
break;
case 'PARALLEL-BY-EVALUATION':
$nodo_routeType = addNodox($doc, $nodo_derivationrule, 'ParallelForksByEvaluation', '', '');
while ($c < $tam) {
$nodo_evaluation= addNodox($doc, $nodo_routeType, 'Evaluation', '', array('Condition'=> $aRoute[$c]['ROU_CONDITION']));
$nodo_nexttask = addNodox($doc, $nodo_evaluation, 'NextTask', '', '');
if ($aRoute[$c]['ROU_NEXT_TASK'] != -1) {
$nodo_taskref = addNodox($doc, $nodo_nexttask, 'TaskRef', '', array('TaskId'=> 'ID'.$aRoute[$c]['ROU_NEXT_TASK']));
} else {
$nodo_taskref = addNodox($doc, $nodo_nexttask, 'End', '', '');
}
$c++;
}
break;
case 'SEC-JOIN':
$nodo_routeType = addNodox($doc, $nodo_derivationrule, 'ParallelJoin', '', '');
$nodo_nexttask = addNodox($doc, $nodo_routeType, 'NextTask', '', '');
if ($aRoute[$c]['ROU_NEXT_TASK'] != -1) {
$nodo_taskref = addNodox($doc, $nodo_nexttask, 'TaskRef', '', array('TaskId'=> 'ID'.$aRoute[$c]['ROU_NEXT_TASK']));
} else {
$nodo_taskref = addNodox($doc, $nodo_nexttask, 'End', '', '');
}
break;
}
}
/****-_--__---___----___---__--_-****/
G::LoadClass('tasks');
require_once 'classes/model/Process.php';
$doc = new DOMDocument('1.0', 'UTF-8');
$nodo_padre = addNodox($doc, '', 'Processes', '', array('xmlns:xsi'=>'http://www.w3.org/2001/XMLSchema-instance','xsi:noNamespaceSchemaLocation'=>'ColosaSchema.xsd'));
$aProcesses = array();
$oCriteria = new Criteria('workflow');
$oCriteria->addSelectColumn(ProcessPeer::PRO_UID);
//$oCriteria->add(ProcessPeer::PRO_STATUS, 'DISABLED', Criteria::NOT_EQUAL);
//$oCriteria->add(ProcessPeer::PRO_UID, '946679494980c3d0ba0814088444708');
$oDataset = ProcessPeer::doSelectRS($oCriteria);
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$oDataset->next();
$oProcess = new Process();
while ($aRow = $oDataset->getRow()) {
$aProcess = $oProcess->load($aRow['PRO_UID']);
$nodo_process = addNodox($doc, $nodo_padre, 'Process', '', array('Title'=> $aProcess['PRO_TITLE'],'Description'=> $aProcess['PRO_DESCRIPTION']));
$nodo_tasks = addNodox($doc, $nodo_process, 'Tasks', '', '');
$oTask = new Tasks();
$aTasks= $oTask->getAllTasks($aProcess['PRO_UID']);
foreach ($aTasks as $key => $value) {
//print_r($value); echo "<br>";
$aRoute = $oTask->getRoute($aProcess['PRO_UID'], $value['TAS_UID']);
//print_r($aRoute[0]['ROU_UID']); echo "<hr>";
/*foreach($aRoute as $k => $v)
echo $k."-->".$v."<br>";
*/
if ($value['TAS_TYPE']=='NORMAL') {
$ini = ($value['TAS_START']=='TRUE') ? 'true' : 'false';
$nodo_task = addNodox($doc, $nodo_tasks, 'Task', '', array('Title'=> $value['TAS_TITLE'],'Description'=> $value['TAS_DESCRIPTION'],'Id'=> 'ID'.$value['TAS_UID'],'StartingTask'=> $ini));
$nodo_coordinates = addNodox($doc, $nodo_task, 'Coordinates', '', array('XCoordinate'=> $value['TAS_POSX'],'YCoordinate'=> $value['TAS_POSY']));
$nodo_derivationrule = addNodox($doc, $nodo_task, 'DerivationRule', '', '');
derivationRules($aRoute, $doc, $nodo_derivationrule);
$nodo_assignmentrules = addNodox($doc, $nodo_task, 'AssignmentRules', '', '');
$nodo_cyclicalassignment = addNodox($doc, $nodo_assignmentrules, 'CyclicalAssignment', '', '');
$nodo_timingcontrol = addNodox($doc, $nodo_task, 'TimingControl', '', array('TaskDuration'=> $value['TAS_DURATION']));
$nodo_permissions = addNodox($doc, $nodo_task, 'Permissions', '', '');
$nodo_caselabels = addNodox($doc, $nodo_task, 'CaseLabels', '', '');
$nodo_notifications = addNodox($doc, $nodo_task, 'Notifications', '', '');
} else {
require_once ( "classes/model/SubProcess.php" );
$oCriteria = new Criteria('workflow');
$oCriteria->add(SubProcessPeer::PRO_PARENT, $value['PRO_UID']);
$oCriteria->add(SubProcessPeer::TAS_PARENT, $value['TAS_UID']);
$oDataset = SubProcessPeer::doSelectRS($oCriteria);
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$oDataset->next();
$aRow = $oDataset->getRow();
$nodo_task = addNodox($doc, $nodo_tasks, 'SubProcess', '', array('Title'=> $value['TAS_TITLE'],'Description'=> $value['TAS_DESCRIPTION'],'Id'=> 'ID'.$value['TAS_UID'], 'ProcessRef'=>$aRow['PRO_UID']));
$nodo_coordinates = addNodox($doc, $nodo_task, 'Coordinates', '', array('XCoordinate'=> $value['TAS_POSX'],'YCoordinate'=> $value['TAS_POSY']));
$nodo_derivationrule = addNodox($doc, $nodo_task, 'DerivationRule', '', '');
derivationRules($aRoute, $doc, $nodo_derivationrule);
}
}
$oDataset->next();
}
//die;
$doc->preserveWhiteSpace = false;
$doc->formatOutput = true;
$doc->save(PATH_METHODS.'services/test_xpdl.xml');
echo "xml for xpdl creado!!!<br>";

View File

@@ -1,321 +0,0 @@
ArrowLine=function(){
this.lineColor=new Color(0,0,0);
this.stroke=1;
this.canvas=null;
this.workflow=null;
this.html=null;
this.graphics=null;
//this.id=UUID.create();
this.startX=30;
this.startY=30;
this.endX=100;
this.endY=100;
this.zOrder=Line.ZOrderBaseIndex;
this.setSelectable(true);
this.setDeleteable(true);
this.arrowWidth=8;
this.arrowLength=20;
this.lineWidth=2;
};
ArrowLine.prototype=new Line();
ArrowLine.prototype.type="ArrowLine";
ArrowLine.prototype.paint=function(){
if(this.graphics===null){
this.graphics=new jsGraphics(this.id);
}
else{
this.graphics.clear();
}
//this.graphics.setStroke(this.stroke);
this.graphics.setStroke( Stroke.DOTTED );
this.graphics.setColor(this.lineColor.getHTMLStyle());
var endY=this.getLength();
var _3e2a=[0 ,0 ,endY ];
var _3e2b=[-this.lineWidth,+this.lineWidth,-(this.lineWidth)];
var _3e2c=this.getAngle()*Math.PI/180;
var rotX=[];
var rotY=[];
for(var i=0;i<_3e2a.length;i++){
rotX[i]=this.startX+_3e2a[i]*Math.cos(_3e2c)-_3e2b[i]*Math.sin(_3e2c);
rotY[i]=this.startY+_3e2a[i]*Math.sin(_3e2c)+_3e2b[i]*Math.cos(_3e2c);
}
this.graphics.drawPolyLine(rotX,rotY);
this.graphics.paint();
};
DottedConnection=function(){
ArrowLine.call(this);
this.sourcePort=null;
this.targetPort=null;
this.lineSegments=[];
this.setColor(new Color(0,0,115));
this.setLineWidth(1);
};
DottedConnection.prototype=new ArrowLine();
DottedConnection.prototype.type="DottedConnection";
DottedConnection.prototype.disconnect=function(){
if(this.sourcePort!==null){
this.sourcePort.detachMoveListener(this);
}
if(this.targetPort!==null){
this.targetPort.detachMoveListener(this);
}
};
DottedConnection.prototype.reconnect=function(){
if(this.sourcePort!==null){
this.sourcePort.attachMoveListener(this);
}
if(this.targetPort!==null){
this.targetPort.attachMoveListener(this);
}
};
DottedConnection.prototype.isConnector=function(){
return true;
};
DottedConnection.prototype.isResizeable=function(){
return false;
};
DottedConnection.prototype.setSource=function(port){
if(this.sourcePort!==null){
this.sourcePort.detachMoveListener(this);
}
this.sourcePort=port;
if(this.sourcePort===null){
return;
}
this.sourcePort.attachMoveListener(this);
this.setStartPoint(port.getAbsoluteX(),port.getAbsoluteY());
};
DottedConnection.prototype.getSource=function(){
return this.sourcePort;
};
DottedConnection.prototype.setTarget=function(port){
if(this.targetPort!==null){
this.targetPort.detachMoveListener(this);
}
this.targetPort=port;
if(this.targetPort===null){
return;
}
this.targetPort.attachMoveListener(this);
this.setEndPoint(port.getAbsoluteX(),port.getAbsoluteY());
};
DottedConnection.prototype.getTarget=function(){
return this.targetPort;
};
DottedConnection.prototype.onOtherFigureMoved=function(_3824){
if(_3824==this.sourcePort){
this.setStartPoint(this.sourcePort.getAbsoluteX(),this.sourcePort.getAbsoluteY());
}else{
this.setEndPoint(this.targetPort.getAbsoluteX(),this.targetPort.getAbsoluteY());
}
};
bpmnAnnotation = function (oWorkflow) {
VectorFigure.call(this);
//Getting width and height from DB
if(typeof oWorkflow.anno_width != 'undefined' && typeof oWorkflow.anno_height != 'undefined'){
this.width = oWorkflow.anno_width;
this.height = oWorkflow.anno_height;
}
else{
this.width = 110;
this.height = 50;
}
this.setAnnotationName(oWorkflow.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 1';
};
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);
if(typeof workflow.zoomfactor == 'undefined')
workflow.zoomfactor = 1;
//Set the Task Limitation
if(typeof this.limitFlag == 'undefined' || this.limitFlag == false)
{
this.originalWidth = 110;
this.originalHeight = 50;
this.orgXPos = this.getX();
this.orgYPos = this.getY();
this.orgFontSize =this.fontSize;
}
var zoomRate = workflow.zoomfactor;
this.width = this.originalWidth * workflow.zoomfactor;
this.height = this.originalHeight * workflow.zoomfactor;
//this.graphics.setColor("#ffffff");
this.graphics.setColor("#f8f8f8");
this.graphics.fillRect(0,0, this.getWidth(), this.getHeight());
this.graphics.setStroke(1.5);
this.graphics.setColor("#202020");
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.setStroke(1);
this.graphics.paint();
/* New object is created to implement changing of Text functionality
*/
this.bpmnText = new jsGraphics(this.id) ;
this.padleft = 0.05*this.getWidth();
this.padtop = 0.13*this.getHeight() -1;
this.rectwidth = this.getWidth() - this.padleft;
this.rectheight = this.getHeight() - 2 * this.padtop;
//Setting text size to zoom font size if Zoomed
this.fontSize = 11;
var fontSize = zoomRate * this.fontSize;
this.bpmnText.setFont('verdana', + fontSize+'px', Font.PLAIN);
this.bpmnText.drawStringAnno(this.annotationName,0,this.padtop,this.rectwidth,this.rectheight,'left');
this.bpmnText.paint();
if( this.input1!=null ){
this.input1.setPosition(0,this.height/2);
}
};
jsGraphics.prototype.drawStringAnno = function(txt, x, y, width,height, halign)
{
this.htm += '<div style="position:absolute;overflow:hidden;'+
'left:' + x + 'px;'+
'top:' + y + 'px;'+
'width:'+width +'px;'+
'height:'+height +'px;'+
'text-align:'+halign+';'+
'font-family:' + this.ftFam + ';'+
'font-size:' + this.ftSz + ';'+ 'padding-left:6px;'+
'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);
this.addPort(this.input1,-this.getWidth()/2,-this.getHeight()/4);
};
};
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.bpmnText.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.bpmnText.drawStringAnno(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.bpmnText.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

@@ -1,33 +0,0 @@
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

@@ -1,88 +0,0 @@
bpmnEventBoundaryInter=function(){
VectorFigure.call(this);
//Setting width and height values as per the zoom ratio
if(typeof workflow.zoomWidth != 'undefined' || typeof workflow.zoomHeight != 'undefined')
this.setDimension(workflow.zoomWidth, workflow.zoomHeight);
else
this.setDimension(30,30);
this.stroke = 2;
};
bpmnEventBoundaryInter.prototype=new VectorFigure;
bpmnEventBoundaryInter.prototype.type="bpmnEventBoundaryTimerInter";
bpmnEventBoundaryInter.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);
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);
}
};
bpmnEventBoundaryInter.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
}
}
};
bpmnEventBoundaryInter.prototype.getContextMenu=function(){
if(this.id != null){
this.workflow.handleContextMenu(this);
}
};

View File

@@ -1,80 +0,0 @@
bpmnEventCancelEnd=function(){
VectorFigure.call(this);
//Setting width and height values as per the zoom ratio
if(typeof workflow.zoomWidth != 'undefined' || typeof workflow.zoomHeight != 'undefined')
this.setDimension(workflow.zoomWidth, workflow.zoomHeight);
else
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

@@ -1,49 +0,0 @@
bpmnEventCancelInter=function(){
VectorFigure.call(this);
this.stroke=1;
};
bpmnEventCancelInter.prototype=new VectorFigure;
bpmnEventCancelInter.prototype.type="bpmnEventCancelInter";
bpmnEventCancelInter.prototype.paint=function(){
VectorFigure.prototype.paint.call(this);
if(typeof workflow.zoomfactor == 'undefined')
workflow.zoomfactor = 1;
//Set the Task Limitation
if(typeof this.limitFlag == 'undefined' || this.limitFlag == false)
{
this.originalWidth = 30;
this.originalHeight = 30;
this.orgXPos = this.getX();
this.orgYPos = this.getY();
this.orgFontSize =this.fontSize;
}
this.width = this.originalWidth * workflow.zoomfactor;
this.height = this.originalHeight * workflow.zoomfactor;
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 cw = this.getWidth();
var ch = this.getHeight();
var x=new Array(cw*0.35,cw*0.51,cw*0.68,cw*0.8,cw*0.64,cw*0.82,cw*0.71,cw*0.51,cw*0.35,cw*0.24,cw*0.4,cw*0.24);
var y=new Array(ch*0.78,ch*0.6,ch*0.73,ch*0.64,ch*0.49,ch*0.31,ch*0.17,ch*0.35,ch*0.17,ch*0.31,ch*0.49,ch*0.64);
//var x=new Array(cw/2.8,cw/1.95,cw/1.45,cw/1.25,cw/1.55,cw/1.21,cw/1.4,cw/1.95,cw/2.8,cw/4.1,cw/2.5,cw/4.1);
//var y=new Array(ch/1.28,ch/1.66,ch/1.36,ch/1.55,ch/2.04,ch/3.21,ch/5.6,ch/2.81,ch/5.6,ch/3.21,ch/2.04,ch/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

@@ -1,74 +0,0 @@
bpmnEventCompEnd=function(){
VectorFigure.call(this);
//Setting width and height values as per the zoom ratio
if(typeof workflow.zoomWidth != 'undefined' || typeof workflow.zoomHeight != 'undefined')
this.setDimension(workflow.zoomWidth, workflow.zoomHeight);
else
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

@@ -1,121 +0,0 @@
bpmnEventCompInter=function(){
VectorFigure.call(this);
this.stroke=1
};
bpmnEventCompInter.prototype=new VectorFigure;
bpmnEventCompInter.prototype.type="bpmnEventCompInter";
bpmnEventCompInter.prototype.paint=function(){
VectorFigure.prototype.paint.call(this);
if(typeof workflow.zoomfactor == 'undefined')
workflow.zoomfactor = 1;
//Set the Task Limitation
if(typeof this.limitFlag == 'undefined' || this.limitFlag == false)
{
this.originalWidth = 30;
this.originalHeight = 30;
this.orgXPos = this.getX();
this.orgYPos = this.getY();
this.orgFontSize =this.fontSize;
}
this.width = this.originalWidth * workflow.zoomfactor;
this.height = this.originalHeight * workflow.zoomfactor;
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 cw = this.getWidth();
var ch = this.getHeight();
var x_arrow=new Array(cw*0.13,cw*0.42,cw*0.42,cw*0.71,cw*0.7,cw*0.42,cw*0.42);
var y_arrow=new Array(ch*0.5,ch*0.73,ch*0.5,ch*0.73,ch*0.25,ch*0.5,ch*0.25);
//var x_arrow=new Array(cw/7.5,cw/2.36,cw/2.36,cw/1.4,cw/1.42,cw/2.36,cw/2.36);
//var y_arrow=new Array(ch/2,ch/1.36,ch/2,ch/1.36,ch/4,ch/2,ch/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

@@ -1,89 +0,0 @@
bpmnEventEmptyEnd=function(){
VectorFigure.call(this);
this.stroke=2;
};
bpmnEventEmptyEnd.prototype=new VectorFigure;
bpmnEventEmptyEnd.prototype.type="bpmnEventEmptyEnd";
bpmnEventEmptyEnd.prototype.paint=function(){
VectorFigure.prototype.paint.call(this);
if(typeof workflow.zoomfactor == 'undefined')
workflow.zoomfactor = 1;
//Set the Task Limitation
if(typeof this.limitFlag == 'undefined' || this.limitFlag == false)
{
this.originalWidth = 30;
this.originalHeight = 30;
this.orgXPos = this.getX();
this.orgYPos = this.getY();
this.orgFontSize =this.fontSize;
}
this.width = this.originalWidth * workflow.zoomfactor;
this.height = this.originalHeight * workflow.zoomfactor;
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( "#f5d4d4" );
this.graphics.fillEllipse(x,y,this.getWidth(),this.getHeight());
this.graphics.setColor("#a23838");
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

@@ -1,91 +0,0 @@
bpmnEventEmptyInter=function(width,_30ab){
VectorFigure.call(this);
this.stroke=1;
};
bpmnEventEmptyInter.prototype=new VectorFigure;
bpmnEventEmptyInter.prototype.type="bpmnEventEmptyInter";
bpmnEventEmptyInter.prototype.paint=function(){
VectorFigure.prototype.paint.call(this);
if(typeof workflow.zoomfactor == 'undefined')
workflow.zoomfactor = 1;
//Set the Task Limitation
if(typeof this.limitFlag == 'undefined' || this.limitFlag == false)
{
this.originalWidth = 30;
this.originalHeight = 30;
this.orgXPos = this.getX();
this.orgYPos = this.getY();
this.orgFontSize =this.fontSize;
}
this.width = this.originalWidth * workflow.zoomfactor;
this.height = this.originalHeight * workflow.zoomfactor;
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());
this.graphics.setStroke(this.stroke);
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 cw = this.getWidth();
var ch = this.getHeight();
this.graphics.drawEllipse(cw*0.15, ch*0.15, ch*0.7, ch*0.7);
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

@@ -1,76 +0,0 @@
bpmnEventEmptyStart=function(){
VectorFigure.call(this);
};
bpmnEventEmptyStart.prototype=new VectorFigure;
bpmnEventEmptyStart.prototype.type="bpmnEventEmptyStart";
bpmnEventEmptyStart.prototype.paint=function() {
VectorFigure.prototype.paint.call(this);
if(typeof workflow.zoomfactor == 'undefined')
workflow.zoomfactor = 1;
//Set the Limitation
if(typeof this.limitFlag == 'undefined' || this.limitFlag == false) {
this.originalWidth = 30;
this.originalHeight = 30;
this.orgXPos = this.getX();
this.orgYPos = this.getY();
this.orgFontSize =this.fontSize;
}
this.width = this.originalWidth * workflow.zoomfactor;
this.height = this.originalHeight * workflow.zoomfactor;
var x_cir = 0;
var y_cir = 0;
//draw the circle
this.graphics.setColor("#d0d0d0");
this.graphics.fillEllipse(x_cir+2,y_cir+2,this.getWidth(),this.getHeight());
this.graphics.setColor( "#F6FFDA" );
this.graphics.fillEllipse(x_cir,y_cir,this.getWidth(),this.getHeight());
this.graphics.setStroke(1);
this.graphics.setColor("#97C759");
this.graphics.drawEllipse(x_cir,y_cir,this.getWidth(),this.getHeight());
this.graphics.setStroke(1);
this.graphics.setColor("#98C951");
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.output1!=null) {
this.output1.setPosition(this.width/2,this.height);
}
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

@@ -1,74 +0,0 @@
bpmnEventEndSignal=function(){
VectorFigure.call(this);
//Setting width and height values as per the zoom ratio
if(typeof workflow.zoomWidth != 'undefined' || typeof workflow.zoomHeight != 'undefined')
this.setDimension(workflow.zoomWidth, workflow.zoomHeight);
else
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

@@ -1,77 +0,0 @@
bpmnEventErrorEnd=function(){
VectorFigure.call(this);
//Setting width and height values as per the zoom ratio
if(typeof workflow.zoomWidth != 'undefined' || typeof workflow.zoomHeight != 'undefined')
this.setDimension(workflow.zoomWidth, workflow.zoomHeight);
else
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

@@ -1,49 +0,0 @@
bpmnEventErrorInter=function(){
VectorFigure.call(this);
this.stroke=1;
};
bpmnEventErrorInter.prototype=new VectorFigure;
bpmnEventErrorInter.prototype.type="bpmnEventErrorInter";
bpmnEventErrorInter.prototype.paint=function(){
VectorFigure.prototype.paint.call(this);
if(typeof workflow.zoomfactor == 'undefined')
workflow.zoomfactor = 1;
//Set the Task Limitation
if(typeof this.limitFlag == 'undefined' || this.limitFlag == false)
{
this.originalWidth = 30;
this.originalHeight = 30;
this.orgXPos = this.getX();
this.orgYPos = this.getY();
this.orgFontSize =this.fontSize;
}
this.width = this.originalWidth * workflow.zoomfactor;
this.height = this.originalHeight * workflow.zoomfactor;
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 cw = this.getWidth();
var ch = this.getHeight();
var x=new Array(cw*0.15,cw*0.38,cw*0.53,cw*0.75,cw*0.53,cw*0.38);
var y=new Array(ch*0.73,ch*0.51,ch*0.73,ch*0.28,ch*0.57,ch*0.35);
//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

@@ -1,97 +0,0 @@
bpmnEventInterSignal=function(){
VectorFigure.call(this);
this.stroke=1;
};
bpmnEventInterSignal.prototype=new VectorFigure;
bpmnEventInterSignal.prototype.type="bpmnEventInterSignal";
bpmnEventInterSignal.prototype.paint=function(){
VectorFigure.prototype.paint.call(this);
if(typeof workflow.zoomfactor == 'undefined')
workflow.zoomfactor = 1;
//Set the Task Limitation
if(typeof this.limitFlag == 'undefined' || this.limitFlag == false)
{
this.originalWidth = 30;
this.originalHeight = 30;
this.orgXPos = this.getX();
this.orgYPos = this.getY();
this.orgFontSize =this.fontSize;
}
this.width = this.originalWidth * workflow.zoomfactor;
this.height = this.originalHeight * workflow.zoomfactor;
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 cw = this.getWidth();
var ch = this.getHeight();
var x=new Array(cw*0.26,cw*0.71,cw*0.49);
var y=new Array(ch*0.71,ch*0.71,ch*0.2);
//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

@@ -1,30 +0,0 @@
bpmnEventLinkEnd=function(){
VectorFigure.call(this);
//Setting width and height values as per the zoom ratio
if(typeof workflow.zoomWidth != 'undefined' || typeof workflow.zoomHeight != 'undefined')
this.setDimension(workflow.zoomWidth, workflow.zoomHeight);
else
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

@@ -1,78 +0,0 @@
bpmnEventLinkInter=function(){
VectorFigure.call(this);
//Setting width and height values as per the zoom ratio
if(typeof workflow.zoomWidth != 'undefined' || typeof workflow.zoomHeight != 'undefined')
this.setDimension(workflow.zoomWidth, workflow.zoomHeight);
else
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

@@ -1,36 +0,0 @@
bpmnEventLinkStart=function(){
VectorFigure.call(this);
//Setting width and height values as per the zoom ratio
if(typeof workflow.zoomWidth != 'undefined' || typeof workflow.zoomHeight != 'undefined')
this.setDimension(workflow.zoomWidth, workflow.zoomHeight);
else
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

@@ -1,102 +0,0 @@
bpmnEventMessageEnd=function(){
VectorFigure.call(this);
this.stroke = 2;
};
bpmnEventMessageEnd.prototype=new VectorFigure;
bpmnEventMessageEnd.prototype.type="bpmnEventMessageEnd";
bpmnEventMessageEnd.prototype.paint=function(){
VectorFigure.prototype.paint.call(this);
if(typeof workflow.zoomfactor == 'undefined')
workflow.zoomfactor = 1;
//Set the Task Limitation
if(typeof this.limitFlag == 'undefined' || this.limitFlag == false)
{
this.originalWidth = 30;
this.originalHeight = 30;
this.orgXPos = this.getX();
this.orgYPos = this.getY();
this.orgFontSize =this.fontSize;
}
this.width = this.originalWidth * workflow.zoomfactor;
this.height = this.originalHeight * workflow.zoomfactor;
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( "#f5d4d4");
this.graphics.fillEllipse(x_cir,y_cir,this.getWidth(),this.getHeight());
this.graphics.setColor("#a23838");
this.graphics.drawEllipse(x_cir,y_cir,this.getWidth(),this.getHeight());
this.graphics.setStroke(1);
//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);*/
//draw the mail icon
var cw = this.getWidth();
var ch = this.getHeight();
var x = new Array( cw*0.25, cw*0.25, cw*0.78, cw*0.78, cw*0.52, cw*0.25, cw*0.25, cw*0.78);
var y = new Array( ch*0.31, ch*0.71, ch*0.71, ch*0.32, ch*0.52, ch*0.32, ch*0.31, ch*0.31);
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);
}
};
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

@@ -1,80 +0,0 @@
bpmnEventMessageInter=function(){
VectorFigure.call(this);
this.stroke=1;
};
bpmnEventMessageInter.prototype=new VectorFigure;
bpmnEventMessageInter.prototype.type="bpmnEventMessageInter";
bpmnEventMessageInter.prototype.paint=function(){
VectorFigure.prototype.paint.call(this);
if(typeof workflow.zoomfactor == 'undefined')
workflow.zoomfactor = 1;
//Set the Task Limitation
if(typeof this.limitFlag == 'undefined' || this.limitFlag == false)
{
this.originalWidth = 30;
this.originalHeight = 30;
this.orgXPos = this.getX();
this.orgYPos = this.getY();
this.orgFontSize =this.fontSize;
}
this.width = this.originalWidth * workflow.zoomfactor;
this.height = this.originalHeight * workflow.zoomfactor;
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");
var cw = this.getWidth();
var ch = this.getHeight();
this.graphics.drawEllipse(cw*0.15, ch*0.15, ch*0.7, ch*0.7);
//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);*/
//draw the mail icon
var cw = this.getWidth();
var ch = this.getHeight();
var x = new Array( cw*0.25, cw*0.25, cw*0.78, cw*0.78, cw*0.52, cw*0.25, cw*0.25, cw*0.78);
var y = new Array( ch*0.31, ch*0.71, ch*0.71, ch*0.32, ch*0.52, ch*0.32, ch*0.31, ch*0.31);
this.graphics.setColor("#4aa533");
this.graphics.drawPolygon(x,y);
this.graphics.paint();
};
bpmnEventMessageInter.prototype.getContextMenu=function(){
if(this.id != null){
this.workflow.handleContextMenu(this);
}
};

View File

@@ -1,111 +0,0 @@
bpmnEventMessageRecInter=function(){
VectorFigure.call(this);
this.stroke=2;
};
bpmnEventMessageRecInter.prototype=new VectorFigure;
bpmnEventMessageRecInter.prototype.type="bpmnEventMessageRecInter";
bpmnEventMessageRecInter.prototype.paint=function(){
VectorFigure.prototype.paint.call(this);
if(typeof workflow.zoomfactor == 'undefined')
workflow.zoomfactor = 1;
//Set the Task Limitation
if(typeof this.limitFlag == 'undefined' || this.limitFlag == false)
{
this.originalWidth = 30;
this.originalHeight = 30;
this.orgXPos = this.getX();
this.orgYPos = this.getY();
this.orgFontSize =this.fontSize;
}
this.width = this.originalWidth * workflow.zoomfactor;
this.height = this.originalHeight * workflow.zoomfactor;
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);*/
//draw the mail icon
var cw = this.getWidth();
var ch = this.getHeight();
var x = new Array( cw*0.25, cw*0.25, cw*0.78, cw*0.78, cw*0.52, cw*0.25, cw*0.25, cw*0.78);
var y = new Array( ch*0.31, ch*0.71, ch*0.71, ch*0.32, ch*0.52, ch*0.32, ch*0.31, ch*0.31);
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);
}
};
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

@@ -1,113 +0,0 @@
bpmnEventMessageSendInter=function(){
VectorFigure.call(this);
this.stroke=1;
};
bpmnEventMessageSendInter.prototype=new VectorFigure;
bpmnEventMessageSendInter.prototype.type="bpmnEventMessageSendInter";
bpmnEventMessageSendInter.prototype.paint=function(){
VectorFigure.prototype.paint.call(this);
if(typeof workflow.zoomfactor == 'undefined')
workflow.zoomfactor = 1;
//Set the Task Limitation
if(typeof this.limitFlag == 'undefined' || this.limitFlag == false)
{
this.originalWidth = 30;
this.originalHeight = 30;
this.orgXPos = this.getX();
this.orgYPos = this.getY();
this.orgFontSize =this.fontSize;
}
this.width = this.originalWidth * workflow.zoomfactor;
this.height = this.originalHeight * workflow.zoomfactor;
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);
//draw the mail icon
var cw = this.getWidth();
var ch = this.getHeight();
var x = new Array( cw*0.25, cw*0.25, cw*0.78, cw*0.78, cw*0.52, cw*0.25, cw*0.25, cw*0.78);
var y = new Array( ch*0.31, ch*0.71, ch*0.71, ch*0.32, ch*0.52, ch*0.32, ch*0.31, ch*0.31);
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);
}
};
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

@@ -1,89 +0,0 @@
bpmnEventMessageStart=function(){
VectorFigure.call(this);
};
bpmnEventMessageStart.prototype=new VectorFigure;
bpmnEventMessageStart.prototype.type="bpmnEventMessageStart";
bpmnEventMessageStart.prototype.paint=function(){
VectorFigure.prototype.paint.call(this);
if(typeof workflow.zoomfactor == 'undefined')
workflow.zoomfactor = 1;
//Set the Limitation
if(typeof this.limitFlag == 'undefined' || this.limitFlag == false) {
this.originalWidth = 30;
this.originalHeight = 30;
this.orgXPos = this.getX();
this.orgYPos = this.getY();
this.orgFontSize =this.fontSize;
}
this.width = this.originalWidth * workflow.zoomfactor;
this.height = this.originalHeight * workflow.zoomfactor;
var x_cir = 0;
var y_cir = 0;
//draw the circle
this.graphics.setColor("#d0d0d0");
this.graphics.fillEllipse(x_cir+2,y_cir+2,this.getWidth(),this.getHeight());
this.graphics.setColor( "#F6FFDA" );
this.graphics.fillEllipse(x_cir,y_cir,this.getWidth(),this.getHeight());
this.graphics.setStroke(1);
this.graphics.setColor("#97C759");
this.graphics.drawEllipse(x_cir,y_cir,this.getWidth(),this.getHeight());
this.graphics.setStroke(1);
this.graphics.setColor("#98C951");
this.graphics.drawEllipse(x_cir,y_cir,this.getWidth(),this.getHeight());
//draw the mail icon
var cw = this.getWidth();
var ch = this.getHeight();
var x = new Array( cw*0.25, cw*0.25, cw*0.78, cw*0.78, cw*0.52, cw*0.25, cw*0.25, cw*0.78);
var y = new Array( ch*0.31, ch*0.71, ch*0.71, ch*0.32, ch*0.52, ch*0.32, ch*0.31, ch*0.31);
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);
}
};
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

@@ -1,74 +0,0 @@
bpmnEventMulStart=function(){
VectorFigure.call(this);
//Setting width and height values as per the zoom ratio
if(typeof workflow.zoomWidth != 'undefined' || typeof workflow.zoomHeight != 'undefined')
this.setDimension(workflow.zoomWidth, workflow.zoomHeight);
else
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

@@ -1,76 +0,0 @@
bpmnEventMultipleEnd=function(){
VectorFigure.call(this);
//Setting width and height values as per the zoom ratio
if(typeof workflow.zoomWidth != 'undefined' || typeof workflow.zoomHeight != 'undefined')
this.setDimension(workflow.zoomWidth, workflow.zoomHeight);
else
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

@@ -1,81 +0,0 @@
bpmnEventMultipleInter=function(){
VectorFigure.call(this);
//Setting width and height values as per the zoom ratio
if(typeof workflow.zoomWidth != 'undefined' || typeof workflow.zoomHeight != 'undefined')
this.setDimension(workflow.zoomWidth, workflow.zoomHeight);
else
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

@@ -1,83 +0,0 @@
bpmnEventRuleInter=function(){
VectorFigure.call(this);
//Setting width and height values as per the zoom ratio
if(typeof workflow.zoomWidth != 'undefined' || typeof workflow.zoomHeight != 'undefined')
this.setDimension(workflow.zoomWidth, workflow.zoomHeight);
else
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

@@ -1,77 +0,0 @@
bpmnEventRuleStart=function(){
VectorFigure.call(this);
//Setting width and height values as per the zoom ratio
if(typeof workflow.zoomWidth != 'undefined' || typeof workflow.zoomHeight != 'undefined')
this.setDimension(workflow.zoomWidth, workflow.zoomHeight);
else
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

@@ -1,74 +0,0 @@
bpmnEventSignalStart=function(){
VectorFigure.call(this);
//Setting width and height values as per the zoom ratio
if(typeof workflow.zoomWidth != 'undefined' || typeof workflow.zoomHeight != 'undefined')
this.setDimension(workflow.zoomWidth, workflow.zoomHeight);
else
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

@@ -1,74 +0,0 @@
bpmnEventTerminate=function(){
VectorFigure.call(this);
//Setting width and height values as per the zoom ratio
if(typeof workflow.zoomWidth != 'undefined' || typeof workflow.zoomHeight != 'undefined')
this.setDimension(workflow.zoomWidth, workflow.zoomHeight);
else
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

@@ -1,108 +0,0 @@
bpmnEventTimerInter=function(){
VectorFigure.call(this);
this.stroke = 1;
};
bpmnEventTimerInter.prototype=new VectorFigure;
bpmnEventTimerInter.prototype.type="bpmnEventTimerInter";
bpmnEventTimerInter.prototype.paint=function(){
VectorFigure.prototype.paint.call(this);
if(typeof workflow.zoomfactor == 'undefined')
workflow.zoomfactor = 1;
//Set the Task Limitation
if(typeof this.limitFlag == 'undefined' || this.limitFlag == false)
{
this.originalWidth = 30;
this.originalHeight = 30;
this.orgXPos = this.getX();
this.orgYPos = this.getY();
this.orgFontSize =this.fontSize;
}
this.width = this.originalWidth * workflow.zoomfactor;
this.height = this.originalHeight * workflow.zoomfactor;
var cw = this.getWidth();
var ch = this.getHeight();
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());
this.graphics.setStroke(this.stroke);
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(cw*0.15, ch*0.15, ch*0.7, ch*0.7);
//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(cw*0.5,ch*0.5,cw*0.77,ch*0.5);
//this.graphics.drawLine(cw*0.5,ch*0.5,cw*0.5,ch*0.22);
this.graphics.drawLine( cw*0.56, ch*0.5, cw*0.43, ch*0.5); //horizontal
this.graphics.drawLine( cw*0.6, ch*0.3, cw*0.43, ch*0.5);
this.graphics.drawLine(cw*0.73,ch*0.26,cw*0.66,ch*0.30); //10th min line
this.graphics.drawLine(cw*0.66,ch*0.50,cw*0.80,ch*0.50); //15th min line
this.graphics.drawLine(cw*0.60,ch*0.66,cw*0.73,ch*0.73); //25th min line
this.graphics.drawLine(cw*0.50,ch*0.83,cw*0.50,ch*0.70); //30th min line
this.graphics.drawLine(cw*0.23,ch*0.70,cw*0.36,ch*0.63); //40th min line
this.graphics.drawLine(cw*0.16,ch*0.50,cw*0.30,ch*0.50); //45th min line
this.graphics.drawLine(cw*0.26,ch*0.26,cw*0.36,ch*0.36); //50th min line
this.graphics.drawLine(cw*0.50,ch*0.16,cw*0.50,ch*0.26); //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);
}
};
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

@@ -1,114 +0,0 @@
bpmnEventTimerStart=function(){
VectorFigure.call(this);
};
bpmnEventTimerStart.prototype=new VectorFigure;
bpmnEventTimerStart.prototype.type="bpmnEventTimerStart";
bpmnEventTimerStart.prototype.paint=function(){
VectorFigure.prototype.paint.call(this);
if(typeof workflow.zoomfactor == 'undefined')
workflow.zoomfactor = 1;
//Set the Limitation
if(typeof this.limitFlag == 'undefined' || this.limitFlag == false) {
this.originalWidth = 30;
this.originalHeight = 30;
this.orgXPos = this.getX();
this.orgYPos = this.getY();
this.orgFontSize =this.fontSize;
}
this.width = this.originalWidth * workflow.zoomfactor;
this.height = this.originalHeight * workflow.zoomfactor;
var x_cir = 0;
var y_cir = 0;
//draw the circle
this.graphics.setColor("#d0d0d0");
this.graphics.fillEllipse(x_cir+2,y_cir+2,this.getWidth(),this.getHeight());
this.graphics.setColor( "#F6FFDA" );
this.graphics.fillEllipse(x_cir,y_cir,this.getWidth(),this.getHeight());
this.graphics.setStroke(1);
this.graphics.setColor("#97C759");
this.graphics.drawEllipse(x_cir,y_cir,this.getWidth(),this.getHeight());
this.graphics.setStroke(1);
this.graphics.setColor("#98C951");
//this.graphics.drawEllipse(x_cir,y_cir,this.getWidth(),this.getHeight());
//draw the clock
var cw = this.getWidth();
var ch = this.getHeight();
this.graphics.setColor("#98C951");
this.graphics.drawEllipse(cw*0.15, ch*0.15, ch*0.7, ch*0.7 );
var x = new Array( cw*0.60, cw*0.50, cw*0.75, 0.5);
var y = new Array( ch*0.31, ch*0.50, ch*0.50, 0.5);
this.graphics.setColor("#4aa533");
//this.graphics.drawPolygon(x,y);
this.graphics.drawLine( cw*0.56, ch*0.5, cw*0.43, ch*0.5); //horizontal
this.graphics.drawLine( cw*0.6, ch*0.3, cw*0.43, ch*0.5);
this.graphics.drawLine(cw*0.73,ch*0.26,cw*0.66,ch*0.30); //10th min line
this.graphics.drawLine(cw*0.66,ch*0.50,cw*0.80,ch*0.50); //15th min line
this.graphics.drawLine(cw*0.60,ch*0.66,cw*0.73,ch*0.73); //25th min line
this.graphics.drawLine(cw*0.50,ch*0.83,cw*0.50,ch*0.70); //30th min line
this.graphics.drawLine(cw*0.23,ch*0.70,cw*0.36,ch*0.63); //40th min line
this.graphics.drawLine(cw*0.16,ch*0.50,cw*0.30,ch*0.50); //45th min line
this.graphics.drawLine(cw*0.26,ch*0.26,cw*0.36,ch*0.36); //50th min line
this.graphics.drawLine(cw*0.50,ch*0.16,cw*0.50,ch*0.26); //60th min line
// this.graphics.drawLine(22,8,20,10); //10th min line
// this.graphics.drawLine(20,15,24,15); //15th min line
// this.graphics.drawLine(18,20,22,22); //25th min line
// this.graphics.drawLine(15,25,15,21); //30th min line
// this.graphics.drawLine(7,21,11,19); //40th min line
// this.graphics.drawLine(5,15,10,15); //45th min line
// this.graphics.drawLine(6,8,10,10); //50th min line
// this.graphics.drawLine(15,5,15,8); //60th min line
//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

@@ -1,102 +0,0 @@
bpmnGatewayComplex=function(width,_30ab){
VectorFigure.call(this);
this.stroke =1;
};
bpmnGatewayComplex.prototype=new VectorFigure;
bpmnGatewayComplex.prototype.type="bpmnGatewayComplex";
bpmnGatewayComplex.prototype.paint=function(){
VectorFigure.prototype.paint.call(this);
if(typeof workflow.zoomfactor == 'undefined')
workflow.zoomfactor = 1;
//Set the Task Limitation
if(typeof this.limitFlag == 'undefined' || this.limitFlag == false)
{
this.originalWidth = 40;
this.originalHeight = 40;
this.orgXPos = this.getX();
this.orgYPos = this.getY();
this.orgFontSize =this.fontSize;
}
this.width = this.originalWidth * workflow.zoomfactor;
this.height = this.originalHeight * workflow.zoomfactor;
var cw = this.getWidth();
var ch = this.getHeight();
var x=new Array(0,cw*0.5,cw,cw*0.5);
var y=new Array(ch*0.5,cw,cw*0.5,0);
//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( "#ffffe5" );
this.graphics.fillPolygon(x,y);
this.graphics.setColor("#c8c865");
this.graphics.drawPolygon(x,y);
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();
if (this.input1 != null) {
this.input1.setPosition(0, this.height / 2);
}
if (this.input2 != null) {
this.input2.setPosition(this.width / 2, 0);
}
if (this.output1 != null) {
this.output1.setPosition(this.height / 2, this.width);
}
if (this.output2 != null) {
this.output2.setPosition(this.width, this.height / 2);
}
if (this.output3 != null) {
this.output3.setPosition(0, this.height /2 );
}
};
bpmnGatewayComplex.prototype.setWorkflow=function(_40c5){
VectorFigure.prototype.setWorkflow.call(this,_40c5);
if(_40c5!=null){
var h2 = this.height/2;
var w2 = this.width/2;
var gatewayPortName = ['output1', 'output2', 'output3', 'input1', 'input2' ];
var gatewayPortType = ['OutputPort','OutputPort','OutputPort','InputPort','InputPort'];
var gatewayPositionX= [w2, this.width, 0 , 0, w2 ];
var gatewayPositionY= [this.width, h2, h2, h2, 0 ];
for(var i=0; i< gatewayPortName.length ; i++){
eval('this.'+gatewayPortName[i]+' = new '+gatewayPortType[i]+'()');
eval('this.'+gatewayPortName[i]+'.setWorkflow(_40c5)');
eval('this.'+gatewayPortName[i]+'.setName("'+gatewayPortName[i]+'")');
eval('this.'+gatewayPortName[i]+'.setZOrder(-1)');
eval('this.'+gatewayPortName[i]+'.setBackgroundColor(new Color(255, 255, 255))');
eval('this.'+gatewayPortName[i]+'.setColor(new Color(255, 255, 255))');
eval('this.addPort(this.'+gatewayPortName[i]+','+gatewayPositionX[i]+', '+gatewayPositionY[i]+')');
}
}
};
bpmnGatewayComplex.prototype.getContextMenu=function(){
if(this.id != null){
this.workflow.handleContextMenu(this);
}
};

View File

@@ -1,101 +0,0 @@
bpmnGatewayExclusiveData=function(width,_30ab){
VectorFigure.call(this);
this.stroke =1;
};
bpmnGatewayExclusiveData.prototype=new VectorFigure;
bpmnGatewayExclusiveData.prototype.type="bpmnGatewayExclusiveData";
bpmnGatewayExclusiveData.prototype.paint=function(){
VectorFigure.prototype.paint.call(this);
if(typeof workflow.zoomfactor == 'undefined')
workflow.zoomfactor = 1;
//Set the Task Limitation
if(typeof this.limitFlag == 'undefined' || this.limitFlag == false)
{
this.originalWidth = 40;
this.originalHeight = 40;
this.orgXPos = this.getX();
this.orgYPos = this.getY();
this.orgFontSize =this.fontSize;
}
this.width = this.originalWidth * workflow.zoomfactor;
this.height = this.originalHeight * workflow.zoomfactor;
var cw = this.getWidth();
var ch = this.getHeight();
var x=new Array(0,cw*0.5,cw,cw*0.5);
var y=new Array(ch*0.5,ch,ch*0.5,0);
//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( "#ffffe5" );
this.graphics.fillPolygon(x,y);
this.graphics.setColor("#c8c865");
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( "#c8c865" );
this.graphics.fillPolygon( x_cross, y_cross);
this.graphics.paint();
if (this.input1 != null) {
this.input1.setPosition(0, this.height / 2);
}
if (this.input2 != null) {
this.input2.setPosition(this.width / 2, 0);
}
if (this.output1 != null) {
this.output1.setPosition(this.height / 2, this.width);
}
if (this.output2 != null) {
this.output2.setPosition(this.width, this.height / 2);
}
if (this.output3 != null) {
this.output3.setPosition(0, this.height / 2 );
}
};
bpmnGatewayExclusiveData.prototype.setWorkflow=function(_40c5){
VectorFigure.prototype.setWorkflow.call(this,_40c5);
if(_40c5!=null){
var h2 = this.height/2;
var w2 = this.width/2;
var gatewayPortName = ['output1', 'output2', 'output3', 'input1', 'input2' ];
var gatewayPortType = ['OutputPort','OutputPort','OutputPort','InputPort','InputPort'];
var gatewayPositionX= [w2, this.width, 0 , 0, w2 ];
var gatewayPositionY= [this.width, h2, h2, h2, 0 ];
for(var i=0; i< gatewayPortName.length ; i++){
eval('this.'+gatewayPortName[i]+' = new '+gatewayPortType[i]+'()');
eval('this.'+gatewayPortName[i]+'.setWorkflow(_40c5)');
eval('this.'+gatewayPortName[i]+'.setName("'+gatewayPortName[i]+'")');
eval('this.'+gatewayPortName[i]+'.setZOrder(-1)');
eval('this.'+gatewayPortName[i]+'.setBackgroundColor(new Color(255, 255, 255))');
eval('this.'+gatewayPortName[i]+'.setColor(new Color(255, 255, 255))');
eval('this.addPort(this.'+gatewayPortName[i]+','+gatewayPositionX[i]+', '+gatewayPositionY[i]+')');
}
}
};
bpmnGatewayExclusiveData.prototype.getContextMenu=function(){
if(this.id != null){
this.workflow.handleContextMenu(this);
}
};

View File

@@ -1,110 +0,0 @@
bpmnGatewayExclusiveEvent=function(width,_30ab){
VectorFigure.call(this);
this.stroke =1;
};
bpmnGatewayExclusiveEvent.prototype=new VectorFigure;
bpmnGatewayExclusiveEvent.prototype.type="bpmnGatewayExclusiveEvent";
bpmnGatewayExclusiveEvent.prototype.paint=function() {
VectorFigure.prototype.paint.call(this);
if (typeof workflow.zoomfactor == 'undefined')
workflow.zoomfactor = 1;
//Set the Task Limitation
if(typeof this.limitFlag == 'undefined' || this.limitFlag == false)
{
this.originalWidth = 40;
this.originalHeight = 40;
this.orgXPos = this.getX();
this.orgYPos = this.getY();
this.orgFontSize =this.fontSize;
}
this.width = this.originalWidth * workflow.zoomfactor;
this.height = this.originalHeight * workflow.zoomfactor;
var cw = this.getWidth();
var ch = this.getHeight();
var x=new Array(0,cw*0.5,cw,cw*0.5);
var y=new Array(ch*0.5,ch,ch*0.5,0);
//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( "#ffffe5" );
this.graphics.fillPolygon(x,y);
this.graphics.setColor("#c8c865");
this.graphics.drawPolygon(x,y);
this.graphics.setColor("#c8c865");
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(cw*0.33, cw*0.5, cw*0.66, cw*0.58, cw*0.41, cw*0.33);
var y_penta=new Array(ch*0.43, ch*0.35, ch*0.43, ch*0.62, ch*0.62, ch*0.43);
//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.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();
if (this.input1 != null) {
this.input1.setPosition(0, this.height / 2);
}
if (this.input2 != null) {
this.input2.setPosition(this.width / 2, 0);
}
if (this.output1 != null) {
this.output1.setPosition(this.height / 2, this.width);
}
if (this.output2 != null) {
this.output2.setPosition(this.width, this.height / 2);
}
if (this.output3 != null) {
this.output3.setPosition(0, this.height /2 );
}
};
bpmnGatewayExclusiveEvent.prototype.setWorkflow=function(_40c5){
VectorFigure.prototype.setWorkflow.call(this,_40c5);
if(_40c5!=null){
var h2 = this.height/2;
var w2 = this.width/2;
var gatewayPortName = ['output1', 'output2', 'output3', 'input1', 'input2' ];
var gatewayPortType = ['OutputPort','OutputPort','OutputPort','InputPort','InputPort'];
var gatewayPositionX= [w2, this.width, 0 , 0, w2 ];
var gatewayPositionY= [this.width, h2, h2, h2, 0 ];
for(var i=0; i< gatewayPortName.length ; i++){
eval('this.'+gatewayPortName[i]+' = new '+gatewayPortType[i]+'()');
eval('this.'+gatewayPortName[i]+'.setWorkflow(_40c5)');
eval('this.'+gatewayPortName[i]+'.setName("'+gatewayPortName[i]+'")');
eval('this.'+gatewayPortName[i]+'.setZOrder(-1)');
eval('this.'+gatewayPortName[i]+'.setBackgroundColor(new Color(255, 255, 255))');
eval('this.'+gatewayPortName[i]+'.setColor(new Color(255, 255, 255))');
eval('this.addPort(this.'+gatewayPortName[i]+','+gatewayPositionX[i]+', '+gatewayPositionY[i]+')');
}
}
};
bpmnGatewayExclusiveEvent.prototype.getContextMenu=function(){
if(this.id != null){
this.workflow.handleContextMenu(this);
}
};

View File

@@ -1,100 +0,0 @@
bpmnGatewayInclusive=function(width,_30ab){
VectorFigure.call(this);
this.stroke =1;
};
bpmnGatewayInclusive.prototype=new VectorFigure;
bpmnGatewayInclusive.prototype.type="bpmnGatewayInclusive";
bpmnGatewayInclusive.prototype.paint=function(){
VectorFigure.prototype.paint.call(this);
if(typeof workflow.zoomfactor == 'undefined')
workflow.zoomfactor = 1;
//Set the Task Limitation
if(typeof this.limitFlag == 'undefined' || this.limitFlag == false)
{
this.originalWidth = 40;
this.originalHeight = 40;
this.orgXPos = this.getX();
this.orgYPos = this.getY();
this.orgFontSize =this.fontSize;
}
this.width = this.originalWidth * workflow.zoomfactor;
this.height = this.originalHeight * workflow.zoomfactor;
var cw = this.getWidth();
var ch = this.getHeight();
var x=new Array(0,cw*0.5,cw,cw*0.5);
var y=new Array(ch*0.5,ch,ch*0.5,0);
//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(1);
this.graphics.setColor( "#ffffe5" );
this.graphics.fillPolygon(x,y);
this.graphics.setColor("#c8c865");
this.graphics.drawPolygon(x,y);
var x_cir = 15;
var y_cir = 15;
this.graphics.setColor("#c8c865");
this.graphics.drawEllipse(this.getWidth()/4,this.getHeight()/4,this.getWidth()/2,this.getHeight()/2);
this.graphics.paint();
if (this.input1 != null) {
this.input1.setPosition(0, this.height / 2);
}
if (this.input2 != null) {
this.input2.setPosition(this.width / 2, 0);
}
if (this.output1 != null) {
this.output1.setPosition(this.height / 2, this.width);
}
if (this.output2 != null) {
this.output2.setPosition(this.width, this.height / 2);
}
if (this.output3 != null) {
this.output3.setPosition(0, this.height /2 );
}
};
bpmnGatewayInclusive.prototype.setWorkflow=function(_40c5){
VectorFigure.prototype.setWorkflow.call(this,_40c5);
if(_40c5!=null){
var h2 = this.height/2;
var w2 = this.width/2;
var gatewayPortName = ['output1', 'output2', 'output3', 'input1', 'input2' ];
var gatewayPortType = ['OutputPort','OutputPort','OutputPort','InputPort','InputPort'];
var gatewayPositionX= [w2, this.width, 0 , 0, w2 ];
var gatewayPositionY= [this.width, h2, h2, h2, 0 ];
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

@@ -1,104 +0,0 @@
bpmnGatewayParallel=function(width,_30ab){
VectorFigure.call(this);
this.stroke =1;
};
bpmnGatewayParallel.prototype=new VectorFigure;
bpmnGatewayParallel.prototype.type="bpmnGatewayParallel";
bpmnGatewayParallel.prototype.paint=function(){
VectorFigure.prototype.paint.call(this);
if(typeof workflow.zoomfactor == 'undefined')
workflow.zoomfactor = 1;
//Set the Task Limitation
if(typeof this.limitFlag == 'undefined' || this.limitFlag == false)
{
this.originalWidth = 40;
this.originalHeight = 40;
this.orgXPos = this.getX();
this.orgYPos = this.getY();
this.orgFontSize =this.fontSize;
}
this.width = this.originalWidth * workflow.zoomfactor;
this.height = this.originalHeight * workflow.zoomfactor;
var cw = this.getWidth();
var ch = this.getHeight();
var x=new Array(0,cw*0.5,cw,cw*0.5);
var y=new Array(ch*0.5,ch,ch*0.5,0);
//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(1);
this.graphics.setColor( "#ffffe5" );
this.graphics.fillPolygon(x,y);
this.graphics.setColor("#c8c865");
this.graphics.drawPolygon(x,y);
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( "#c8c865" );
this.graphics.fillPolygon(x,y);
this.graphics.setColor("#c8c865");
this.graphics.drawPolygon(x,y);
this.graphics.paint();
if (this.input1 != null) {
this.input1.setPosition(0, this.height / 2);
}
if (this.input2 != null) {
this.input2.setPosition(this.width / 2, 0);
}
if (this.output1 != null) {
this.output1.setPosition(this.height / 2, this.width);
}
if (this.output2 != null) {
this.output2.setPosition(this.width, this.height / 2);
}
if (this.output3 != null) {
this.output3.setPosition(0, this.height /2 );
}
};
bpmnGatewayParallel.prototype.setWorkflow=function(_40c5){
VectorFigure.prototype.setWorkflow.call(this,_40c5);
if(_40c5!=null){
var h2 = this.height/2;
var w2 = this.width/2;
var gatewayPortName = ['output1', 'output2', 'output3', 'input1', 'input2' ];
var gatewayPortType = ['OutputPort','OutputPort','OutputPort','InputPort','InputPort'];
var gatewayPositionX= [w2, this.width, 0 , 0, w2 ];
var gatewayPositionY= [this.width, h2, h2, h2, 0 ];
for(var i=0; i< gatewayPortName.length ; i++){
eval('this.'+gatewayPortName[i]+' = new '+gatewayPortType[i]+'()');
eval('this.'+gatewayPortName[i]+'.setWorkflow(_40c5)');
eval('this.'+gatewayPortName[i]+'.setName("'+gatewayPortName[i]+'")');
eval('this.'+gatewayPortName[i]+'.setZOrder(-1)');
eval('this.'+gatewayPortName[i]+'.setBackgroundColor(new Color(255, 255, 255))');
eval('this.'+gatewayPortName[i]+'.setColor(new Color(255, 255, 255))');
eval('this.addPort(this.'+gatewayPortName[i]+','+gatewayPositionX[i]+', '+gatewayPositionY[i]+')');
}
}
};
bpmnGatewayParallel.prototype.getContextMenu=function(){
if(this.id != null){
this.workflow.handleContextMenu(this);
}
};

File diff suppressed because it is too large Load Diff

View File

@@ -1,36 +0,0 @@
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

@@ -1,105 +0,0 @@
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

@@ -1,46 +0,0 @@
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

@@ -1,53 +0,0 @@
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
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -1,233 +0,0 @@
bpmnSubProcess = function (_30ab) {
VectorFigure.call(this);
//Setting width and height values as per the zoom ratio
if(typeof workflow.zoomTaskWidth != 'undefined' || typeof workflow.zoomTaskHeight != 'undefined')
this.setDimension(workflow.zoomTaskWidth, workflow.zoomTaskHeight);
else
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);
if(typeof workflow.zoomfactor == 'undefined')
workflow.zoomfactor = 1;
//For Zooming
if(typeof this.limitFlag == 'undefined' || this.limitFlag == false)
{
this.originalWidth = 165;
this.originalHeight = 40;
this.orgXPos = this.getX();
this.orgYPos = this.getY();
this.orgFontSize =this.fontSize;
}
this.width = this.originalWidth * workflow.zoomfactor;
this.height = this.originalHeight * workflow.zoomfactor;
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
//Plus symbol on bottom
var zoomfactor = workflow.zoomfactor;
var xb = this.getWidth()/2 - 5*zoomfactor;
var yb = this.getHeight() - 5 - 11*zoomfactor;
var x1 = new Array(xb, xb , xb + 11.5*zoomfactor, xb + 11.5*zoomfactor );
var y1 = new Array(yb, yb + 11*zoomfactor, yb + 11*zoomfactor, yb );
this.graphics.setStroke(1);
this.graphics.setColor("#5891B7");
this.graphics.drawPolygon(x1,y1);
var x_cross = new Array(xb+ 5*zoomfactor, xb+ 6*zoomfactor, xb+ 6*zoomfactor, xb+ 9*zoomfactor, xb+ 9*zoomfactor, xb+ 6*zoomfactor, xb+ 6*zoomfactor, xb+ 5*zoomfactor, xb+ 5*zoomfactor, xb+ 2*zoomfactor, xb+ 2*zoomfactor, xb+ 5*zoomfactor );
var y_cross = new Array(yb+ 2*zoomfactor, yb+ 2*zoomfactor, yb+ 5*zoomfactor, yb+ 5*zoomfactor, yb+ 6*zoomfactor, yb+ 6*zoomfactor, yb+ 9*zoomfactor, yb+ 9*zoomfactor, yb+ 6*zoomfactor, yb+ 6*zoomfactor, yb+ 5*zoomfactor, yb+ 5*zoomfactor );
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.15*this.getHeight();
var rectwidth = this.getWidth() - 3*padleft;
var rectheight = this.getHeight() - 3*padtop;
if(typeof this.fontSize == 'undefined' || this.fontSize == '')
this.fontSize = 11;
var fontSize = zoomfactor * this.fontSize;
bpmnText.setFont('verdana', +fontSize+'px', Font.PLAIN);
bpmnText.drawStringRect(this.subProcessName,padleft,padtop,rectwidth,rectheight,'center');
bpmnText.paint();
this.bpmnNewText = bpmnText;
if (this.input1 != null) {
this.input1.setPosition(0, this.height / 2 -1);
}
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-1);
}
};
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);
};

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -1,380 +0,0 @@
// --------------------------------------------------------------------
// 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;

View File

@@ -1,12 +0,0 @@
<div id="west" class="x-hide-display">
</div>
<div id="center2" class="x-hide-display">
</div>
<div id="center1" class="x-layout-active-content" style="position:relative;">
<div id="paintarea" style="position:relative;width:3000px;height:3000px;" >
</div>
</div>
<div id="props-panel" class="x-hide-display" style="width:200px;height:200px;overflow:hidden;">
</div>
<div id="south" class="x-hide-display">
</div>

View File

@@ -1,926 +0,0 @@
/**
* BPMN Designer v1.1
* @date Feb 2th, 2011
* @author Erik A. O. <erik@colosa.com>
*/
var saveProcess;
var usersPanel;
var _TAS_UID;
var _TU_TYPE;
var processObj;
var ProcessMapObj;
Ext.onReady(function(){
//Ext.state.Manager.setProvider(new Ext.state.CookieProvider());
//Ext.BLANK_IMAGE_URL = '/images/s.gif';
var northPanel = new Ext.Toolbar({
region: 'north',
height: 25, // give north and south regions a height
items: northPanelItems
})
var southPanel = {
// lazily created panel (xtype:'panel' is default)
region: 'south',
contentEl: 'south',
split: true,
height: 100,
minSize: 100,
maxSize: 200,
collapsible: true,
title: 'South',
margins: '0 0 0 0'
}
var eastPanel = {
id: 'eastPanel',
region: 'east',
title: '&nbsp;',
collapsible: true,
split: true,
width: 225, // give east and west regions a width
minSize: 175,
maxSize: 400,
margins: '0 3 0 0',
layout:'border', // specify layout manager for items
items: // this TabPanel is wrapped by another Panel so the title will be applied
[
eastPanelTree,
{
id: 'eastPanelCenter',
xtype: 'panel',
title: _('ID_PROCESS')+': '+pro_title,
region: 'center',
layout: 'fit',
items:[
new Ext.TabPanel({
id : 'usersPanelTabs',
title : '',
border: true, // already wrapped so don't add another border
activeTab : 0, // second tab initially active
tabPosition : 'top',
split : true,
collapseMode:'mini',
//height : 318,
items : [
propertiesGrid,
usersTaskGrid,
usersTaskAdHocGrid
]
})
]
}
]
}
var westPanel = {
region: 'west',
id: 'west-panel', // see Ext.getCmp() below
title: '&nbsp;',
split: false,
width: 37,
minSize: 20,
maxSize: 400,
collapsible: true,
layout: 'table',
layoutConfig: {columns:1},
defaults: {frame:true},
margins: '0 3 3 0',
items: [
toolbarPanel,
actorsPanel
]
}
var centerPanel = new Ext.Panel({
//title: '',
region: 'center', // a center region is ALWAYS required for border layout
id: 'designerPanel',
contentEl: 'center1',
autoScroll: true,
tbar: northPanelItems
})
var viewport = new Ext.Viewport({
layout: 'border',
items:[
/*new Ext.Toolbar({
region: 'north',
height: 25, // give north and south regions a height
items: mainMenu
}),*/
new Ext.TabPanel({
id: 'mainTabPanel',
region: 'center',
deferredRender: false,
activeTab: 0, // first tab initially active
items: [
{
title:'BPMN Designer',
id: 'designerTab',
layout: 'border',
items:[
// create instance immediately
//northPanel,
//southPanel,
eastPanel,
westPanel,
// in this instance the TabPanel is not wrapped by another panel
// since no title is needed, this Panel is added directly
// as a Container
centerPanel
],
_setDesignerTitle: function(title) {
title = title.length > 20 ? title.substring(0, 20) + '...' : title;
Ext.getCmp('designerTab').setTitle('<b>'+_('ID_PROCESSMAP_TITLE')+': </b> ' + title);
}
}
],
_addTab: function(option) {
alert(option);
},
_addTabFrame: tabFrame = function(name, title, url) {
title = title.length > 20 ? title.substring(0, 20) + '...' : title;
tabId = 'pm-tab-'+name ;
//var uri = 'ajaxListener?action=' + name;
var TabPanel = Ext.getCmp('mainTabPanel');
var tab = TabPanel.getItem(tabId);
if( tab ) {
TabPanel.setActiveTab(tabId);
} else {
TabPanel.add({
xtype:'iframepanel',
id: tabId,
title: title,
frameConfig:{name: name + 'Frame', id: name + 'Frame'},
defaultSrc : url,
loadMask:{msg:'Loading...'},
bodyStyle:{height:'600px'},
width:'1024px',
closable:true,
autoScroll: true
}).show();
TabPanel.doLayout();
}
}
})
]
});
Ext.getCmp('designerTab')._setDesignerTitle(pro_title);
Ext.fly(document).on("scroll", function(){
if( usersPanel.isVisible() ) {
if (usersPanel._scrollPosTimer) {
clearTimeout(usersPanel._scrollPosTimer);
}
usersPanel._scrollPosTimer = setTimeout(function() {
usersPanel.setPosition(usersPanel._posRelToView[0] + divScroll.scrollLeft, usersPanel._posRelToView[1] + divScroll.scrollTop);
}, 100);
}
});
processObj = new ProcessOptions();
ProcessMapObj = new ProcessMapContext();
workflow = new MyWorkflow("paintarea");
workflow.setEnableSmoothFigureHandling(false);
//workflow.scrollArea.width = 2000;
var listener = new SelectionListener1(workflow);
workflow.addSelectionListener(listener);
if(typeof pro_uid !== 'undefined') {
Ext.Ajax.request({
url: 'bpmnProxy/openProcess?PRO_UID=' + pro_uid,
success: function(response) {
shapesData = createShapes(response.responseText);
createConnection(shapesData);
/**
* erik: Setting Drop targets from users & groups grids to assignment to tasks
* for all existing tasks
*/
var dropEls = Ext.get('paintarea').query('.x-task');
for(var i = 0; i < dropEls.length; i++)
new Ext.dd.DropTarget(dropEls[i], {ddGroup:'task-assignment', notifyDrop : _onDropActors});
},
failure: function(){
Ext.Msg.alert ('Failure');
}
});
}
//Get main into workflow object
workflow.main = Ext.getCmp('centerRegion');
//workflow.setSnapToGeometry(false);
canvas = Ext.get('paintarea');
contextCanvasMenu = new Ext.menu.Menu({
items: [
/* {
text: 'Edit Process',
handler: ProcessMapObj.editProcess,
iconCls: 'button_menu_ext ss_sprite ss_page_white_edit',
scope: this
},
*/
{
text: 'Export Process',
handler: ProcessMapObj.exportProcess,
iconCls: 'button_menu_ext ss_sprite ss_script_go',
scope: this
}, {
text: 'Add Task',
handler: ProcessMapObj.addTask,
iconCls: 'button_menu_ext ss_sprite ss_layout_add',
scope: this
}, {
text: 'Add Subprocess',
handler: workflow.subProcess,
iconCls: 'button_menu_ext ss_sprite ss_layout_link',
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',
iconCls: 'button_menu_ext ss_sprite ss_application_key',
handler: ProcessMapObj.processPermission,
scope: this
},{
text: 'Process Supervisor',
iconCls: 'button_menu_ext ss_sprite ss_group',
menu: { // <-- submenu by nested config object
items: [
// stick any markup in a menu
{
text: 'Supervisors',
iconCls: 'button_menu_ext ss_sprite ss_group',
handler: ProcessMapObj.processSupervisors
},
{
text: 'DynaForm',
iconCls: 'button_menu_ext ss_sprite ss_application_form',
handler: ProcessMapObj.processDynaform
},
{
text: 'Input Documents',
iconCls: 'button_menu_ext ss_sprite ss_page_white_put',
handler: ProcessMapObj.processIODoc
}
]
}
},{
text: 'Case Tracker',
iconCls: 'button_menu_ext ss_sprite ss_exclamation',
menu: { // <-- submenu by nested config object
items: [
// stick any markup in a menu
{
text: 'Properties',
iconCls: 'button_menu_ext ss_sprite ss_exclamation',
handler: ProcessMapObj.caseTrackerProperties,
scope:this
},
{
text: 'Objects',
iconCls: 'button_menu_ext ss_sprite ss_exclamation',
handler: ProcessMapObj.caseTrackerObjects,
scope:this
}
]
}
}, {
text: 'Process File Manager',
iconCls: 'button_menu_ext ss_sprite ss_folder',
menu: { // <-- submenu by nested config object
items: [
// stick any markup in a menu
{
text: 'mailTemplates',
iconCls: 'button_menu_ext ss_sprite ss_email',
handler: ProcessMapObj.processFileManager
},
{
text: 'public',
iconCls: 'button_menu_ext ss_sprite ss_folder_go',
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();
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("center1").parentNode;
Ext.get('x-shapes-task').child('.x-btn-mc').setStyle('text-align', 'left');
Ext.get('x-shapes-startEvent').child('.x-btn-mc').setStyle('text-align', 'left');
Ext.get('x-shapes-interEvent').child('.x-btn-mc').setStyle('text-align', 'left');
Ext.get('x-shapes-endEvent').child('.x-btn-mc').setStyle('text-align', 'left');
Ext.get('x-shapes-gateways').child('.x-btn-mc').setStyle('text-align', 'left');
Ext.get('x-shapes-annotation').child('.x-btn-mc').setStyle('text-align', 'left');
Ext.get('x-pm-users').child('.x-btn-mc').setStyle('text-align', 'left');
Ext.get('x-pm-groups').child('.x-btn-mc').setStyle('text-align', 'left');
Ext.get('x-pm-users-adhoc').child('.x-btn-mc').setStyle('text-align', 'left');
Ext.get('x-pm-groups-adhoc').child('.x-btn-mc').setStyle('text-align', 'left');
/**
* Setting tooltips ti tollbar items
*/
new Ext.ToolTip({
target: 'x-shapes-task',
title: 'Task',
trackMouse: true,
anchor: 'right',
html: ''
});
new Ext.ToolTip({
target: 'x-shapes-startEvent',
title: 'Event',
trackMouse: true,
anchor: 'right',
html: 'Start'
});
new Ext.ToolTip({
target: 'x-shapes-interEvent',
title: 'Event',
trackMouse: true,
anchor: 'right',
html: 'Intermediate'
});
new Ext.ToolTip({
target: 'x-shapes-endEvent',
title: 'Event',
trackMouse: true,
anchor: 'right',
html: 'End'
});
new Ext.ToolTip({
target: 'x-shapes-gateways',
title: 'Gateway',
trackMouse: true,
anchor: 'right',
html: ''
});
new Ext.ToolTip({
target: 'x-shapes-annotation',
title: 'Annotation',
anchor: 'right',
trackMouse: true,
html: ''
});
new Ext.ToolTip({
target: 'x-pm-users',
title: 'Actors',
anchor: 'right',
trackMouse: true,
html: 'Users'
});
new Ext.ToolTip({
target: 'x-pm-groups',
title: 'Actors',
anchor: 'right',
trackMouse: true,
html: 'Groups'
});
new Ext.ToolTip({
target: 'x-pm-users-adhoc',
title: 'Actors',
anchor: 'right',
trackMouse: true,
html: 'Ad Hoc Users'
});
new Ext.ToolTip({
target: 'x-pm-groups-adhoc',
title: 'Actors',
anchor: 'right',
trackMouse: true,
html: 'Ad Hoc Groups'
});
/**
* setting drag sources for Toolbar items
*/
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-annotation", {
ddGroup:'TreeDD',
dragData:{
name: "bpmnAnnotation"
}
});
/*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 droptarget=new Ext.dd.DropTarget('paintarea',{
ddGroup:'TreeDD'
});
//Creating Pool
//var oPool = new bpmnPool(workflow);
//workflow.addFigure(oPool,100,70);
if(workflow.taskNo == '')
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();
var scrollLeft = workflow.getScrollLeft();
var scrollTop = workflow.getScrollTop();
if(data.name == 'bpmnTask') {
workflow.boundaryEvent = false;
}
if(typeof workflow.zoomfactor == 'undefined') {
workflow.zoomfactor = 1;
}
workflow.task_width='';
workflow.annotationName='Annotation';
workflow.orgXPos = eval(e.xy[0]/workflow.zoomfactor);
workflow.orgYPos = eval(e.xy[1]/workflow.zoomfactor);
NewShape = eval("new "+data.name+"(workflow)");
NewShape.x = e.xy[0];
NewShape.y = e.xy[1];
if(data.name == 'bpmnAnnotation') {
NewShape.actiontype = 'addText';
workflow.saveShape(NewShape); //Saving task when user drags and drops it
}
else if(data.name == 'bpmnTask') {
NewShape.actiontype = 'addTask';
workflow.saveShape(NewShape); //Saving Annotations when user drags and drops it
}
else if(data.name.match(/Event/)) {
NewShape.actiontype = 'addEvent';
NewShape.mode = 'ddEvent';
workflow.saveShape(NewShape); //Saving Annotations when user drags and drops it
}
else if(data.name.match(/Gateway/)){
NewShape.actiontype = 'addGateway';
NewShape.mode = 'ddGateway';
workflow.saveShape(NewShape); //Saving Annotations when user drags and drops it
}
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
if(typeof shapes.routes != 'undefined' && shapes.routes != '') {
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 == this.workflow.figures.data[conn].id ){
targetObj = this.workflow.figures.data[conn];
}
}
}
//Making Connections
if(targetObj.type == 'bpmnAnnotation') {
var connObj = new DottedConnection();
connObj.setSource(sourceObj.output2);
connObj.setTarget(targetObj.input1);
}
else {
var connObj = new DecoratedConnection();
connObj.setSource(sourceObj.output1);
connObj.setTarget(targetObj.input2);
}
connObj.id = shapes.routes[i][0];
this.workflow.addFigure(connObj);
}
}
}
function createShapes(stringData)
{
var shapes = Ext.util.JSON.decode(stringData); //stringData.split("|");
workflow.taskNo = 0;
//Create all shapes
//case 'tasks':
for(var k=0;k<shapes.tasks.length;k++){
var task_boundary = shapes.tasks[k][6];
if(task_boundary != null && task_boundary == 'TIMER' && task_boundary != '')
workflow.boundaryEvent = true;
else
workflow.boundaryEvent = false;
if(k != 0)
workflow.taskNo++;
workflow.taskName = shapes.tasks[k][1];
//workaround for Old Processmap widht and height
if(shapes.tasks[k][4] == 110) {
workflow.task_width = 165;
}
else {
workflow.task_width = shapes.tasks[k][4];
}
if(shapes.tasks[k][5] == 60) {
workflow.task_height = 40;
}
else {
workflow.task_height = shapes.tasks[k][5];
}
workflow.orgXPos = shapes.tasks[k][2];
workflow.orgYPos = shapes.tasks[k][3];
NewShape = eval("new bpmnTask(workflow)");
NewShape.x = shapes.tasks[k][2];
NewShape.y = shapes.tasks[k][3];
NewShape.taskName = shapes.tasks[k][1];
workflow.setBoundary(NewShape);
workflow.addFigure(NewShape, NewShape.x, NewShape.y);
NewShape.html.id = shapes.tasks[k][0];
NewShape.id = shapes.tasks[k][0];
}
//case 'gateways':
for(var k=0;k<shapes.gateways.length;k++){
var srctype = shapes.gateways[k][1];
NewShape = eval("new "+srctype+"(workflow)");
NewShape.x = shapes.gateways[k][2];
NewShape.y = shapes.gateways[k][3];
// workflow.setBoundary(NewShape);
workflow.addFigure(NewShape, NewShape.x, NewShape.y);
//Setting newshape id to the old shape id
NewShape.html.id = shapes.gateways[k][0];
NewShape.id = shapes.gateways[k][0];
}
//case 'events':
for(var k=0;k<shapes.events.length;k++) {
var srceventtype = shapes.events[k][1];
var tas_uid = shapes.events[k][4];
if(tas_uid != '') {
NewShape = eval("new "+srceventtype+"(workflow)");
NewShape.x = shapes.events[k][2];
NewShape.y = shapes.events[k][3];
workflow.setBoundary(NewShape);
workflow.addFigure(NewShape, NewShape.x, NewShape.y);
//Setting newshape id to the old shape id
NewShape.html.id = shapes.events[k][0];
NewShape.id = shapes.events[k][0];
}
else if(tas_uid == '') {
NewShape = eval("new "+srceventtype+"(workflow)");
NewShape.x = shapes.events[k][2];
NewShape.y = shapes.events[k][3];
workflow.setBoundary(NewShape);
workflow.addFigure(NewShape, NewShape.x, NewShape.y);
//Setting newshape id to the old shape id
NewShape.html.id = shapes.events[k][0];
NewShape.id = shapes.events[k][0];
}
}
//case 'annotations':
for(var k=0;k<shapes.annotations.length;k++){
workflow.annotationName = shapes.annotations[k][1];
workflow.anno_width = shapes.annotations[k][4];
workflow.anno_height = shapes.annotations[k][5];
NewShape = eval("new bpmnAnnotation(workflow)");
NewShape.x = shapes.annotations[k][2];
NewShape.y = shapes.annotations[k][3];
workflow.setBoundary(NewShape);
workflow.addFigure(NewShape, NewShape.x, NewShape.y);
//Setting newshape id to the old shape id
NewShape.html.id = shapes.annotations[k][0];
NewShape.id = shapes.annotations[k][0];
}
//case 'subprocess':
for(var k=0;k<shapes.subprocess.length;k++){
workflow.subProcessName = shapes.subprocess[k][1];
NewShape = eval("new bpmnSubProcess(workflow)");
NewShape.x = shapes.subprocess[k][2];
NewShape.y = shapes.subprocess[k][3];
workflow.setBoundary(NewShape);
workflow.addFigure(NewShape, NewShape.x, NewShape.y);
//Setting newshape id to the old shape id
NewShape.html.id = shapes.subprocess[k][0];
NewShape.id = shapes.subprocess[k][0];
}
if(typeof(workflow.taskNo) != 'undefined' && workflow.taskNo != 0)
workflow.taskNo++;
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;
}
saveProcess = function()
{
// 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();
var loadMask = new Ext.LoadMask(document.body, {msg:'Saving..'});
loadMask.show();
if(typeof pro_uid != 'undefined')
{
Ext.Ajax.request({
url: '../bpmn/saveProcess.php',
method: 'POST',
success: function(response) {
var result = Ext.util.JSON.decode(response.responseText);
loadMask.hide();
if( result.success ) {
PMExt.notify(_('ID_PROCESS_SAVE'), result.msg);
} else {
PMExt.error(_('ID_ERROR'), result.msg);
}
},
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');
}
});
//erik: selection Listener
SelectionListener1 = function(_43b1){
this.workflow = _43b1;
this.lastSelectedItem = null;
};
SelectionListener1.prototype.type = "SelectionListener1";
SelectionListener1.prototype.onSelectionChanged = function(_43b2) {
if( this.workflow.currentSelection )
if (this.lastSelectedItem !== this.workflow.currentSelection.id ) {
if( this.workflow.currentSelection.type == 'bpmnTask' || this.workflow.currentSelection.type == 'bpmnSubProcess' ) {
this.lastSelectedItem = this.workflow.currentSelection.id;
//console.log('selecting task: '+this.workflow.currentSelection.taskName);
//erik: to set selected the respective node on eastTreePanel
var currEatTreeNode = Ext.getCmp('eastPanelTree').getNodeById(this.workflow.currentSelection.id);
if( typeof currEatTreeNode != 'undefined' )
currEatTreeNode.select();
}
}
};

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff