diff --git a/tests/automated/workflow/engine/classes/classXpdlTest.php b/tests/automated/workflow/engine/classes/classXpdlTest.php deleted file mode 100644 index 84980ed6e..000000000 --- a/tests/automated/workflow/engine/classes/classXpdlTest.php +++ /dev/null @@ -1,860 +0,0 @@ -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); - } - - } diff --git a/workflow/engine/classes/class.xpdl.php b/workflow/engine/classes/class.xpdl.php deleted file mode 100755 index af6627252..000000000 --- a/workflow/engine/classes/class.xpdl.php +++ /dev/null @@ -1,3958 +0,0 @@ -. - * - * For more information, contact Colosa Inc, 2566 Le Jeune Rd., - * Coral Gables, FL, 33134, USA, or email info@colosa.com. - */ - -G::LoadClass( 'processes' ); -G::LoadClass( 'tasks' ); -G::LoadClass( 'derivation' ); -require_once 'classes/model/Users.php'; -require_once 'classes/model/Configuration.php'; -require_once 'classes/model/Gateway.php'; -require_once 'classes/model/Event.php'; - -/** - * - * @package workflow.engine.classes - */ -class Xpdl extends processes -{ - - /** - * This public function creates a new Process, defined in the object $oData - * - * @param array $aData - * @param array $tasks - * @param string $pmFilename - * @return void - */ - public function createProcessFromDataXpdl ($oData, $tasks) - { - if (! isset( $oData->process['PRO_UID'] ) || trim( $oData->process['PRO_UID'] ) == '') { - $oData->process['PRO_UID'] = G::generateUniqueID(); - } - $this->removeProcessRows( $oData->process['PRO_UID'] ); - $uid = $this->createProcessRow( $oData->process ); - $this->createTaskRows( $oData->tasks ); - $newTasks = $this->verifyTasks( $uid, $tasks ); - if (! isset( $oData->routes )) { - $oData->routes = array (); - } - $this->createRouteRowsXpdl( $uid, $oData->routes, $newTasks ); - $this->createLaneRows( $oData->lanes ); - $this->createDynaformRows( $oData->dynaforms ); - $this->createInputRows( $oData->inputs ); - $this->createOutputRows( $oData->outputs ); - $this->createStepRows( $oData->steps ); - $this->createStepSupervisorRows( isset( $oData->stepSupervisor ) ? $oData->stepSupervisor : array () ); - $this->createTriggerRows( $oData->triggers ); - $this->createStepTriggerRows( $oData->steptriggers ); - $this->createTaskUserRows( $oData->taskusers ); - $this->createGroupRow( $oData->groupwfs ); - $this->createDBConnectionsRows( isset( $oData->dbconnections ) ? $oData->dbconnections : array () ); - $this->createReportTables( isset( $oData->reportTables ) ? $oData->reportTables : array (), isset( $oData->reportTablesVars ) ? $oData->reportTablesVars : array () ); - $this->createSubProcessRowsXpdl( $uid, isset( $oData->subProcess ) ? $oData->subProcess : array (), $newTasks ); - $this->createCaseTrackerRows( isset( $oData->caseTracker ) ? $oData->caseTracker : array () ); - $this->createCaseTrackerObjectRows( isset( $oData->caseTrackerObject ) ? $oData->caseTrackerObject : array () ); - $this->createObjectPermissionsRows( isset( $oData->objectPermissions ) ? $oData->objectPermissions : array () ); - $this->createStageRows( isset( $oData->stage ) ? $oData->stage : array () ); - $this->createFieldCondition( isset( $oData->fieldCondition ) ? $oData->fieldCondition : array (), $oData->dynaforms ); - $this->createEventRows( isset( $oData->event ) ? $oData->event : array () ); - $this->createCaseSchedulerRows( isset( $oData->caseScheduler ) ? $oData->caseScheduler : array () ); - } - - /** - * this public function creates a new Process, defined in the object $oData - * - * @param string $sProUid - * @return boolean - */ - public function updateProcessFromDataXpdl ($oData, $tasks) - { - if (is_array( $oData->process )) { - $this->updateProcessRow( $oData->process ); - } - $this->removeProcessRows( $oData->process['PRO_UID'] ); - $uid = $this->createProcessRow( $oData->process ); - $this->createTaskRows( $oData->tasks ); - $newTasks = $this->verifyTasks( $uid, $tasks ); - $this->createRouteRowsXpdl( $uid, $oData->routes, $newTasks ); - $this->createLaneRows( $oData->lanes ); - $this->createDynaformRows( $oData->dynaforms ); - $this->createInputRows( $oData->inputs ); - $this->createOutputRows( $oData->outputs ); - $this->createStepRows( $oData->steps ); - $this->createStepSupervisorRows( $oData->stepSupervisor ); - $this->createTriggerRows( $oData->triggers ); - $this->createStepTriggerRows( $oData->steptriggers ); - $this->createTaskUserRows( $oData->taskusers ); - $this->createGroupRow( $oData->groupwfs ); - $this->createDBConnectionsRows( $oData->dbconnections ); - $this->updateReportTables( $oData->reportTables, $oData->reportTablesVars ); - $this->createSubProcessRows( $oData->subProcess ); - $this->createCaseTrackerRows( $oData->caseTracker ); - $this->createCaseTrackerObjectRows( $oData->caseTrackerObject ); - $this->createObjectPermissionsRows( $oData->objectPermissions ); - $this->createStageRows( $oData->stage ); - $this->createFieldCondition( $oData->fieldCondition, $oData->dynaforms ); - $this->createEventRows( $oData->event ); - $this->createCaseSchedulerRows( $oData->caseScheduler ); - - } - - /** - * this public function creates a new Process, defined in the object $oData - * - * @param string $sProUid - * @return boolean - */ - public function createProcessFromDataPmxml ($oData) - { - $this->removeProcessRows( $oData->process['PRO_UID'] ); - $this->createProcessRow( $oData->process ); - $this->createDynaformRows( $oData->dynaforms ); - } - - /** - * This public function update the dynaforms - * - * @param string $sProUid - * @param array $fields - * @return boolean - */ - // public function updateDynaformsPmxml($uid,$fields) - // { - // $oData->dynaforms = $this->getDynaformRows ( $uid); - // $count = sizeof($oData->dynaforms); - // foreach ($fields as $val => $id){ - // $oData->dynaforms[$count]= $id; - // $count = $count + 1 ; - // } - // $this->createDynaformRows ($oData->dynaforms ); - // } - - - /** - * This public function create the subProcess from data - * - * @param array $oData - * @param array $tasks - * @return void - */ - public function createSubProcessFromDataXpdl ($oData, $tasks) - { - $this->removeProcessRows( $oData->process['PRO_UID'] ); - $uid = $this->createProcessRow( $oData->process ); - $this->createTaskRows( $oData->tasks ); - $newTasks = $this->verifyTasks( $uid, $tasks ); - $this->createRouteRowsXpdl( $uid, $oData->routes, $newTasks ); - $this->createLaneRows( $oData->lanes ); - $this->createDynaformRows( $oData->dynaforms ); - $this->createInputRows( $oData->inputs ); - $this->createOutputRows( $oData->outputs ); - $this->createStepRows( $oData->steps ); - $this->createStepSupervisorRows( isset( $oData->stepSupervisor ) ? $oData->stepSupervisor : array () ); - $this->createTriggerRows( $oData->triggers ); - $this->createStepTriggerRows( $oData->steptriggers ); - $this->createTaskUserRows( $oData->taskusers ); - $this->createGroupRow( $oData->groupwfs ); - $this->createDBConnectionsRows( isset( $oData->dbconnections ) ? $oData->dbconnections : array () ); - $this->createReportTables( isset( $oData->reportTables ) ? $oData->reportTables : array (), isset( $oData->reportTablesVars ) ? $oData->reportTablesVars : array () ); - $this->createSubProcessRowsXpdl( $uid, isset( $oData->subProcess ) ? $oData->subProcess : array (), $newTasks ); - $this->createCaseTrackerRows( isset( $oData->caseTracker ) ? $oData->caseTracker : array () ); - $this->createCaseTrackerObjectRows( isset( $oData->caseTrackerObject ) ? $oData->caseTrackerObject : array () ); - $this->createObjectPermissionsRows( isset( $oData->objectPermissions ) ? $oData->objectPermissions : array () ); - $this->createStageRows( isset( $oData->stage ) ? $oData->stage : array () ); - $this->createFieldCondition( isset( $oData->fieldCondition ) ? $oData->fieldCondition : array (), $oData->dynaforms ); - $this->createEventRows( isset( $oData->event ) ? $oData->event : array () ); - $this->createCaseSchedulerRows( isset( $oData->caseScheduler ) ? $oData->caseScheduler : array () ); - } - - /** - * This public function verify the tasks of a process that was created with the tasks they were sent to the process - * - * @param string $oProUid - * @param array $fieldsTasks - * @return array - */ - public function verifyTasks ($sProUid, $fieldsTasks) - { - $process = new Process(); - $oData->tasks = $this->getTaskRows( $sProUid ); - $findTask = 0; - $findNext = 0; - foreach ($fieldsTasks as $taskVal => $idVal) { - foreach ($oData->tasks as $task => $id) { - if ($idVal['TAS_TITLE'] == $id['TAS_TITLE'] and $idVal['TAS_POSX'] == $id['TAS_POSX'] and $idVal['TAS_POSY'] == $id['TAS_POSY']) { - if (isset( $idVal['TAS_DESCRIPTION'] ) and isset( $id['TAS_DESCRIPTION'] )) { - if ($idVal['TAS_DESCRIPTION'] == $id['TAS_DESCRIPTION']) { - $fieldsTasks[$taskVal]['TAS_UID_DATA'] = $id['TAS_UID']; - } - } - $fieldsTasks[$taskVal]['TAS_UID_DATA'] = $id['TAS_UID']; - } - } - } - return $fieldsTasks; - } - - /** - * This public function creates the rows of the process - * - * @param string $sProUid - * @param array $routes - * @param array $fieldsTasks - * @return void - */ - public function createRouteRowsXpdl ($sProUid, $routes, $fieldsTasks) - { - $process = new Process(); - $oData->tasks = $this->getTaskRows( $sProUid ); - foreach ($routes as $taskRoute => $idRoute) { - $findTask = 0; - $findNext = 0; - foreach ($oData->tasks as $task => $id) { - if ($idRoute['TAS_UID'] == $id['TAS_UID']) { - $findTask = 1; - } - if ($idRoute['ROU_NEXT_TASK'] != '-1') { - if ($idRoute['ROU_NEXT_TASK'] == $id['TAS_UID']) { - $findNext = 1; - } - } else { - $findNext = 1; - } - } - if ($findTask == 0) { - $id = $this->findIdTask( $idRoute['TAS_UID'], $fieldsTasks ); - $routes[$taskRoute]['TAS_UID'] = $id; - } - if ($findNext == 0) { - $id = $this->findIdTask( $idRoute['ROU_NEXT_TASK'], $fieldsTasks ); - $routes[$taskRoute]['ROU_NEXT_TASK'] = $id; - } - } - $this->createRouteRows( $routes ); - } - - /** - * Create Sub Process rows from an array, removing those subprocesses with - * the same UID. - * - * @param $SubProcess array - * @return void. - */ - public function createSubProcessRowsXpdl ($sProUid, $SubProcess, $tasks) - { - $process = new Process(); - $oData->tasks = $this->getTaskRows( $sProUid ); - foreach ($SubProcess as $key => $row) { - $findTask = 0; - foreach ($oData->tasks as $task => $id) { - if ($row['TAS_PARENT'] == $id['TAS_UID']) { - $findTask = 1; - } - } - if ($findTask == 0) { - $id = $this->findIdTask( $row['TAS_PARENT'], $tasks ); - $SubProcess[$key]['TAS_PARENT'] = $id; - } - $oSubProcess = new SubProcess(); - if ($oSubProcess->subProcessExists( $row['SP_UID'] )) { - $oSubProcess->remove( $row['SP_UID'] ); - } - $res = $oSubProcess->create( $row ); - } - return; - } - - /** - * this public function find the id of the task - * - * @param string $idTask - * @param array $routes - * @return array - */ - public function findIdTask ($idTask, $routes) - { - foreach ($routes as $value => $id) { - if ($id['TAS_UID'] == $idTask) { - return $id['TAS_UID_DATA']; - } - } - } - - /** - * This public function create the file . - * - * xpdl from a process - * - * @param string $sProUid - * @return void - */ - public function xmdlProcess ($sProUid = '') - { - $oProcess = new Process(); - $oData->process = $this->getProcessRow( $sProUid, false ); - $oData->tasks = $this->getTaskRows( $sProUid ); - $oData->routes = $this->getRouteRows( $sProUid ); - $oData->lanes = $this->getLaneRows( $sProUid ); - $oData->inputs = $this->getInputRows( $sProUid ); - $oData->outputs = $this->getOutputRows( $sProUid ); - $oData->dynaforms = $this->getDynaformRows( $sProUid ); - $oData->steps = $this->getStepRows( $sProUid ); - $oData->triggers = $this->getTriggerRows( $sProUid ); - $oData->taskusers = $this->getTaskUserRows( $oData->tasks ); - $oData->groupwfs = $this->getGroupwfRows( $oData->taskusers ); - $oData->steptriggers = $this->getStepTriggerRows( $oData->tasks ); - $oData->dbconnections = $this->getDBConnectionsRows( $sProUid ); - $oData->reportTables = $this->getReportTablesRows( $sProUid ); - $oData->reportTablesVars = $this->getReportTablesVarsRows( $sProUid ); - $oData->stepSupervisor = $this->getStepSupervisorRows( $sProUid ); - $oData->objectPermissions = $this->getObjectPermissionRows( $sProUid ); - $oData->subProcess = $this->getSubProcessRow( $sProUid ); - $oData->caseTracker = $this->getCaseTrackerRow( $sProUid ); - $oData->caseTrackerObject = $this->getCaseTrackerObjectRow( $sProUid ); - $oData->stage = $this->getStageRow( $sProUid ); - $oData->fieldCondition = $this->getFieldCondition( $sProUid ); - $oData->event = $this->getEventRow( $sProUid ); - $oData->caseScheduler = $this->getCaseSchedulerRow( $sProUid ); - $path = PATH_DOCUMENT . 'output' . PATH_SEP; - if (! is_dir( $path )) { - G::verifyPath( $path, true ); - } - $proTitle = (substr( G::inflect( $oData->process['PRO_TITLE'] ), 0, 245 )); - $proTitle = preg_replace( "/[^A-Za-z0-9_]/", "", $proTitle ); - //Calculating the maximum length of file name - $pathLength = strlen( PATH_DATA . "sites" . PATH_SEP . SYS_SYS . PATH_SEP . "files" . PATH_SEP . "output" . PATH_SEP ); - $length = strlen( $proTitle ) + $pathLength; - if ($length >= 250) { - $proTitle = myTruncate( $proTitle, 250 - $pathLength, '_', '' ); - } - $index = ''; - $lastIndex = ''; - do { - $filename = $path . $proTitle . $index . '.xpdl'; - $lastIndex = $index; - if ($index == '') { - $index = 1; - } else { - $index ++; - } - } while (file_exists( $filename )); - $proTitle .= $lastIndex; - $filenameOnly = $proTitle . '.xpdl'; - $xml = fopen( $filename . 'tpm', "wb" ); - $process = $oData->process; - $coordinateMaximumY = 0; - $coordinateMaximumX = 0; - $lanes = $oData->lanes; - foreach ($lanes as $keyLane => $valLane) { - if ($valLane['SWI_TYPE'] == "TEXT") { - $textLane = $valLane['SWI_TEXT']; - $longText = strlen( $textLane ); - $height = 0; - $width = 0; - if ($longText < 40) { - $height = 20; - $width = ($longText * 10) + 10; - } - if ($longText > 40) { - $numberRows = $longText / 40; - $height = $numberRows * 20; - $width = 250; - } - $coordinateX = $valLane['SWI_X'] + $width; - $coordinateY = $valLane['SWI_Y'] + $height; - if ($coordinateX > $coordinateMaximumX) { - $coordinateMaximumX = $coordinateX; - } - if ($coordinateY > $coordinateMaximumY) { - $coordinateMaximumY = $coordinateY; - } - } - } - foreach ($oData->tasks as $keyLane => $val) { - $coordinateX = $val['TAS_POSX'] + 160; - $coordinateY = $val['TAS_POSY'] + 38; - if ($coordinateX > $coordinateMaximumX) { - $coordinateMaximumX = $coordinateX; - } - if ($coordinateY > $coordinateMaximumY) { - $coordinateMaximumY = $coordinateY; - } - } - $data = $this->createPool( $process, $coordinateMaximumX + 60, $coordinateMaximumY + 60 ); - fwrite( $xml, '' ); - fwrite( $xml, $data ); - $artifacts = ''; - $artifacts .= $this->createArtifacts( $lanes, '0' ); - $dataProcess = ' - '; - $dataProcess .= ' - - - - '; - $activitySets = ''; - $subProcess = $oData->subProcess; - $subProcesses = $this->createSubProcessesXpdl( $subProcess, $oData->tasks ); - $activitySets .= $subProcesses['ACTIVITIES']; - $activitySets .= ''; - $artifacts .= $subProcesses['ARTIFACTS']; - $artifacts .= ' - '; - fwrite( $xml, $artifacts ); - fwrite( $xml, $dataProcess ); - fwrite( $xml, $activitySets ); - // Here are generated activities of a file. XPDL - // for this use the process tasks - $tasks = $oData->tasks; - $events = $oData->event; - $scheduler = $oData->caseScheduler; - $dataTasks = $this->createActivitiesXpdl( $tasks, $events, $scheduler ); - fwrite( $xml, $dataTasks['ACTIVITIES'] ); - $taskHidden = $dataTasks['TASK_HIDDEN']; - $routes = $oData->routes; - $dataRoutes = $this->createTransitionsXpdl( $routes, $tasks, $taskHidden ); - fwrite( $xml, $dataRoutes['ACTIVITIES'] ); - $data = ' - '; - fwrite( $xml, $data ); - fwrite( $xml, $dataTasks['TRANSITION'] ); - fwrite( $xml, $dataRoutes['TRANSITION'] ); - $data = ' - - - - - -'; - fwrite( $xml, $data ); - fclose( $xml ); - $filenameLink = 'processes_DownloadFileXpdl?p=' . $proTitle . '&r=' . rand( 100, 1000 ); - $result['FILENAMEXPDL'] = $proTitle . '.xpdl'; - $result['FILENAME_LINKXPDL'] = $filenameLink; - return $result; - } - - /** - * This public function create the pool from the process - * - * @param array $process - * @param string $coordinateMaximumX - * @param string $coordinateMaximumY - * @return string - */ - public function createPool ($process, $coordinateMaximumX, $coordinateMaximumY) - { - $data = ''; - $data .= ' - - - 2.1 - Process Maker - ' . $process['PRO_CREATE_DATE'] . ' - ' . $process['PRO_DESCRIPTION'] . ' - - - - - - CO - - - - - - - - - - - - - - - - - - '; - return $data; - } - - /** - * This public function generated the Artifacts of a file. - * XPDL - * - * @param array $lanes - * @param string $id - * @return string - */ - public function createArtifacts ($lanes, $id) - { - $artifacts = ''; - $idTask = ''; - foreach ($lanes as $keyLane => $valLane) { - if ($valLane['SWI_TYPE'] == "TEXT") { - $idLane = $valLane['SWI_UID']; - $textLane = $valLane['SWI_TEXT']; - $coordinateX = $valLane['SWI_X']; - $coordinateY = $valLane['SWI_Y']; - $longText = strlen( $textLane ); - if ($longText < 40) { - $height = 20; - $width = ($longText * 10) + 10; - } - if ($longText > 40) { - $numberRows = $longText / 40; - $height = $numberRows * 20; - $width = 250; - } - if ($id != 0) { - $idTask = ' ActivitySetId="' . $id . '"'; - } - $artifacts .= ' - - - - - - - - '; - } - } - return $artifacts; - } - - /** - * This public function creates SubProcesses - * - * @param array $tasks - * @param array $subProcess - * @return array - */ - public function createSubProcessesXpdl ($subProcess, $tasks) - { - $activitySets = ''; - $dataCreated = ''; - $artifacts = ''; - foreach ($subProcess as $key => $row) { - if ($row['SP_UID'] != '') { - $idTask = $row['TAS_PARENT']; - foreach ($tasks as $id => $value) { - if ($value['TAS_UID'] == $idTask) { - $nameTask = htmlentities( $value['TAS_TITLE'] ); - } - } - $activitySets .= ' - '; - if ($row['PRO_UID'] != '' && $row['PRO_UID'] != 0) { - $dataSubProcess = $this->serializeProcess( $row['PRO_UID'] ); - $data = unserialize( $dataSubProcess ); - $tasks = $data->tasks; - $subProcessData = $data->subProcess; - $subProcessTask = $data->tasks; - $lanes = $data->lanes; - $events = $data->event; - $scheduler = $data->caseScheduler; - $artifacts = $this->createArtifacts( $lanes, $idTask ); - $dataCreated = $this->createSubProcessesXpdl( $subProcessData, $subProcessTask ); - $dataTasks = $this->createActivitiesXpdl( $tasks, $events, $scheduler ); - $activitySets .= $dataTasks['ACTIVITIES']; - $taskHidden = $dataTasks['TASK_HIDDEN']; - $routes = $data->routes; - $dataRoutes = $this->createTransitionsXpdl( $routes, $tasks, $taskHidden ); - $activitySets .= $dataRoutes['ACTIVITIES']; - $activitySets .= ' - '; - $activitySets .= $dataTasks['TRANSITION']; - $activitySets .= $dataRoutes['TRANSITION']; - $activitySets .= ' - '; - } else { - $data = ' - - '; - } - $activitySets .= ''; - $activitySets .= $dataCreated; - } - } - $fields['ACTIVITIES'] = $activitySets; - $fields['ARTIFACTS'] = $artifacts; - return $fields; - } - - /** - * This public function creates activities from the tasks - * - * @param array $tasks - * @return array - */ - public function createActivitiesXpdl ($tasks, $events, $scheduler) - { - $dataTasks = ' - '; - $transitions = ' - '; - $start = 0; - $implementation = ''; - $taskHidden = array (); - $description = ''; - foreach ($tasks as $key => $val) { - $idTask = $val['TAS_UID']; - $nameTask = $val['TAS_TITLE']; - $coordinateX = $val['TAS_POSX']; - $coordinateY = $val['TAS_POSY']; - if ($val['TAS_TYPE'] == 'NORMAL' or $val['TAS_TYPE'] == 'SUBPROCESS') { - if ($val['TAS_TYPE'] == 'NORMAL') { - $implementation = ' - - - '; - } - if ($val['TAS_TYPE'] == 'SUBPROCESS') { - $implementation = ' - '; - } - if (isset( $val['TAS_DESCRIPTION'] )) { - $description = $val['TAS_DESCRIPTION']; - } else { - $description = ''; - } - $fillColor = $val['TAS_COLOR']; - if ($val['TAS_START'] == "TRUE") { - $start = 1; - } - if ($start == 1) { - $start = 0; - $positionX = $coordinateX + 65; - $positionY = $coordinateY - 45; - $dataTasks .= ' - - ' . $description . ' - - - - - - - - - - - - '; - $transitions .= ' - - - - - - - - - '; - } - $dataTasks .= ' - - ' . $description . '' . $implementation . ' - - - - - - - - - '; - } else { - if ($val['TAS_TYPE'] == 'HIDDEN') { - $taskHidden[] = $tasks[$key]; - } - } - } - - $aux = $events; - foreach ($events as $key => $row) { - $aux[$key] = $row['TAS_UID']; - } - if (sizeof( $events ) > 0) { - array_multisort( $aux, SORT_ASC, $events ); - unset( $aux ); - } - $findTask = 0; - $idTasks = array (); - $arrayTasks = array (); - $port = 5; - foreach ($events as $key => $val) { - if ($val['EVN_ACTION'] == 'SEND_MESSAGE' and $val['EVN_RELATED_TO'] == 'SINGLE') { - $idEvent = $val['EVN_UID']; - $idTask = $val['TAS_UID']; - foreach ($tasks as $id => $value) { - if ($value['TAS_UID'] == $idTask) { - $coordinateX = $value['TAS_POSX'] + 19; - $coordinateY = $value['TAS_POSY'] + 38; - $coordinateXM = $coordinateX + 96; - $coordinateYM = $coordinateY + 65; - } - } - foreach ($arrayTasks as $id => $value) { - if ($idTask == $value['ID']) { - $coordinateX = $value['X'] + 30; - $coordinateY = $value['Y']; - $coordinateXM = $value['XM'] + 30; - $coordinateYM = $value['YM']; - if ($coordinateY < 30) { - $coordinateX = $value['FIRSTX'] + 30; - $coordinateY = $value['FIRSTY']; - } - $arrayTasks[$id]['X'] = $coordinateX; - $arrayTasks[$id]['Y'] = $coordinateY; - $arrayTasks[$id]['PORT'] = $port + 1; - $findTask = 1; - $port = $arrayTasks[$id]['PORT']; - } - } - - $description = $val['EVN_DESCRIPTION']; - $arrayTo = $val['EVN_ACTION_PARAMETERS']; - foreach ($arrayTo as $idTo => $valueTo) { - $to = $valueTo; - } - $to = explode( '|', $to ); - $to = $to[0]; - $oConfiguration = new Configuration(); - $emailArray = $oConfiguration->load( 'Emails', '', '', '', '' ); - $arrayFrom = unserialize( $emailArray['CFG_VALUE'] ); - $passwd = $arrayFrom['MESS_PASSWORD']; - $passwdDec = G::decrypt( $passwd, 'EMAILENCRYPT' ); - if (strpos( $passwdDec, 'hash:' ) !== false) { - list ($hash, $pass) = explode( ":", $passwdDec ); - $arrayFrom['MESS_PASSWORD'] = $pass; - } - $from = $arrayFrom['MESS_ACCOUNT']; - if ($to == 'ext') { - $oUser = new Users(); - $aUser = $oUser->load( $_SESSION['USER_LOGGED'] ); - $to = $aUser['USR_USERNAME']; - } - $dataTasks .= ' - - - - - - TimeCycle - - - - - - - - - - - false - - - ' . $description . ' - - - - - - - - - ' . $description . ' - - - - - - - false - '; - $transitions .= ' - - - - - - - - - '; - if ($findTask == 0) { - $idTasks['ID'] = $idTask; - $idTasks['X'] = $coordinateX; - $idTasks['Y'] = $coordinateY; - $idTasks['FIRSTX'] = $coordinateX; - $idTasks['FIRSTY'] = $coordinateY; - $idTasks['XM'] = $coordinateXM; - $idTasks['YM'] = $coordinateYM; - $idTasks['PORT'] = $port; - $arrayTasks[] = $idTasks; - } - } - } - $idTasks = array (); - $arrayTasks = array (); - $findTask = 0; - foreach ($scheduler as $key => $val) { - if ($val['SCH_OPTION'] == 4) { - $idSch = $val['SCH_UID']; - $name = $val['SCH_NAME']; - $idTask = $val['TAS_UID']; - foreach ($tasks as $id => $value) { - if ($value['TAS_UID'] == $idTask) { - $coordinateX = $value['TAS_POSX'] - 60; - $coordinateY = $value['TAS_POSY'] + 5; - } - } - foreach ($arrayTasks as $id => $value) { - if ($idTask == $value['ID']) { - $coordinateX = $value['X']; - $coordinateY = $value['Y'] - 40; - if ($coordinateY < 30) { - $coordinateX = $value['FIRSTX'] + 50; - $coordinateY = $value['FIRSTY'] - 90; - } - $arrayTasks[$id]['X'] = $coordinateX; - $arrayTasks[$id]['Y'] = $coordinateY; - $findTask = 1; - } - } - $time = $val['SCH_TIME_NEXT_RUN']; - $time = explode( ' ', $time ); - $time = $time[0]; - $time = str_replace( '-', '/', $time ); - $dataTasks .= ' - - - - - - TimeCycle - - - - - - - - - - - false - '; - $transitions .= ' - - - - - - - - - '; - if ($findTask == 0) { - $idTasks['ID'] = $idTask; - $idTasks['X'] = $coordinateX; - $idTasks['Y'] = $coordinateY; - $idTasks['FIRSTX'] = $coordinateX; - $idTasks['FIRSTY'] = $coordinateY; - $arrayTasks[] = $idTasks; - } - } - if ($val['SCH_OPTION'] == 1) { - $idSch = $val['SCH_UID']; - $name = $val['SCH_NAME']; - $idTask = $val['TAS_UID']; - foreach ($tasks as $id => $value) { - if ($value['TAS_UID'] == $idTask) { - $coordinateX = $value['TAS_POSX'] - 60; - $coordinateY = $value['TAS_POSY'] + 5; - } - } - foreach ($arrayTasks as $id => $value) { - if ($idTask == $value['ID']) { - $coordinateX = $value['X']; - $coordinateY = $value['Y'] - 40; - if ($coordinateY < 30) { - $coordinateX = $value['FIRSTX'] + 50; - $coordinateY = $value['FIRSTY'] - 90; - } - $arrayTasks[$id]['X'] = $coordinateX; - $arrayTasks[$id]['Y'] = $coordinateY; - $findTask = 1; - } - } - $dataTasks .= ' - - - - - - TimeCycle - - - - - - - - - - - false - '; - $transitions .= ' - - - - - - - - - '; - if ($findTask == 0) { - $idTasks['ID'] = $idTask; - $idTasks['X'] = $coordinateX; - $idTasks['Y'] = $coordinateY; - $idTasks['FIRSTX'] = $coordinateX; - $idTasks['FIRSTY'] = $coordinateY; - $arrayTasks[] = $idTasks; - } - } - } - $data = array (); - $data['ACTIVITIES'] = $dataTasks; - $data['TRANSITION'] = $transitions; - $data['TASK_HIDDEN'] = $taskHidden; - return $data; - } - - /** - * This public function creates transitions - * - * @param array $routes - * @param array $tasks - * @return array - */ - public function createTransitionsXpdl ($routes, $tasks, $taskHidden) - { - $cont = 0; - $dataRoutes = ''; - $endEvent = 1; - $taskParallel = ''; - $routeParallel = ''; - $taskSecJoin = ''; - $routeSecJoin = ''; - $taskEvaluate = ''; - $routeEvaluate = ''; - $taskParallelEv = ''; - $routeParallelEv = ''; - $taskSelect = ''; - $routeSelect = ''; - $routeEnd = ''; - $arraySecJoin = array (); - $position = 0; - $fillColor = ''; - $transitions = ''; - $condition = ''; - $nextTask = ''; - $findFrom = 0; - $findTo = 0; - $routesTasks = $routes; - foreach ($routes as $key => $row) { - if ($row['ROU_TYPE'] == 'SEC-JOIN') { - $arraySecJoin[$position] = array (); - $arraySecJoin[$position] = $row; - $position = $position + 1; - unset( $routes[$key] ); - } - } - $aux = $arraySecJoin; - foreach ($arraySecJoin as $key => $row) { - $aux[$key] = $row['ROU_NEXT_TASK']; - } - if (sizeof( $arraySecJoin ) > 0) { - array_multisort( $aux, SORT_ASC, $arraySecJoin ); - unset( $aux ); - } - foreach ($routes as $key => $row) { - $uid[$key] = $row['TAS_UID']; - $case[$key] = $row['ROU_CASE']; - } - if (sizeof( $routes ) > 0) { - array_multisort( $uid, SORT_ASC, $case, SORT_ASC, $routes ); - } - $routes = array_merge( $routes, $arraySecJoin ); - $routesTasks = $routes; - foreach ($routes as $key => $val) { - $end = 0; - $idRoute = $val['ROU_UID']; - $idTask = $val['TAS_UID']; - $nextTask = $val['ROU_NEXT_TASK']; - $condition = htmlentities( $val['ROU_CONDITION'] ); - if ($nextTask == "-1") { - $end = 1; - } - $typeRoute = $val['ROU_TYPE']; - $route = ''; - if ($typeRoute != "SEQUENTIAL") { - switch ($typeRoute) { - case 'PARALLEL': - $coordinateX = 0; - $coordinateY = 0; - foreach ($tasks as $taskVal => $idVal) { - if ($idVal['TAS_UID'] == $idTask) { - $coordinateX = $idVal['TAS_POSX']; - $coordinateY = $idVal['TAS_POSY']; - } - } - foreach ($taskHidden as $taskVal => $idVal) { - if ($idVal['TAS_UID'] == $idTask) { - $coordinateX = $idVal['TAS_POSX']; - $coordinateY = $idVal['TAS_POSY']; - $idRoute = $idTask; - } - } - $positionX = $coordinateX + 60; - $positionY = $coordinateY + 40; - if ($idTask != $taskParallel) { - $taskParallel = $idTask; - $routeParallel = $idRoute; - $dataRoutes .= ' - - - - - - - - - - - false - '; - if ($taskParallel != $routeParallel) { - $transitions .= ' - - - - - - - - - '; - } - $transitions .= ' - - - - - - - - - '; - } else { - $transitions .= ' - - - - - - - - - '; - } - break; - case 'SEC-JOIN': - $coordinateX = 0; - $coordinateY = 0; - foreach ($tasks as $taskVal => $idVal) { - if ($idVal['TAS_UID'] == $nextTask) { - $coordinateX = $idVal['TAS_POSX']; - $coordinateY = $idVal['TAS_POSY']; - } - } - foreach ($taskHidden as $taskVal => $idVal) { - if ($idVal['TAS_UID'] == $idTask) { - $coordinateX = $idVal['TAS_POSX']; - $coordinateY = $idVal['TAS_POSY']; - $idRoute = $idTask; - } - } - $positionX = $coordinateX + 60; - $positionY = $coordinateY - 45; - if ($nextTask != $taskSecJoin) { - $taskSecJoin = $nextTask; - $routeSecJoin = $idRoute; - $dataRoutes .= ' - - - - - - - - - - - false - '; - if ($routeSecJoin != $taskSecJoin) { - $transitions .= ' - - - - - - - - - '; - } - $transitions .= ' - - - - - - - - - '; - } else { - $transitions .= ' - - - - - - - - - '; - } - break; - case 'EVALUATE': - $coordinateX = 0; - $coordinateY = 0; - foreach ($tasks as $taskVal => $idVal) { - if ($idVal['TAS_UID'] == $idTask) { - $coordinateX = $idVal['TAS_POSX']; - $coordinateY = $idVal['TAS_POSY']; - } - } - foreach ($taskHidden as $taskVal => $idVal) { - if ($idVal['TAS_UID'] == $idTask) { - $coordinateX = $idVal['TAS_POSX']; - $coordinateY = $idVal['TAS_POSY']; - $idRoute = $idTask; - } - } - $positionX = $coordinateX + 60; - $positionY = $coordinateY + 40; - if ($idTask != $taskEvaluate) { - $taskEvaluate = $idTask; - $routeEvaluate = $idRoute; - if ($nextTask != "-1") { - $dataRoutes .= ' - - - - - - - - - - - false - '; - if ($taskEvaluate != $routeEvaluate) { - $transitions .= ' - - - - - - - - - '; - } - $transitions .= ' - - - ' . $condition . ' - - - - - - - - '; - } - } else { - if ($nextTask != "-1") { - $transitions .= ' - - - ' . $condition . ' - - - - - - - - '; - } else { - $routeEnd = $routeEvaluate; - } - } - break; - case 'PARALLEL-BY-EVALUATION': - $coordinateX = 0; - $coordinateY = 0; - foreach ($tasks as $taskVal => $idVal) { - if ($idVal['TAS_UID'] == $idTask) { - $coordinateX = $idVal['TAS_POSX']; - $coordinateY = $idVal['TAS_POSY']; - } - } - foreach ($taskHidden as $taskVal => $idVal) { - if ($idVal['TAS_UID'] == $idTask) { - $coordinateX = $idVal['TAS_POSX']; - $coordinateY = $idVal['TAS_POSY']; - $idRoute = $idTask; - } - } - $positionX = $coordinateX + 60; - $positionY = $coordinateY + 40; - if ($idTask != $taskParallelEv) { - $taskParallelEv = $idTask; - $routeParallelEv = $idRoute; - $dataRoutes .= ' - - - - - - - - - - - false - '; - if ($taskParallelEv != $routeParallelEv) { - $transitions .= ' - - - - - - - - - '; - } - $transitions .= ' - - - ' . $condition . ' - - - - - - - - '; - } else { - $transitions .= ' - - - ' . $condition . ' - - - - - - - - '; - } - break; - case 'SELECT': - $coordinateX = 0; - $coordinateY = 0; - foreach ($tasks as $taskVal => $idVal) { - if ($idVal['TAS_UID'] == $idTask) { - $coordinateX = $idVal['TAS_POSX']; - $coordinateY = $idVal['TAS_POSY']; - } - } - foreach ($taskHidden as $taskVal => $idVal) { - if ($idVal['TAS_UID'] == $idTask) { - $coordinateX = $idVal['TAS_POSX']; - $coordinateY = $idVal['TAS_POSY']; - $idRoute = $idTask; - } - } - $positionX = $coordinateX + 60; - $positionY = $coordinateY + 40; - if ($idTask != $taskSelect) { - $taskSelect = $idTask; - $routeSelect = $idRoute; - $dataRoutes .= ' - - - - - - - - - - - false - '; - if ($taskSelect != $routeSelect) { - $transitions .= ' - - - - - - - - - '; - } - $transitions .= ' - - - ' . $condition . ' - - - - - - - - '; - } else { - if ($nextTask != "-1") { - $transitions .= ' - - - ' . $condition . ' - - - - - - - - '; - } else { - $routeEnd = $routeSelect; - } - } - break; - case 'DISCRIMINATOR': - $coordinateX = 0; - $coordinateY = 0; - $optional = $val['ROU_OPTIONAL']; - foreach ($tasks as $taskVal => $idVal) { - if ($idVal['TAS_UID'] == $nextTask) { - $coordinateX = $idVal['TAS_POSX']; - $coordinateY = $idVal['TAS_POSY']; - } - } - foreach ($taskHidden as $taskVal => $idVal) { - if ($idVal['TAS_UID'] == $idTask) { - $coordinateX = $idVal['TAS_POSX']; - $coordinateY = $idVal['TAS_POSY']; - $idRoute = $idTask; - } - } - $positionX = $coordinateX + 60; - $positionY = $coordinateY - 45; - if ($nextTask != $taskSecJoin) { - $taskDiscriminator = $nextTask; - $routeDiscriminator = $idRoute; - $dataRoutes .= ' - - - - - - - - - - - - - - false - '; - if ($routeDiscriminator != $taskDiscriminator) { - $transitions .= ' - - - - - - - - - '; - } - $transitions .= ' - - - - - - - - '; - } else { - $transitions .= ' - - - - - - - - - '; - } - break; - } - } - if ($end == 1) { - if ($typeRoute == "SEQUENTIAL") { - $coordinateX = 0; - $coordinateY = 0; - foreach ($tasks as $taskVal => $idVal) { - if ($idVal['TAS_UID'] == $idTask) { - $coordinateX = $idVal['TAS_POSX']; - $coordinateY = $idVal['TAS_POSY']; - } - } - $positionX = $coordinateX + 65; - $positionY = $coordinateY + 40; - $transitions .= ' - - - - - - - - - '; - } else { - $coordinateX = 0; - $coordinateY = 0; - foreach ($tasks as $taskVal => $idVal) { - if ($idVal['TAS_UID'] == $idTask) { - $coordinateX = $idVal['TAS_POSX']; - $coordinateY = $idVal['TAS_POSY']; - } - } - $positionX = $coordinateX + 120; - $positionY = $coordinateY + 40; - $idTask = $routeEnd; - $transitions .= ' - - - - - - - - - '; - } - $dataRoutes .= ' - - - - - - - - - - - - - false - '; - $end = 0; - $endEvent = 0; - } else { - if ($typeRoute == "SEQUENTIAL") { - $transitions .= ' - - - - - - - - - '; - } - foreach ($tasks as $taskVal => $idVal) { - if ($idVal['TAS_UID'] == $idTask) { - $coordinateX = $idVal['TAS_POSX'] + 190; - $coordinateY = $idVal['TAS_POSY'] + 5; - if (isset( $idVal['TAS_DEF_MESSAGE'] )) { - if ($idVal['TAS_DEF_MESSAGE'] != '' and $idVal['TAS_DEF_MESSAGE'] != null) { - $idEvent = G::generateUniqueID(); - $example = new Derivation(); - $fieldUserTo = $example->getAllUsersFromAnyTask( $nextTask ); - $fieldUserTo = $example->getUsersFullNameFromArray( $fieldUserTo ); - $fieldUserFrom = $example->getAllUsersFromAnyTask( $idTask ); - $fieldUserFrom = $example->getUsersFullNameFromArray( $fieldUserFrom ); - /*$oUser = new Users(); - $aUser = $oUser->load($_SESSION['USER_LOGGED']); - $from = $aUser['USR_USERNAME'];*/ - $description = ''; - $userFrom = ''; - $userTo = ''; - if (isset( $fieldUserFrom[0]['USR_USERNAME'] )) { - $userFrom = $fieldUserFrom[0]['USR_USERNAME']; - } - if (isset( $fieldUserTo[0]['USR_USERNAME'] )) { - $userTo = $fieldUserTo[0]['USR_USERNAME']; - } - $dataRoutes .= ' - - ' . $description . ' - - - - - - - - - ' . $description . ' - - - - - - - false - '; - $transitions .= ' - - - - - - - - - '; - } - } - } - } - } - } - $data = array (); - $data['ACTIVITIES'] = $dataRoutes; - $data['TRANSITION'] = $transitions; - return $data; - } - - /** - * Get the process Data from a filename . - * - * XPDL - * - * @param array $pmFilename - * @return void - */ - public function getProcessDataXpdl ($pmFilename) - { - if (! file_exists( $pmFilename )) { - throw (new Exception( 'Unable to read uploaded file, please check permissions. ' )); - } - if (! filesize( $pmFilename ) >= 9) { - throw (new Exception( 'Uploaded file is corrupted, please check the file before continue. ' )); - } - clearstatcache(); - $idProcess = 0; - $nameProcess = ''; - $sw = 0; - $file = new DOMDocument(); - @$file->load( $pmFilename, LIBXML_DTDLOAD ); - $root = $file->documentElement; - $node = $root->firstChild; - $numberTasks = 0; - $numberLanes = 0; - $endArray = array (); - $posEnd = 0; - $startArray = array (); - $posStart = 0; - $isEnd = 0; - $isStart = 0; - $posRoutes = 0; - $sequencial = 0; - $posT = 0; - $output = ''; - $arrayRoutes = array (); - $arrayLanes = array (); - $routeTransitions = array (); - $start = 0; - $end = 0; - $arrayScheduler = array (); - $arrayMessages = array (); - while ($node) { - if ($node->nodeType == XML_ELEMENT_NODE) { - $name = $node->nodeName; - $content = $node->firstChild; - if ($content != array ()) { - $output = $content->nodeValue; - } - if (strpos( $name, 'Pools' ) !== false) { - while ($content) { - if ($content->nodeType == XML_ELEMENT_NODE) { - $nameChild = $content->nodeName; - $contentChild = $content->firstChild; - if (strpos( $nameChild, 'Pool' ) !== false) { - $namePool = $content->getAttribute( 'Name' ); - $idPool = str_replace( '-', '', $content->getAttribute( 'Process' ) ); - $process['ID'] = $idPool; - $process['NAME'] = $namePool; - $process['DESCRIPTION'] = ''; - $oData->process = $this->createProcess( $process ); - } - } - $content = $content->nextSibling; - } - } - if (strpos( $name, 'Artifacts' ) !== false) { - while ($content) { - if ($content->nodeType == XML_ELEMENT_NODE) { - $nameChild = $content->nodeName; - $contentChild = $content->firstChild; - $idActivity = ''; - if (strpos( $nameChild, 'Artifact' ) !== false) { - $artifactType = $content->getAttribute( 'ArtifactType' ); - if ($artifactType == 'Annotation') { - $textAnnotation = $content->getAttribute( 'TextAnnotation' ); - $idAnnotation = str_replace( '-', '', $content->getAttribute( 'Id' ) ); - $idActivity = str_replace( '-', '', $content->getAttribute( 'ActivitySetId' ) ); - $lanes = $this->findCoordinates( $contentChild ); - $lanes['TEXT'] = $textAnnotation; - $lanes['ID_PROCESS'] = $idPool; - $lanes['ID_LANE'] = $idAnnotation; - if ($idActivity != '') { - $lanes['ID_PROCESS'] = $idActivity; - } - $arrayLanes[$numberLanes] = $this->createLanes( $lanes ); - $numberLanes = $numberLanes + 1; - } - } - } - $content = $content->nextSibling; - } - } - if (strpos( $name, 'WorkflowProcesses' ) !== false) { - while ($content) { - if ($content->nodeType == XML_ELEMENT_NODE) { - $nameChild = $content->nodeName; - $contentChild = $content->firstChild; - if (strpos( $nameChild, 'WorkflowProcess' ) !== false) { - $nameWorkflow = $content->getAttribute( 'Name' ); - $idProcess = $content->getAttribute( 'Id' ); - $idProcess = trim( str_replace( '-', '', $idProcess ) ); - $subProcesses = array (); - if ($nameWorkflow == $namePool and $idProcess == $idPool) { - $idWorkflow = $idProcess; - while ($contentChild) { - if ($contentChild->nodeType == XML_ELEMENT_NODE) { - $nameNode = $contentChild->nodeName; - $contentNode = $contentChild->firstChild; - if (strpos( $nameNode, 'ActivitySets' ) !== false) { - $activitySet = $this->createSubProcesses( $contentNode, $arrayLanes ); - $subProcesses = $activitySet['SUB_PROCESS']; - $arraySubProcesses = $activitySet['SUBPROCESSES']; - } - if (strpos( $nameNode, 'Activities' ) !== false) { - $activities = $this->createActivities( $contentNode, $idProcess, $subProcesses ); - $oData->tasks = $activities['TASKS']; - $startArray = $activities['START']; - $endArray = $activities['END']; - $arrayRoutes = $activities['ROUTES']; - $arrayScheduler = $activities['SCHEDULER']; - $arrayMessages = $activities['MESSAGES']; - } - - if (strpos( $nameNode, 'Transitions' ) !== false) { - $transitions = $this->createTransitions( $contentNode, $oData->tasks, $arrayRoutes, $endArray, $startArray, $idProcess, $arrayScheduler, $arrayMessages ); - $oData->routes = $transitions['ROUTES']; - $oData->tasks = $transitions['TASKS']; - $routeTransitions = $transitions['TRANSITIONS']; - $numberRoutes = $transitions['NUMBER']; - $taskHidden = $transitions['TASKHIDDEN']; - $arrayScheduler = $transitions['SCHEDULER']; - $arrayMessages = $transitions['MESSAGES']; - } - } - $contentChild = $contentChild->nextSibling; - } - } - } - } - $content = $content->nextSibling; - } - } - } - $node = $node->nextSibling; - } - $oData->lanes = array (); - $numberLanes = 0; - foreach ($arrayLanes as $key => $value) { - if ($value['PRO_UID'] == $idProcess) { - $oData->lanes[$numberLanes] = $value; - $numberLanes = $numberLanes + 1; - } - } - $oData->inputs = array (); - $oData->outputs = array (); - $oData->dynaforms = array (); - $oData->steps = array (); - $oData->taskusers = array (); - $oData->groupwfs = $this->getGroupwfRows( $oData->taskusers ); - $oData->steptriggers = array (); - $oData->dbconnections = array (); - $oData->reportTables = array (); - $oData->reportTablesVars = array (); - $oData->stepSupervisor = array (); - $oData->objectPermissions = array (); - $oData->subProcess = array (); - $numberSubProcess = 0; - $arraySubProcess = $subProcesses; - $numberSubProcess = isset( $arraySubProcesses ) && is_array( $arraySubProcesses ) ? sizeof( $arraySubProcesses ) : 0; - $numberCount = 0; - foreach ($subProcesses as $key => $value) { - foreach ($oData->tasks as $keyTask => $valueTask) { - if ($value['ID_PROCESS'] == $valueTask['TAS_UID']) { - $fields['TASK_PARENT'] = $valueTask['TAS_UID']; - $idSubProcess = $valueTask['TAS_UID']; - $findTask = 0; - $newTasks = $this->getTaskRows( $idSubProcess ); - foreach ($newTasks as $keyLane => $val) { - if ($val['TAS_START'] === 'TRUE' and $findTask == 0) { - $findTask = 1; - $value['TASK_START'] = $val['TAS_UID']; - } - } - $fields['PROCESS_PARENT'] = $idProcess; - $fields['TAS_UID'] = $value['TASK_START']; - $oData->subProcess[$numberSubProcess] = $this->createSubProcess( $fields, $arraySubProcess ); - $numberSubProcess = $numberSubProcess + 1; - } - } - } - $oData->caseTracker = array (); - $oData->caseTrackerObject = array (); - $oData->stage = array (); - $oData->fieldCondition = array (); - $oData->event = $this->createEventMessages( $arrayMessages, $idProcess ); - $oData->triggers = array (); - $oData->caseScheduler = $this->createScheduler( $arrayScheduler, $idProcess ); - $oData->dynaformFiles = array (); - $numberTransitions = sizeof( $routeTransitions ); - if ($numberTransitions > 0) { - $routesArray = $this->createGateways( $routeTransitions, $endArray, $oData->routes, $numberRoutes, $idProcess, $taskHidden ); - $oData->routes = $routesArray; - } - - //print_r($oData);die; - //print_r($arrayMessages);die; - return $oData; - } - - /** - * This public function sort a array - * - * @param array $fields - * @return array sorted - */ - public function sortArray ($fields) - { - $aux = $fields; - foreach ($fields as $key => $row) { - $aux[$key] = $row['FROM']; - } - array_multisort( $aux, SORT_ASC, $fields ); - return $fields; - } - - /** - * This functions verify the routes and removes the routes that are repeated - * - * @param array $routeTransitions - * @param array $endArray - * @return array - */ - public function verifyRoutes ($routeTransitions, $endArray, $taskHidden) - { - $findFirst = 0; - $firstRoute = ''; - $taskTo = ''; - $taskFrom = ''; - $routeArrayT = $routeTransitions; - $findHidden = 0; - foreach ($routeTransitions as $valRoute => $value) { - $findHidden = 0; - if ($value['ROUTE'] == $firstRoute) { - if ($value['TOORFROM'] == 'TO') { - $taskFrom = $value['FROM']; - } - if ($value['TOORFROM'] == 'FROM') { - $taskTo = $value['TO']; - } - if ($taskFrom != '') { - foreach ($routeArrayT as $valRoutes => $values) { - $isEventEnd = 0; - foreach ($endArray as $endBase => $valueEnd) { - if ($valueEnd == $values['TO']) { - $isEventEnd = 1; - } - } - if ($values['ROUTE'] == $value['ROUTE'] and $values['TO'] != $value['ROUTE'] and $isEventEnd == 0 and $findHidden == 0) { - $taskFrom = $values['TO']; - } else { - if ($values['ROUTE'] == $value['ROUTE'] and $values['TO'] == $value['ROUTE'] and $isEventEnd == 0) { - foreach ($taskHidden as $idHidden => $valueHidden) { - if ($valueHidden['ID_TASK'] == $values['TO']) { - $taskFrom = $valueHidden['ID_TASK']; - $findHidden = 1; - } - } - } - } - } - $routeTransitions[$valRoute]['TO'] = $taskFrom; - $taskFrom = ''; - } - if ($taskTo != '') { - foreach ($routeArrayT as $valRoutes => $values) { - if ($values['ROUTE'] == $value['ROUTE'] and $values['FROM'] != $value['ROUTE'] and $findHidden == 0) { - $taskTo = $values['FROM']; - } - } - $routeTransitions[$valRoute]['FROM'] = $taskTo; - $taskTo = ''; - } - } else { - $firstRoute = $value['ROUTE']; - $taskToE = ''; - $taskFromE = ''; - if ($value['TOORFROM'] == 'TO') { - $taskFromE = $value['FROM']; - } - if ($value['TOORFROM'] == 'FROM') { - $taskToE = $value['TO']; - } - if ($taskFromE != '') { - $findHidden = 0; - foreach ($routeArrayT as $valRoutes => $values) { - $isEventEnd = 0; - foreach ($endArray as $endBase => $valueEnd) { - if ($valueEnd == $values['TO']) { - $isEventEnd = 1; - } - } - if ($values['ROUTE'] == $value['ROUTE'] and $values['TO'] != $value['ROUTE'] and $isEventEnd == 0 and $findHidden == 0) { - $taskFromE = $values['TO']; - } else { - if ($values['ROUTE'] == $value['ROUTE'] and $values['TO'] == $value['ROUTE'] and $isEventEnd == 0) { - foreach ($taskHidden as $idHidden => $valueHidden) { - if ($valueHidden['ID_TASK'] == $values['TO']) { - $taskFromE = $valueHidden['ID_TASK']; - $findHidden = 1; - } - } - } - } - } - $routeTransitions[$valRoute]['TO'] = $taskFromE; - $taskFromE = ''; - } - if ($taskToE != '') { - foreach ($routeArrayT as $valRoutes => $values) { - if ($values['ROUTE'] == $value['ROUTE'] and $values['FROM'] != $value['ROUTE'] and $findHidden == 0) { - $taskToE = $values['FROM']; - } - } - $routeTransitions[$valRoute]['FROM'] = $taskToE; - $taskToE = ''; - } - } - } - $firstRoute = 0; - $cont = 0; - $routeChange = $routeTransitions; - foreach ($routeTransitions as $valRoutes => $value) { - $route = $value['ROUTE']; - $type = $value['ROU_TYPE']; - $countFrom = 0; - $countTo = 0; - foreach ($routeChange as $valRoutes2 => $values) { - if ($value['ROUTE'] == $values['ROUTE'] and $values['TOORFROM'] == 'TO') { - $countTo = $countTo + 1; - } - if ($value['ROUTE'] == $values['ROUTE'] and $values['TOORFROM'] == 'FROM') { - $countFrom = $countFrom + 1; - } - } - if ($type == 'PARALLEL') { - if ($countTo > $countFrom) { - $routeTransitions[$valRoutes]['ROU_TYPE'] = 'SEC-JOIN'; - } - } - } - $routeArrayT2 = $routeTransitions; - $routeArrayT1 = $routeTransitions; - foreach ($routeArrayT1 as $valRoutes => $value) { - if ($firstRoute == 0) { - $taskFirst = $value['ROUTE']; - } - if ($taskFirst == $value['ROUTE']) { - if ($firstRoute == 0) { - foreach ($routeArrayT2 as $valRoutes2 => $values) { - if ($values['ROUTE'] == $taskFirst and $values['FROM'] == $value['FROM'] and $values['TO'] == $value['TO'] and $values['ID'] != $value['ID']) { - unset( $routeArrayT2[$valRoutes2] ); - $firstRoute = 1; - } - } - } - } else { - $firstRoute = 0; - } - } - return $routeArrayT2; - } - - /** - * this public function creates an array for the process that will be created according to the data given in an array - * - * @param array $fields - * @return array $process - */ - public function createProcess ($fields) - { - $process = array (); - $process['PRO_UID'] = $fields['ID']; - $process['PRO_PARENT'] = $fields['ID']; - $process['PRO_TIME'] = 1; - $process['PRO_TIMEUNIT'] = 'DAYS'; - $process['PRO_STATUS'] = 'ACTIVE'; - $process['PRO_TYPE_DAY'] = ''; - $process['PRO_TYPE'] = 'NORMAL'; - $process['PRO_ASSIGNMENT'] = 'FALSE'; - $process['PRO_SHOW_MAP'] = 0; - $process['PRO_SHOW_MESSAGE'] = 0; - $process['PRO_SUBPROCESS'] = 0; - $process['PRO_TRI_DELETED'] = ''; - $process['PRO_TRI_CANCELED'] = ''; - $process['PRO_TRI_PAUSED'] = ''; - $process['PRO_TRI_REASSIGNED'] = ''; - $process['PRO_SHOW_DELEGATE'] = 0; - $process['PRO_SHOW_DYNAFORM'] = 0; - $process['PRO_CATEGORY'] = ''; - $process['PRO_SUB_CATEGORY'] = ''; - $process['PRO_INDUSTRY'] = 0; - $process['PRO_UPDATE_DATE'] = date( "D M j G:i:s T Y" ); - $process['PRO_CREATE_DATE'] = date( "D M j G:i:s T Y" ); - $process['PRO_CREATE_USER'] = 00000000000000000000000000000001; - $process['PRO_HEIGHT'] = 5000; - $process['PRO_WIDTH'] = 10000; - $process['PRO_TITLE_X'] = 0; - $process['PRO_TITLE_Y'] = 0; - $process['PRO_DEBUG'] = 0; - $process['PRO_TITLE'] = $fields['NAME']; - $process['PRO_DESCRIPTION'] = $fields['DESCRIPTION']; - return $process; - } - - /** - * this public function creates an array for the subProcess that will be created,according to the data given in an array - * - * @param array $contentNode - * @param array $arrayLanes - * @return array - */ - public function createSubProcesses ($contentNode, $arrayLanes) - { - $activities = array (); - $numberActivities = 0; - $numberLanes = 0; - $number = 0; - $contentSubNode = $contentNode; - $numberSub = 0; - while ($contentSubNode) { - if ($contentSubNode->nodeType == XML_ELEMENT_NODE) { - $nameActivity = $contentSubNode->nodeName; - $contentActivity = $contentSubNode->firstChild; - if (strpos( $nameActivity, 'ActivitySet' ) !== false) { - $idSetActivity = str_replace( '-', '', $contentSubNode->getAttribute( 'Id' ) ); - $arrayActivity[$number]['ID_PROCESS'] = $idSetActivity; - $number = $number + 1; - } - } - $contentSubNode = $contentSubNode->nextSibling; - } - $number = 0; - $arraySubProcesses = array (); - while ($contentNode) { - if ($contentNode->nodeType == XML_ELEMENT_NODE) { - $isSubProcess = 0; - $nameActivity = $contentNode->nodeName; - $contentActivity = $contentNode->firstChild; - $idSetActivity = 0; - if (strpos( $nameActivity, 'ActivitySet' ) !== false) { - $idSetActivity = str_replace( '-', '', $contentNode->getAttribute( 'Id' ) ); - if ($idSetActivity !== 0) { - $isSubProcess = 1; - } - $nameSetActivity = $contentNode->getAttribute( 'Name' ); - $contentChild = $contentNode->firstChild; - $process['ID'] = $idSetActivity; - $process['NAME'] = $nameSetActivity; - $process['DESCRIPTION'] = ''; - $subProcess->process = $this->createProcess( $process ); - $activities[$number]['ID_PROCESS'] = $idSetActivity; - while ($contentChild) { - if ($contentChild->nodeType == XML_ELEMENT_NODE) { - - $nameChild = $contentChild->nodeName; - $contentFirst = $contentChild->firstChild; - if (strpos( $nameChild, 'Activities' ) !== false) { - $arrayActivities = $this->createActivities( $contentFirst, $idSetActivity, $arrayActivity ); - $subProcess->tasks = $arrayActivities['TASKS']; - $startArray = $arrayActivities['START']; - $endArray = $arrayActivities['END']; - $arrayRoutes = $arrayActivities['ROUTES']; - $arrayScheduler = $arrayActivities['SCHEDULER']; - $arrayMessages = $arrayActivities['MESSAGES']; - } - - if (strpos( $nameChild, 'Transitions' ) !== false) { - $transitions = $this->createTransitions( $contentFirst, $subProcess->tasks, $arrayRoutes, $endArray, $startArray, $idSetActivity, $arrayScheduler, $arrayMessages ); - $subProcess->routes = $transitions['ROUTES']; - $subProcess->tasks = $transitions['TASKS']; - $routeTransitions = $transitions['TRANSITIONS']; - $numberRoutes = $transitions['NUMBER']; - $arrayMessages = $transitions['MESSAGES']; - } - } - $contentChild = $contentChild->nextSibling; - } - - $values = $subProcess; - if ($isSubProcess == 1) { - $arraySubProcesses[$numberSub]['ID_PROCESS'] = $idSetActivity; - $arraySubProcesses[$numberSub]['TASKS'] = $subProcess->tasks; - $numberSub = $numberSub + 1; - } - $activities[$number]['TASK_START'] = $startArray[0]['ID_TASK']; - $number = $number + 1; - $subProcess->lanes = array (); - $numberLanes = 0; - foreach ($arrayLanes as $key => $value) { - if ($value['PRO_UID'] == $idSetActivity) { - $subProcess->lanes[$numberLanes] = $value; - $numberLanes = $numberLanes + 1; - } - } - $subProcess->inputs = array (); - $subProcess->outputs = array (); - $subProcess->dynaforms = array (); - $subProcess->steps = array (); - $subProcess->triggers = array (); - $subProcess->taskusers = array (); - $subProcess->groupwfs = $this->getGroupwfRows( $subProcess->taskusers ); - $subProcess->steptriggers = array (); - $subProcess->dbconnections = array (); - $subProcess->reportTables = array (); - $subProcess->reportTablesVars = array (); - $subProcess->stepSupervisor = array (); - $subProcess->objectPermissions = array (); - $subProcess->subProcess = array (); - $subProcess->caseTracker = array (); - $subProcess->caseTrackerObject = array (); - $subProcess->stage = array (); - $subProcess->fieldCondition = array (); - $subProcess->event = array (); - $subProcess->caseScheduler = array (); - $subProcess->dynaformFiles = array (); - $numberTransitions = sizeof( $routeTransitions ); - if ($numberTransitions > 0) { - $routesArray = $this->createGateways( $routeTransitions, $endArray, $subProcess->routes, $numberRoutes, $idProcess, '' ); - $subProcess->routes = $routesArray; - } - $numberSubProcess = 0; - foreach ($subProcess->tasks as $key => $value) { - if ($value['TAS_TYPE'] === 'SUBPROCESS') { - $fields['TASK_PARENT'] = $value['TAS_UID']; - $idSubProcess = $value['TAS_UID']; - $newTasks = $this->getTaskRows( $idSubProcess ); - - $findTask = 0; - foreach ($newTasks as $keyLane => $val) { - if ($val['TAS_START'] === 'TRUE' and $findTask == 0) { - $findTask = 1; - $value['TASK_START'] = $val['TAS_UID']; - } - } - $fields['PROCESS_PARENT'] = $idSetActivity; - $fields['TAS_UID'] = $value['TAS_UID']; - $subProcess->subProcess[$numberSubProcess] = $this->createSubProcess( $fields, $arrayActivity ); - $numberSubProcess = $numberSubProcess + 1; - } - } - $this->createSubProcessFromDataXpdl( $subProcess, $subProcess->tasks ); - } - } - $contentNode = $contentNode->nextSibling; - } - $arrayActivities['SUBPROCESSES'] = $arraySubProcesses; - $arrayActivities['SUB_PROCESS'] = $activities; - return $arrayActivities; - } - - /** - * This public function creates an array for the task that will be created according to the data given in an array - * - * @param array $fields - * @return array $task - */ - public function createTask ($fields) - { - $task = array (); - $task['PRO_UID'] = $fields['ID_PROCESS']; - $task['TAS_UID'] = $fields['ID_TASK']; - $task['TAS_TYPE'] = $fields['TASK_TYPE']; - $task['TAS_DURATION'] = 1; - $task['TAS_DELAY_TYPE'] = ''; - $task['TAS_TEMPORIZER'] = 0; - $task['TAS_TYPE_DAY'] = ''; - $task['TAS_TIMEUNIT'] = 'DAYS'; - $task['TAS_ALERT'] = 'FALSE'; - $task['TAS_PRIORITY_VARIABLE'] = '@@SYS_CASE_PRIORITY'; - $task['TAS_ASSIGN_TYPE'] = 'BALANCED'; - $task['TAS_ASSIGN_VARIABLE'] = '@@SYS_NEXT_USER_TO_BE_ASSIGNED'; - $task['TAS_ASSIGN_LOCATION'] = 'FALSE'; - $task['TAS_ASSIGN_LOCATION_ADHOC'] = 'FALSE'; - $task['TAS_TRANSFER_FLY'] = 'FALSE'; - $task['TAS_LAST_ASSIGNED'] = '00000000000000000000000000000001'; - $task['TAS_USER'] = '0'; - $task['TAS_CAN_UPLOAD'] = 'FALSE'; - $task['TAS_VIEW_UPLOAD'] = 'FALSE'; - $task['TAS_VIEW_ADDITIONAL_DOCUMENTATION'] = 'FALSE'; - $task['TAS_CAN_CANCEL'] = 'FALSE'; - $task['TAS_OWNER_APP'] = 'FALSE'; - $task['STG_UID'] = ''; - $task['TAS_CAN_PAUSE'] = 'FALSE'; - $task['TAS_CAN_SEND_MESSAGE'] = 'TRUE'; - $task['TAS_CAN_DELETE_DOCS'] = 'FALSE'; - $task['TAS_SELF_SERVICE'] = 'FALSE'; - $task['TAS_START'] = 'FALSE'; - $task['TAS_TO_LAST_USER'] = 'FALSE'; - $task['TAS_SEND_LAST_EMAIL'] = 'FALSE'; - $task['TAS_DERIVATION'] = 'NORMAL'; - $task['TAS_POSX'] = $fields['X']; - $task['TAS_POSY'] = $fields['Y']; - $task['TAS_COLOR'] = ''; - $task['TAS_DEF_MESSAGE'] = ''; - $task['TAS_DEF_PROC_CODE'] = ''; - $task['TAS_DEF_DESCRIPTION'] = ''; - $task['TAS_TITLE'] = $fields['TAS_TITLE']; - $task['TAS_DESCRIPTION'] = $fields['DESCRIPTION']; - $task['TAS_DEF_TITLE'] = ''; - return $task; - } - - public function createDataTask ($fields) - { - $task = array (); - $task['PRO_UID'] = $fields['ID_PROCESS']; - $task['TAS_UID'] = $fields['ID_TASK']; - $task['TAS_TYPE'] = $fields['TAS_TYPE']; - $task['TAS_DURATION'] = 1; - $task['TAS_DELAY_TYPE'] = ''; - $task['TAS_TEMPORIZER'] = 0; - $task['TAS_TYPE_DAY'] = ''; - $task['TAS_TIMEUNIT'] = 'DAYS'; - $task['TAS_ALERT'] = 'FALSE'; - $task['TAS_PRIORITY_VARIABLE'] = '@@SYS_CASE_PRIORITY'; - $task['TAS_ASSIGN_TYPE'] = 'BALANCED'; - $task['TAS_ASSIGN_VARIABLE'] = '@@SYS_NEXT_USER_TO_BE_ASSIGNED'; - $task['TAS_MI_INSTANCE_VARIABLE'] = '@@SYS_VAR_TOTAL_INSTANCE'; - $task['TAS_MI_COMPLETE_VARIABLE'] = '@@SYS_VAR_TOTAL_INSTANCES_COMPLETE'; - $task['TAS_ASSIGN_LOCATION'] = 'FALSE'; - $task['TAS_ASSIGN_LOCATION_ADHOC'] = 'FALSE'; - $task['TAS_TRANSFER_FLY'] = 'FALSE'; - $task['TAS_LAST_ASSIGNED'] = '00000000000000000000000000000001'; - $task['TAS_USER'] = '0'; - $task['TAS_CAN_UPLOAD'] = 'FALSE'; - $task['TAS_VIEW_UPLOAD'] = 'FALSE'; - $task['TAS_VIEW_ADDITIONAL_DOCUMENTATION'] = 'FALSE'; - $task['TAS_CAN_CANCEL'] = 'FALSE'; - $task['TAS_OWNER_APP'] = 'FALSE'; - $task['STG_UID'] = ''; - $task['TAS_CAN_PAUSE'] = 'FALSE'; - $task['TAS_CAN_SEND_MESSAGE'] = 'TRUE'; - $task['TAS_CAN_DELETE_DOCS'] = 'FALSE'; - $task['TAS_SELF_SERVICE'] = 'FALSE'; - $task['TAS_START'] = $fields['START']; - $task['TAS_TO_LAST_USER'] = 'FALSE'; - $task['TAS_SEND_LAST_EMAIL'] = 'FALSE'; - $task['TAS_DERIVATION'] = 'NORMAL'; - $task['TAS_POSX'] = $fields['X']; - $task['TAS_POSY'] = $fields['Y']; - $task['TAS_COLOR'] = ''; - $task['TAS_DEF_MESSAGE'] = ''; - $task['TAS_DEF_PROC_CODE'] = ''; - $task['TAS_DEF_DESCRIPTION'] = ''; - $task['TAS_TITLE'] = $fields['TAS_TITLE']; - $task['TAS_DESCRIPTION'] = $fields['DESCRIPTION']; - $task['TAS_DEF_TITLE'] = ''; - return $task; - } - - /** - * This public function creates an array for the route that will be created according to the data given in an array - * - * @param array $fields - * @return array $route - */ - public function createRoute ($fields) - { - $route = array (); - $route['ROU_UID'] = $fields['ROU_UID']; - $route['ROU_PARENT'] = 0; - $route['PRO_UID'] = $fields['ID_PROCESS']; - $route['TAS_UID'] = $fields['FROM']; - $route['ROU_NEXT_TASK'] = $fields['TO']; - $route['ROU_CASE'] = 1; - $route['ROU_TYPE'] = 'SEQUENTIAL'; - $route['ROU_CONDITION'] = ''; - $route['ROU_TO_LAST_USER'] = 'FALSE'; - $route['ROU_OPTIONAL'] = 'FALSE'; - $route['ROU_SEND_EMAIL'] = 'TRUE'; - $route['ROU_SOURCEANCHOR'] = 1; - $route['ROU_TARGETANCHOR'] = 0; - return $route; - } - - /** - * This public function creates an array for the subProcess that will be created according to the data given in an array - * - * @param array $fields - * @return array $route - */ - public function createSubProcess ($fields) - { - $subProcess = array (); - $subProcess['SP_UID'] = $fields['TAS_UID']; - $subProcess['PRO_UID'] = $fields['TASK_PARENT']; - $subProcess['TAS_UID'] = $fields['TAS_UID']; - $subProcess['PRO_PARENT'] = $fields['PROCESS_PARENT']; - $subProcess['TAS_PARENT'] = $fields['TASK_PARENT']; - $subProcess['SP_TYPE'] = 'SIMPLE'; - $subProcess['SP_SYNCHRONOUS'] = 0; - $subProcess['SP_SYNCHRONOUS_TYPE'] = 'ALL'; - $subProcess['SP_SYNCHRONOUS_WAIT'] = 0; - $subProcess['SP_VARIABLES_OUT'] = 'a:1:{s:0:"";s:0:"";}'; - $subProcess['SP_VARIABLES_IN'] = 'a:1:{s:0:"";s:0:"";}'; - $subProcess['SP_GRID_IN'] = ''; - return $subProcess; - } - - /** - * This public function creates an array for the routes that are not sequential that will be created according to the data given in an array - * - * @param array $routeTransitions - * @param array $endArray - * @param array $dataRoutes - * @param array $numberRoutes - * @param string $idProcess - * @return array $dataRoutes - */ - public function createGateways ($routeTransitions, $endArray, $dataRoutes, $numberRoutes, $idProcess, $taskHidden) - { - $valueCase = ''; - $value = 1; - $valueC = 1; - $aux = $routeTransitions; - foreach ($routeTransitions as $key => $row) { - $aux[$key] = $row['ROUTE']; - } - array_multisort( $aux, SORT_ASC, $routeTransitions ); - $routeArray = $this->verifyRoutes( $routeTransitions, $endArray, $taskHidden ); - $routeArray = $this->sortArray( $routeArray ); - foreach ($routeArray as $valRoutes => $value) { - $isEventEnd = 0; - foreach ($endArray as $endBase => $valueEnd) { - if ($valueEnd['ID_TASK'] == $value['TO']) { - $isEventEnd = 1; - } - } - $dataRoutes[$numberRoutes] = array (); - $dataRoutes[$numberRoutes]['ROU_UID'] = $value['ID']; - $dataRoutes[$numberRoutes]['ROU_PARENT'] = 0; - $dataRoutes[$numberRoutes]['PRO_UID'] = $idProcess; - $dataRoutes[$numberRoutes]['TAS_UID'] = $value['FROM']; - - if ($isEventEnd == 0) { - $dataRoutes[$numberRoutes]['ROU_NEXT_TASK'] = $value['TO']; - } else { - $dataRoutes[$numberRoutes]['ROU_NEXT_TASK'] = '-1'; - } - if ($valueCase == $value['FROM']) { - $valueC = $valueC + 1; - } else { - $valueC = 1; - $valueCase = $value['FROM']; - } - if ($valueCase == '') { - $valueC = 1; - $valueCase = $value['FROM']; - } - $dataRoutes[$numberRoutes]['ROU_CASE'] = $valueC; - $dataRoutes[$numberRoutes]['ROU_TYPE'] = $value['ROU_TYPE']; - if ($value['ROU_TYPE'] === 'DISCRIMINATOR') { - $dataRoutes[$numberRoutes]['ROU_CONDITION'] = $value['CONDITION_DIS']; - $dataRoutes[$numberRoutes]['ROU_OPTIONAL'] = $value['TYPE_DIS']; - } - if ($value['ROU_TYPE'] !== 'DISCRIMINATOR') { - $dataRoutes[$numberRoutes]['ROU_CONDITION'] = $value['CONDITION']; - $dataRoutes[$numberRoutes]['ROU_OPTIONAL'] = 'FALSE'; - } - $dataRoutes[$numberRoutes]['ROU_TO_LAST_USER'] = 'FALSE'; - $dataRoutes[$numberRoutes]['ROU_SEND_EMAIL'] = 'TRUE'; - $dataRoutes[$numberRoutes]['ROU_SOURCEANCHOR'] = 1; - $dataRoutes[$numberRoutes]['ROU_TARGETANCHOR'] = 0; - $numberRoutes = $numberRoutes + 1; - } - return $dataRoutes; - } - - /** - * This public function creates an array for the lane that will be created according to the data given in an array - * - * @param array $lanes - * @return array $lane - */ - public function createLanesPM ($array, $idProcess) - { - $arrayLanes = array (); - $field = array (); - foreach ($array as $key => $value) { - $field['ID_LANE'] = $value['0']; - $field['ID_PROCESS'] = $idProcess; - $field['X'] = $value['2']; - $field['Y'] = $value['3']; - $field['WIDTH'] = $value['4']; - $field['HEIGHT'] = $value['5']; - $field['TEXT'] = $value['6']; - $arrayLanes[] = $this->createLanes( $field ); - } - return $arrayLanes; - } - - /** - * This public function creates an array for the lane that will be created according to the data given in an array - * - * @param array $lanes - * @return array $lane - */ - public function createLanes ($lanes) - { - $lane = array (); - $lane['SWI_UID'] = $lanes['ID_LANE']; - $lane['PRO_UID'] = $lanes['ID_PROCESS']; - $lane['SWI_TYPE'] = 'TEXT'; - $lane['SWI_X'] = $lanes['X']; - $lane['SWI_Y'] = $lanes['Y']; - $lane['SWI_TEXT'] = $lanes['TEXT']; - $lane['SWI_WIDTH'] = $lanes['WIDTH']; - $lane['SWI_HEIGHT'] = $lanes['HEIGHT']; - return $lane; - } - - /** - * This public function creates an array for the lane that will be created according to the data given in an array - * - * @param array $lanes - * @return array $lane - */ - public function createLanesNewPM ($array) - { - $arrayLanes = array (); - $field = array (); - foreach ($array as $key => $value) { - if ($value['SWI_TYPE'] == 'TEXT') { - $field['0'] = $value['SWI_UID']; - $field['1'] = $value['SWI_TEXT']; - $field['2'] = $value['SWI_X']; - $field['3'] = $value['SWI_Y']; - $field['4'] = $value['SWI_WIDTH']; - $field['5'] = $value['SWI_HEIGHT']; - $field['6'] = $value['SWI_NEXT_UID']; - $arrayLanes[] = $field; - } - } - return $arrayLanes; - } - - /** - * This public function creates activities according the content of the node - * - * @param object $contentNode - * @param string $idProcess - * @param string $ActivitySet - * @return array $result - */ - public function createActivities ($contentNode, $idProcess, $activitySet) - { - $result = array (); - $numberTasks = 0; - $posRoutes = 0; - $posEnd = 0; - $posStart = 0; - $arrayRoutes = array (); - $endArray = array (); - $endArray = array (); - $startArray = array (); - $arrayScheduler = array (); - $scheduler = array (); - $message = array (); - $arrayMessages = array (); - while ($contentNode) { - if ($contentNode->nodeType == XML_ELEMENT_NODE) { - $nameActivity = $contentNode->nodeName; - $contentActivity = $contentNode->firstChild; - if (strpos( $nameActivity, 'Activity' ) !== false) { - $idActivity = $contentNode->getAttribute( 'Id' ); - $idActivity = trim( str_replace( '-', '', $idActivity ) ); - $name = htmlentities( $contentNode->getAttribute( 'Name' ) ); - $result = $this->createActivity( $contentActivity ); - $result['ID_PROCESS'] = $idProcess; - $result['ID_TASK'] = $idActivity; - $result['TAS_TITLE'] = $name; - $result['TASK_TYPE'] = 'NORMAL'; - foreach ($activitySet as $key => $value) { - if ($value['ID_PROCESS'] == $idActivity) { - $result['TASK_TYPE'] = 'SUBPROCESS'; - } - } - if ($result['EVENT'] == '' and $result['ROUTE'] == '') { - $arrayTasks[$numberTasks] = $this->createTask( $result ); - $numberTasks = $numberTasks + 1; - } else { - if ($result['EVENT'] != '' and $result['TRIGGER'] == 'None') { - if ($result['EVENT'] == 'END') { - $endArray[$posEnd] = $result; - $posEnd = $posEnd + 1; - } - if ($result['EVENT'] == 'START') { - $startArray[$posStart] = $result; - $posStart = $posStart + 1; - } - } else { - if ($result['TRIGGER'] == 'Timer') { - $scheduler['ID'] = $idActivity; - $scheduler['NAME'] = $name; - if ($result['TIME'] == '' or $result['TIME'] == null) { - $scheduler['TIME'] = date( "D M j G:i:s T Y" ); - } else { - $scheduler['TIME'] = $result['TIME']; - } - $scheduler['TYPE_TIME'] = $result['TYPE_TIME']; - $arrayScheduler[] = $scheduler; - } - if ($result['TRIGGER'] == 'Message') { - $message['ID'] = $idActivity; - $message['NAME'] = $name; - $message['TYPE_MESSAGE'] = $result['MESSAGE']; - $arrayMessages[] = $message; - } - } - if ($result['ROUTE'] != '') { - $position = $this->findCoordinates( $contentActivity ); - $arrayRoutes[$posRoutes]['ID'] = $idActivity; - $arrayRoutes[$posRoutes]['ROUTE'] = $result['ROUTE']; - $arrayRoutes[$posRoutes]['TYPE_DIS'] = $result['TYPE_DISCRIMINATOR']; - $arrayRoutes[$posRoutes]['CONDITION_DIS'] = $result['CONDITION_DISCRIMINATOR']; - $arrayRoutes[$posRoutes]['X'] = $position['X']; - $arrayRoutes[$posRoutes]['Y'] = $position['Y']; - $posRoutes = $posRoutes + 1; - } - } - } - } - $contentNode = $contentNode->nextSibling; - } - $result['TASKS'] = $arrayTasks; - $result['END'] = $endArray; - $result['START'] = $startArray; - $result['ROUTES'] = $arrayRoutes; - $result['SCHEDULER'] = $arrayScheduler; - $result['MESSAGES'] = $arrayMessages; - return $result; - } - - /** - * This public function creates the scheduler - * - * @param array $fields - * @return array $result - */ - public function createEventMessages ($fields, $idProcess) - { - $result = array (); - $event = array (); - $example = new Derivation(); - foreach ($fields as $key => $value) { - $oEvent = new Event(); - $event['EVN_UID'] = $value['ID']; - $event['PRO_UID'] = $idProcess; - $event['EVN_RELATED_TO'] = 'SINGLE'; - $event['TAS_UID'] = $value['ID_TASK']; - $event['EVN_TAS_ESTIMATED_DURATION'] = '1'; - $event['EVN_WHEN_OCCURS'] = 'AFTER'; - $event['EVN_STATUS'] = 'ACTIVE'; - $event['EVN_WHEN'] = 1; - $event['EVN_MAX_ATTEMPTS'] = 3; - $event['EVN_ACTION'] = 'SEND_MESSAGE'; - $event['EVN_DESCRIPTION'] = $value['NAME']; - $event['EVN_WHEN_OCCURS'] = 'AFTER_TIME'; - $event['EVN_ACTION_PARAMETERS'] = array ('SUBJECT' => 'subject','TO' => array ('0' => 'usr|-1','1' => 'ext|' - ),'CC' => array (),'BCC' => array (),'TEMPLATE' => 'alert_message.html' - ); - $result[] = $event; - } - return $result; - } - - /** - * This public function creates the scheduler - * - * @param array $fields - * @return array $result - */ - public function createScheduler ($fields, $idProcess) - { - $result = array (); - $example = new Derivation(); - foreach ($fields as $key => $value) { - if ($value['TYPE_TIME'] == 'TimeDate') { - //there is a scheduler one time only - $value['OPTION'] = 4; - $result[] = $this->createArrayScheduler( $value, $idProcess ); - } - if ($value['TYPE_TIME'] == 'TimeCycle') { - //we calculated if is daily or monthly, etc - $time = $this->calculateTimeScheduler( $value['TIME'] ); - /*$value['OPTION']= $time['OPTION']; - $value['TIME'] = $time['TIME'];*/ - $value['OPTION'] = '1'; - } - } - //PRINT_r($result); - return $result; - } - - /** - * This public function creates the scheduler - * - * @param array $fields - * @return array $result - */ - public function calculateTimeScheduler ($time) - { - $result = array (); - // The split public function has been DEPRECATED as of PHP 5.3.0. - // $result = split(' ',$time); - $result = explode( ' ', $time ); - //print_r($result); - return $result; - } - - /** - * This public function creates the array scheduler - * - * @param string $time - * @param string $type (TimeCycle or TimeDate) - * @return array $result - */ - public function createArrayScheduler ($fields, $idProcess) - { - $result['SCH_UID'] = $fields['ID']; - $result['SCH_DEL_USER_NAME'] = ''; - $result['SCH_DEL_USER_PASS'] = ''; - $result['SCH_DEL_USER_UID'] = ''; - $result['SCH_NAME'] = $fields['NAME']; - $result['PRO_UID'] = $idProcess; - $result['TAS_UID'] = $fields['ID_TASK']; - $result['SCH_TIME_NEXT_RUN'] = $fields['TIME']; - $result['SCH_LAST_RUN_TIME'] = null; - $result['SCH_STATE'] = 'ACTIVE'; - $result['SCH_LAST_STATE'] = 'CREATED'; - $result['USR_UID'] = '00000000000000000000000000000001'; - $result['SCH_OPTION'] = $fields['OPTION']; - $result['SCH_START_TIME'] = $fields['TIME']; - $result['SCH_START_DATE'] = $fields['TIME']; - $result['SCH_DAYS_PERFORM_TASK'] = ''; - $result['SCH_EVERY_DAYS'] = '0'; - $result['SCH_WEEK_DAYS'] = '0|0|0|0|0|0|0'; - $result['SCH_START_DAY'] = ''; - $result['SCH_MONTHS'] = '0|0|0|0|0|0|0|0|0|0|0|0'; - $result['SCH_END_DATE'] = $fields['TIME']; - $result['SCH_REPEAT_EVERY'] = ''; - $result['SCH_REPEAT_UNTIL'] = ''; - $result['SCH_REPEAT_STOP_IF_RUNNING'] = ''; - return $result; - } - - /** - * This public function creates transitions according the content of the node - * - * @param object $contentNode - * @param array $dataTask - * @param array $arrayRoutes - * @param array $endArray - * @param array $startArray - * @param string $idProcess - * @return array $result - */ - - public function createTransitions ($contentNode, $dataTasks, $arrayRoutes, $endArray, $startArray, $idProcess, $schedulerArray, $messages) - { - $numberRoutes = 0; - $posT = 0; - $output = ''; - $routeTransitions = array (); - $taskHidden = array (); - $countHidden = 1; - $dataRoutes = array (); - $newFrom = 0; - $isScheduler = 0; - $isMessage = 0; - while ($contentNode) { - $isEnd = 0; - $isStart = 0; - $tasks = $dataTasks; - if ($contentNode->nodeType == XML_ELEMENT_NODE) { - $nameTransition = $contentNode->nodeName; - $contentTransition = $contentNode->firstChild; - if (strpos( $nameTransition, 'Transition' ) !== false) { - $idTransition = $contentNode->getAttribute( 'Id' ); - $idTransition = trim( str_replace( '-', '', $idTransition ) ); - $from = trim( str_replace( '-', '', $contentNode->getAttribute( 'From' ) ) ); - $to = trim( str_replace( '-', '', $contentNode->getAttribute( 'To' ) ) ); - $routes['ROU_UID'] = $idTransition; - $routes['ID_PROCESS'] = $idProcess; - $routes['FROM'] = $from; - $routes['TO'] = $to; - $isScheduler = 0; - $isMessage = 0; - foreach ($startArray as $startBase => $value) { - if ($value['ID_TASK'] == $from) { - foreach ($tasks as $tasksValue => $taskId) { - if ($to == $taskId['TAS_UID']) { - $taskId['TAS_START'] = 'TRUE'; - $dataTasks[$tasksValue]['TAS_START'] = 'TRUE'; - $isStart = 1; - } - } - } - } - foreach ($schedulerArray as $startBase => $value) { - if ($value['ID'] == $from) { - $isScheduler = 1; - $schedulerArray[$startBase]['ID_TASK'] = $to; - foreach ($tasks as $tasksValue => $taskId) { - if ($to == $taskId['TAS_UID']) { - $taskId['TAS_START'] = 'TRUE'; - $dataTasks[$tasksValue]['TAS_START'] = 'TRUE'; - $isStart = 1; - } - } - } - } - foreach ($messages as $startBase => $value) { - if ($value['ID'] == $from) { - $isMessage = 1; - $messages[$startBase]['ID_TASK'] = $to; - } - if ($value['ID'] == $to) { - $isMessage = 1; - $messages[$startBase]['ID_TASK'] = $from; - } - } - $sequencial = 0; - $findRoute = 0; - foreach ($arrayRoutes as $routeBase => $value) { - //change for task hidden - if ($value['ID'] == $from) { - if ($findRoute == 0) { - $typeT = 'FROM'; - $valueRoute = $value['ID']; - $typeRoute = $value['ROUTE']; - $sequencial = 1; - $conditionD = $value['CONDITION_DIS']; - $typeD = $value['TYPE_DIS']; - $findRoute = 1; - } else { - $contendHidden = $contentTransition; - $fieldsXY = $this->findCoordinatesTransition( $to, $arrayRoutes ); - $hidden['ID_TASK'] = G::generateUniqueID(); - $hidden['ID_PROCESS'] = $idProcess; - $hidden['TAS_TITLE'] = ''; - $hidden['TASK_TYPE'] = 'HIDDEN'; - $hidden['DESCRIPTION'] = $countHidden; - $hidden['X'] = $fieldsXY['X']; - $hidden['Y'] = $fieldsXY['Y']; - $taskHidden[] = $hidden; - $dataTasks[] = $this->createTask( $hidden ); - $countHidden = $countHidden + 1; - $routeTransitions[$posT]['ID'] = G::generateUniqueID(); - $routeTransitions[$posT]['ROUTE'] = $from; - $routeTransitions[$posT]['FROM'] = $from; - $routeTransitions[$posT]['TO'] = $hidden['ID_TASK']; - $routeTransitions[$posT]['TOORFROM'] = 'FROM'; - $routeTransitions[$posT]['ROU_TYPE'] = $value['ROUTE']; - $routeTransitions[$posT]['CONDITION'] = $output; - $routeTransitions[$posT]['CONDITION_DIS'] = $conditionD; - $routeTransitions[$posT]['TYPE_DIS'] = $typeD; - $output = ''; - $posT = $posT + 1; - $from = $hidden['ID_TASK']; - } - } - if ($value['ID'] == $to) { - if ($findRoute == 0) { - $typeT = 'TO'; - $valueRoute = $value['ID']; - $typeRoute = $value['ROUTE']; - $sequencial = 1; - $conditionD = $value['CONDITION_DIS']; - $typeD = $value['TYPE_DIS']; - $findRoute = 1; - } else { - - $contendHidden = $contentTransition; - $fieldsXY = $this->findCoordinatesTransition( $to, $arrayRoutes ); - $hidden['ID_TASK'] = G::generateUniqueID(); - $hidden['ID_PROCESS'] = $idProcess; - $hidden['TAS_TITLE'] = ''; - $hidden['TASK_TYPE'] = 'HIDDEN'; - $hidden['DESCRIPTION'] = $countHidden; - $hidden['X'] = $fieldsXY['X']; - $hidden['Y'] = $fieldsXY['Y']; - $taskHidden[] = $hidden; - $dataTasks[] = $this->createTask( $hidden ); - $countHidden = $countHidden + 1; - $routeTransitions[$posT]['ID'] = G::generateUniqueID(); - $routeTransitions[$posT]['ROUTE'] = $from; - $routeTransitions[$posT]['FROM'] = $from; - $routeTransitions[$posT]['TO'] = $hidden['ID_TASK']; - $routeTransitions[$posT]['TOORFROM'] = 'TO'; - $routeTransitions[$posT]['ROU_TYPE'] = $typeRoute; - $routeTransitions[$posT]['CONDITION'] = $output; - $routeTransitions[$posT]['CONDITION_DIS'] = $conditionD; - $routeTransitions[$posT]['TYPE_DIS'] = $typeD; - $output = ''; - $posT = $posT + 1; - $from = $hidden['ID_TASK']; - $conditionD = $value['CONDITION_DIS']; - $typeRoute = $value['ROUTE']; - $typeT = 'TO'; - $valueRoute = $value['ID']; - $sequencial = 1; - $conditionD = $value['CONDITION_DIS']; - $typeD = $value['TYPE_DIS']; - } - } - } - if ($sequencial == 0) { - foreach ($endArray as $endBase => $value) { - if ($value['ID_TASK'] == $to) { - foreach ($tasks as $tasksValue => $taskId) { - if ($from == $taskId['TAS_UID']) { - $routes['TO'] = '-1'; - $dataRoutes[$numberRoutes] = $this->createRoute( $routes ); - $numberRoutes = $numberRoutes + 1; - $isEnd = 1; - } - } - } - } - } - if ($sequencial == 1) { - while ($contentTransition) { - $nameCondition = $contentTransition->nodeName; - $contentCondition = $contentTransition->firstChild; - if (strpos( $nameCondition, 'Condition' ) !== false) { - while ($contentCondition) { - $nameExpression = $contentCondition->nodeName; - $contentCondition1 = ''; - if (strpos( $nameExpression, 'Expression' ) !== false) { - $contentCondition1 = $contentCondition->firstChild; - if ($contentCondition1 != array ()) { - $output = $contentCondition1->nodeValue; - } - } - $contentCondition = $contentCondition->nextSibling; - } - } - $contentTransition = $contentTransition->nextSibling; - } - $routeTransitions[$posT]['ID'] = $idTransition; - $routeTransitions[$posT]['ROUTE'] = $valueRoute; - $routeTransitions[$posT]['FROM'] = $from; - $routeTransitions[$posT]['TO'] = $to; - $routeTransitions[$posT]['TOORFROM'] = $typeT; - $routeTransitions[$posT]['ROU_TYPE'] = $typeRoute; - $routeTransitions[$posT]['CONDITION'] = $output; - $routeTransitions[$posT]['CONDITION_DIS'] = $conditionD; - $routeTransitions[$posT]['TYPE_DIS'] = $typeD; - $output = ''; - $posT = $posT + 1; - $sequencial = 1; - } - if ($isEnd == 0 and $isStart == 0 and $sequencial == 0 and $isScheduler == 0 and $isMessage == 0) { - $dataRoutes[$numberRoutes] = $this->createRoute( $routes ); - $numberRoutes = $numberRoutes + 1; - } - } - } - $contentNode = $contentNode->nextSibling; - } - $routes = $routeTransitions; - foreach ($routeTransitions as $key => $id) { - $findTo = 0; - $findFrom = 0; - foreach ($dataTasks as $keyHidden => $value) { - if ($id['FROM'] == $value['TAS_UID']) { - $findFrom = 1; - } - if ($id['TO'] == $value['TAS_UID']) { - $findTo = 1; - } - } - if ($findTo == 0) { - foreach ($routes as $keyR => $idR) { - if ($id['TO'] == $idR['ROUTE']) { - $routeTransitions[$key]['ROU_TYPE'] = $idR['ROU_TYPE']; - $routeTransitions[$key]['ROUTE'] = $id['TO']; - $routeTransitions[$key]['TOORFROM'] = 'TO'; - } - } - } - if ($findFrom == 0) { - foreach ($routes as $keyR => $idR) { - if ($id['FROM'] == $idR['ROUTE']) { - $routeTransitions[$key]['ROU_TYPE'] = $idR['ROU_TYPE']; - $routeTransitions[$key]['ROUTE'] = $id['FROM']; - $routeTransitions[$key]['TOORFROM'] = 'FROM'; - } - } - } - } - $result['ROUTES'] = $dataRoutes; - $result['TRANSITIONS'] = $routeTransitions; - $result['TASKS'] = $dataTasks; - $result['NUMBER'] = $numberRoutes; - $result['TASKHIDDEN'] = $taskHidden; - $result['SCHEDULER'] = $schedulerArray; - $result['MESSAGES'] = $messages; - return $result; - } - - /** - * this public function creates a array according to the data given in a node - * - * @param object $contentNode - * @return array - */ - public function createActivity ($contentNode) - { - $coordinates = array (); - $event = ''; - $typeRoute = ''; - $markerVisible = ''; - $typePM = ''; - $isRoute = 0; - $description = ''; - $isSubProcess = 0; - $trigger = ''; - $time = ''; - $typeTime = ''; - $isMessage = 0; - while ($contentNode) { - if ($contentNode->nodeType == XML_ELEMENT_NODE) { - $nameChild = $contentNode->nodeName; - $contentChild = $contentNode->firstChild; - if (strpos( $nameChild, 'Description' ) !== false) { - $description = $contentNode->nodeValue; - } - if (strpos( $nameChild, 'ExtendedAttributes' ) !== false) { - $result = $this->createExtended( $contentChild ); - } - if (strpos( $nameChild, 'BlockActivity' ) !== false) { - $isSubProcess = 1; - $idSubProcess = trim( str_replace( '-', '', $contentNode->getAttribute( 'ActivitySetId' ) ) ); - } - if (strpos( $nameChild, 'Event' ) !== false) { - while ($contentChild) { - if ($contentChild->nodeType == XML_ELEMENT_NODE) { - $nameInfo = $contentChild->nodeName; - $contentInfo = $contentChild->firstChild; - if (strpos( $nameInfo, 'StartEvent' ) !== false) { - $event = 'START'; - $trigger = $contentChild->getAttribute( 'Trigger' ); - } - if (strpos( $nameInfo, 'EndEvent' ) !== false) { - $event = 'END'; - $trigger = $contentChild->getAttribute( 'Trigger' ); - if ($trigger == '') { - $trigger = 'None'; - } - } - if (strpos( $nameInfo, 'IntermediateEvent' ) !== false) { - $event = 'INTERMEDIATE'; - $trigger = $contentChild->getAttribute( 'Trigger' ); - } - } - $contentChild = $contentChild->nextSibling; - } - if ($trigger != 'None') { - if ($trigger == 'Timer') { - while ($contentInfo) { - $nameTrigger = $contentInfo->nodeName; - $contentTrigger = $contentInfo->firstChild; - if (strpos( $nameTrigger, 'TriggerTimer' ) !== false) { - $time = $contentInfo->getAttribute( 'TimeCycle' ); - $typeTime = 'TimeCycle'; - if ($time == '') { - $time = $contentInfo->getAttribute( 'TimeDate' ); - $typeTime = 'TimeDate'; - } - } - $contentInfo = $contentInfo->nextSibling; - } - } - if ($trigger == 'Message') { - $typeMessage = ''; - $isMessage = 1; - while ($contentInfo) { - $nameTrigger = $contentInfo->nodeName; - $contentTrigger = $contentInfo->firstChild; - if (strpos( $nameTrigger, 'TriggerResultMessage' ) !== false) { - $typeMessage = $contentInfo->getAttribute( 'CatchThrow' ); - } - $contentInfo = $contentInfo->nextSibling; - } - } - } - } - - if (strpos( $nameChild, 'Route' ) !== false) { - $typePM = ''; - $typeRoute = $contentNode->getAttribute( 'GatewayType' ); - $markerVisible = $contentNode->getAttribute( 'MarkerVisible' ); - if ($markerVisible != '') { - $coordinates['ROUTE'] = $markerVisible; - } - if ($typeRoute != '') { - $coordinates['ROUTE'] = $typeRoute; - } - if ($typeRoute == '' and $markerVisible == '') { - $coordinates['ROUTE'] = 'EVALUATE'; - } - switch ($coordinates['ROUTE']) { - case 'AND': - $typePM = 'PARALLEL'; - break; - case 'true': - $typePM = 'EVALUATE'; - break; - case 'EVALUATE': - $typePM = 'EVALUATE'; - break; - case 'OR': - $typePM = 'PARALLEL-BY-EVALUATION'; - break; - case 'Complex': - $typePM = 'DISCRIMINATOR'; - break; - } - $isRoute = 1; - } - if (strpos( $nameChild, 'NodeGraphicsInfos' ) !== false) { - $coordinates = $this->findCoordinates( $contentNode ); - $coordinates['EVENT'] = $event; - $coordinates['TRIGGER'] = $trigger; - $coordinates['TIME'] = $time; - $coordinates['TYPE_TIME'] = $typeTime; - $coordinates['DESCRIPTION'] = $description; - $coordinates['TYPE_DISCRIMINATOR'] = $result['TYPE']; - $coordinates['CONDITION_DISCRIMINATOR'] = $result['CONDITION']; - if ($isRoute == 1) { - $coordinates['ROUTE'] = $typePM; - } else { - $coordinates['ROUTE'] = ''; - } - if ($isMessage == 1) { - $coordinates['MESSAGE'] = $typeMessage; - } else { - $coordinates['MESSAGE'] = ''; - } - } - } - $contentNode = $contentNode->nextSibling; - } - return $coordinates; - } - - /** - * This public function return the type and the condition of a discriminator - * - * @param object $contentNode - * @return array - */ - public function createExtended ($contentNode) - { - $result = array (); - $result['TYPE'] = ''; - $result['CONDITION'] = ''; - $contentExtended = $contentNode; - while ($contentExtended) { - if ($contentExtended->nodeType == XML_ELEMENT_NODE) { - $nameChildExtended = $contentExtended->nodeName; - $contentChildExtended = $contentExtended->firstChild; - if (strpos( $nameChildExtended, 'ExtendedAttribute' ) !== false) { - $name = $contentExtended->getAttribute( 'Name' ); - if ($name == 'option') { - $result['TYPE'] = $contentExtended->getAttribute( 'Value' ); - } - if ($name == 'condition') { - $result['CONDITION'] = $contentExtended->getAttribute( 'Value' ); - } - } - } - $contentExtended = $contentExtended->nextSibling; - } - return $result; - } - - /** - * This public function find the coordinates of a object - * - * @param object $contentNode - * @return array - */ - public function findCoordinates ($contentNode) - { - $coordinates = array (); - while ($contentNode) { - if ($contentNode->nodeType == XML_ELEMENT_NODE) { - $nameChild = $contentNode->nodeName; - $contentChild = $contentNode->firstChild; - if (strpos( $nameChild, 'NodeGraphicsInfos' ) !== false) { - while ($contentChild) { - if ($contentChild->nodeType == XML_ELEMENT_NODE) { - $nameInfo = $contentChild->nodeName; - $contentInfo = $contentChild->firstChild; - if (strpos( $nameInfo, 'NodeGraphicsInfo' ) !== false) { - $coordinates['Height'] = $contentChild->getAttribute( 'Height' ); - $coordinates['Width'] = $contentChild->getAttribute( 'Width' ); - $coordinates['BorderColor'] = $contentChild->getAttribute( 'BorderColor' ); - $coordinates['FillColor'] = $contentChild->getAttribute( 'FillColor' ); - while ($contentInfo) { - $nameCoordinate = $contentInfo->nodeName; - $contentCoordinate = $contentInfo->firstChild; - - if (strpos( $nameCoordinate, 'Coordinates' ) !== false) { - $coordinates['X'] = $contentInfo->getAttribute( 'XCoordinate' ); - $coordinates['Y'] = $contentInfo->getAttribute( 'YCoordinate' ); - } - $contentInfo = $contentInfo->nextSibling; - } - - } - } - $contentChild = $contentChild->nextSibling; - } - } - } - $contentNode = $contentNode->nextSibling; - } - return $coordinates; - } - - /** - * This public function find the coordinates of a object - * - * @param string $idRoute - * @param array $aRoutes - * @return array - */ - public function findCoordinatesTransition ($idRoute, $aRoutes) - { - $coordinates = array (); - $size = sizeof( $aRoutes ); - $count = 0; - $find = 0; - while ($count < $size and $find == 0) { - if ($aRoutes[$count]['ID'] == $idRoute) { - $coordinates['X'] = $aRoutes[$count]['X']; - $coordinates['Y'] = $aRoutes[$count]['Y']; - $find = 1; - } - $count = $count + 1; - } - return $coordinates; - } - - /** - * This public function create the array Routes - * - * @param array $dataTasks - * @param array $arrayRoutes - * @param array $aEvents - * @param array $aGateways - * @param string $idProcess - * @return array - */ - public function createArrayRoutes ($dataTasks, $arrayRoutes, $aEvents, $aGateways, $aEnd, $idProcess) - { - $numberRoutes = 0; - $posT = 0; - $routeTransitions = array (); - $dataRoutes = array (); - $findRoute = 0; - $hidden = array (); - $taskHidden = array (); - $countHidden = 0; - foreach ($arrayRoutes as $idRoute => $valueRoute) { - $idTransition = $valueRoute['0']; - $from = $valueRoute['1']; - $to = $valueRoute['2']; - $toPort = $valueRoute['3']; - $fromPort = $valueRoute['4']; - $routes['ROU_UID'] = $idTransition; - $routes['ID_PROCESS'] = $idProcess; - $routes['FROM'] = $from; - $routes['TO'] = $to; - $sequencial = 0; - $isEnd = 0; - $typeRoute = ''; - $typePM = ''; - $findRoute = 0; - $isEventIntermediate = 0; - foreach ($aGateways as $routeBase => $value) { - if ($value['0'] == $from) { - if ($findRoute == 0) { - $typeT = 'FROM'; - $valueRoute = $value['0']; - $typeRoute = $value['1']; - $positionX = $value['2']; - $positionY = $value['3']; - $sequencial = 1; - $findRoute = 1; - } else { - $hidden['ID_TASK'] = G::generateUniqueID(); - $hidden['ID_PROCESS'] = $idProcess; - $hidden['TAS_TITLE'] = ''; - $hidden['TASK_TYPE'] = 'HIDDEN'; - $hidden['DESCRIPTION'] = $countHidden; - $hidden['X'] = $positionX; - $hidden['Y'] = $positionY; - $taskHidden[] = $hidden; - $dataTasks[] = $this->createTask( $hidden ); - $countHidden = $countHidden + 1; - $routeTransitions[$posT]['ID'] = G::generateUniqueID(); - $routeTransitions[$posT]['ROUTE'] = $from; - $routeTransitions[$posT]['FROM'] = $from; - $routeTransitions[$posT]['TO'] = $hidden['ID_TASK']; - $routeTransitions[$posT]['TOORFROM'] = 'FROM'; - $routeTransitions[$posT]['ROU_TYPE'] = $value['1']; - $routeTransitions[$posT]['CONDITION'] = ''; - $routeTransitions[$posT]['CONDITION_DIS'] = ''; - $routeTransitions[$posT]['TYPE_DIS'] = ''; - $posT = $posT + 1; - $from = $hidden['ID_TASK']; - } - } - if ($value['0'] == $to) { - if ($findRoute == 0) { - $typeT = 'TO'; - $valueRoute = $value['0']; - $typeRoute = $value['1']; - $positionX = $value['2']; - $positionY = $value['3']; - $sequencial = 1; - $findRoute = 1; - } else { - $hidden['ID_TASK'] = G::generateUniqueID(); - $hidden['ID_PROCESS'] = $idProcess; - $hidden['TAS_TITLE'] = ''; - $hidden['TASK_TYPE'] = 'HIDDEN'; - $hidden['DESCRIPTION'] = $countHidden; - $hidden['X'] = $positionX; - $hidden['Y'] = $positionY; - $taskHidden[] = $hidden; - $dataTasks[] = $this->createTask( $hidden ); - $countHidden = $countHidden + 1; - $routeTransitions[$posT]['ID'] = G::generateUniqueID(); - $routeTransitions[$posT]['ROUTE'] = $from; - $routeTransitions[$posT]['FROM'] = $from; - $routeTransitions[$posT]['TO'] = $hidden['ID_TASK']; - $routeTransitions[$posT]['TOORFROM'] = 'TO'; - $routeTransitions[$posT]['ROU_TYPE'] = $typeRoute; - $routeTransitions[$posT]['CONDITION'] = ''; - $routeTransitions[$posT]['CONDITION_DIS'] = ''; - $routeTransitions[$posT]['TYPE_DIS'] = ''; - $posT = $posT + 1; - $from = $hidden['ID_TASK']; - $typeT = 'TO'; - $valueRoute = $value['0']; - $typeRoute = $value['1']; - $sequencial = 1; - } - } - } - if ($sequencial == 0) { - foreach ($aEvents as $id => $value) { - if ($routes['TO'] == $value['0']) { - if ($value['1'] === 'bpmnEventEndSignal' or $value['1'] === 'bpmnEventMessageEnd') { - $routes['TO'] = '-1'; - $dataRoutes[$numberRoutes] = $this->createRoute( $routes ); - $numberRoutes = $numberRoutes + 1; - $isEnd = 1; - } else { - $isEventIntermediate = 1; - } - } - } - } - if ($sequencial == 1) { - $routeTransitions[$posT]['ID'] = $idTransition; - $routeTransitions[$posT]['ROUTE'] = $valueRoute; - $routeTransitions[$posT]['FROM'] = $from; - $routeTransitions[$posT]['TO'] = $to; - $routeTransitions[$posT]['TOORFROM'] = $typeT; - $routeTransitions[$posT]['ROU_TYPE'] = $typeRoute; - $routeTransitions[$posT]['CONDITION'] = ''; - $routeTransitions[$posT]['CONDITION_DIS'] = ''; - $routeTransitions[$posT]['TYPE_DIS'] = ''; - $posT = $posT + 1; - $sequencial = 1; - } - if ($isEnd == 0 and $sequencial == 0 and $isEventIntermediate == 0) { - $dataRoutes[$numberRoutes] = $this->createRoute( $routes ); - $numberRoutes = $numberRoutes + 1; - } - } - foreach ($routeTransitions as $id => $key) { - $typeRoute = $key['ROU_TYPE']; - switch ($typeRoute) { - case 'bpmnGatewayExclusiveData': - $typePM = 'EVALUATE'; - break; - case 'bpmnGatewayInclusive': - $typePM = 'PARALLEL-BY-EVALUATION'; - break; - case 'bpmnGatewayExclusiveEvent': - $typePM = 'EVALUATE'; - break; - case 'bpmnGatewayComplex': - $typePM = 'DISCRIMINATOR'; - break; - case 'bpmnGatewayParallel': - $typePM = 'PARALLEL'; - break; - } - $routeTransitions[$id]['ROU_TYPE'] = $typePM; - } - $routes = $routeTransitions; - foreach ($routeTransitions as $key => $id) { - $findTo = 0; - $findFrom = 0; - foreach ($dataTasks as $keyHidden => $value) { - if ($id['FROM'] == $value['TAS_UID']) { - $findFrom = 1; - } - if ($id['TO'] == $value['TAS_UID']) { - $findTo = 1; - } - } - if ($findTo == 0) { - foreach ($routes as $keyR => $idR) { - if ($id['TO'] == $idR['ROUTE']) { - $routeTransitions[$key]['ROU_TYPE'] = $idR['ROU_TYPE']; - $routeTransitions[$key]['ROUTE'] = $id['TO']; - $routeTransitions[$key]['TOORFROM'] = 'TO'; - } - } - } - if ($findFrom == 0) { - foreach ($routes as $keyR => $idR) { - if ($id['FROM'] == $idR['ROUTE']) { - $routeTransitions[$key]['ROU_TYPE'] = $idR['ROU_TYPE']; - $routeTransitions[$key]['ROUTE'] = $id['FROM']; - $routeTransitions[$key]['TOORFROM'] = 'FROM'; - } - } - } - } - $result['ROUTES'] = $dataRoutes; - $result['TRANSITIONS'] = $routeTransitions; - $result['NUMBER'] = $numberRoutes; - $result['TASKS'] = $dataTasks; - $result['HIDDEN'] = $taskHidden; - return $result; - } - - /** - * This public function convert the array events in a array with the events end - * - * @param object $aEvents - * @param string $idProcess - * @return array - */ - public function convertArrayEnd ($aEvents, $idProcess) - { - $result = array (); - $posEnd = 1; - $endArray = array (); - foreach ($aEvents as $id => $value) { - if ($value['1'] === 'bpmnEventEndSignal' or $value['1'] === 'bpmnEventMessageEnd') { - $result['ID_PROCESS'] = $idProcess; - $result['ID_TASK'] = $value['0']; - $endArray[$posEnd] = $result; - $posEnd = $posEnd + 1; - } - } - return $endArray; - } - - /** - * This public function create transitions from the array transitions for the new processmap - * - * @param array $task - * @param array $routes - * @param array $events - * @param array $countEvents - * @param array $arrayRoutes - * @param array $countRoutes - * @return array - */ - public function createTransitionsPM ($tasks, $routes, $events, $countEvents, $arrayRoutes, $countRoutes) - { - $cont = 0; - $dataRoutes = ''; - $endEvent = 1; - $taskParallel = ''; - $routeParallel = ''; - $taskSecJoin = ''; - $routeSecJoin = ''; - $taskDiscriminator = ''; - $taskEvaluate = ''; - $routeEvaluate = ''; - $taskParallelEv = ''; - $routeParallelEv = ''; - $taskSelect = ''; - $routeSelect = ''; - $routeEnd = ''; - $arraySecJoin = array (); - $position = 0; - $fillColor = ''; - $transitions = ''; - $arrayGateways = array (); - $countG = 0; - $gatPosX = 0; - $gatPosY = 0; - - foreach ($routes as $key => $row) { - if ($row['ROU_TYPE'] == 'SEC-JOIN') { - $arraySecJoin[$position] = array (); - $arraySecJoin[$position] = $row; - $position = $position + 1; - unset( $routes[$key] ); - } - } - $aux = $arraySecJoin; - foreach ($arraySecJoin as $key => $row) { - $aux[$key] = $row['ROU_NEXT_TASK']; - } - if (sizeof( $arraySecJoin ) > 0) { - array_multisort( $aux, SORT_ASC, $arraySecJoin ); - unset( $aux ); - } - foreach ($routes as $key => $row) { - $uid[$key] = $row['TAS_UID']; - $case[$key] = $row['ROU_CASE']; - } - if (sizeof( $routes ) > 0) { - array_multisort( $uid, SORT_ASC, $case, SORT_ASC, $routes ); - } - $routes = array_merge( $routes, $arraySecJoin ); - foreach ($routes as $key => $val) { - $end = 0; - $idRoute = $val['ROU_UID']; - $idTask = $val['TAS_UID']; - $nextTask = $val['ROU_NEXT_TASK']; - $condition = htmlentities( $val['ROU_CONDITION'] ); - $toPort = $val['ROU_TO_PORT']; - $fromPort = $val['ROU_FROM_PORT']; - //If End Event - if ($nextTask == "-1") { - $end = 1; - } - $typeRoute = $val['ROU_TYPE']; - $route = ''; - - //Get GAT_UID from ROUTE table based on ROU_UID - $oRoute = new Route(); - $aRouteDetails = $oRoute->load( $idRoute ); - $sGateUID = $aRouteDetails['GAT_UID']; - - //Get Gateway details from above GAT_UID - $oGateway = new Gateway(); - if ($sGateUID != '') { - $aGatewayDetails = $oGateway->load( $sGateUID ); - $gatPosX = $aGatewayDetails['GAT_X']; - $gatPosY = $aGatewayDetails['GAT_Y']; - } - - //if route is of SEQUENTIAL type,assign route id to GAT_UID - if ($sGateUID == '') { - $sGateUID = $idRoute; - } - if ($typeRoute != "SEQUENTIAL") { - switch ($typeRoute) { - case 'PARALLEL': - $coordinateX = 0; - $coordinateY = 0; - foreach ($tasks as $taskVal => $idVal) { - if ($idVal['TAS_UID'] == $idTask) { - $coordinateX = $idVal['TAS_POSX'] + 60; - $coordinateY = $idVal['TAS_POSY'] + 60; - $tas_width = $idVal['TAS_WIDTH']; - $tas_height = $idVal['TAS_HEIGHT']; - } - } - $positionX = $coordinateX + 62; - $positionY = $coordinateY + 55; - if ($idTask != $taskParallel) { - $taskParallel = $idTask; - $routeParallel = $sGateUID; - $arrayGateways[$countG]['0'] = $sGateUID; - $arrayGateways[$countG]['1'] = 'bpmnGatewayParallel'; - $arrayGateways[$countG]['2'] = $gatPosX; - $arrayGateways[$countG]['3'] = $gatPosY; - $countG = $countG + 1; - $arrayRoutes[$countRoutes]['0'] = G::generateUniqueID(); - $arrayRoutes[$countRoutes]['1'] = $taskParallel; - $arrayRoutes[$countRoutes]['2'] = $routeParallel; - $arrayRoutes[$countRoutes]['3'] = '1'; - $arrayRoutes[$countRoutes]['4'] = '2'; - $countRoutes = $countRoutes + 1; - $arrayRoutes[$countRoutes]['0'] = G::generateUniqueID(); - $arrayRoutes[$countRoutes]['1'] = $routeParallel; - $arrayRoutes[$countRoutes]['2'] = $nextTask; - $arrayRoutes[$countRoutes]['3'] = '1'; - $arrayRoutes[$countRoutes]['4'] = '2'; - $countRoutes = $countRoutes + 1; - } else { - $arrayRoutes[$countRoutes]['0'] = G::generateUniqueID(); - $arrayRoutes[$countRoutes]['1'] = $routeParallel; - $arrayRoutes[$countRoutes]['2'] = $nextTask; - $arrayRoutes[$countRoutes]['3'] = '1'; - $arrayRoutes[$countRoutes]['4'] = '2'; - $countRoutes = $countRoutes + 1; - } - break; - case 'SEC-JOIN': - $coordinateX = 0; - $coordinateY = 0; - foreach ($tasks as $taskVal => $idVal) { - if ($idVal['TAS_UID'] == $nextTask) { - $coordinateX = $idVal['TAS_POSX'] + 60; - $coordinateY = $idVal['TAS_POSY'] + 60; - $tas_width = $idVal['TAS_WIDTH']; - $tas_height = $idVal['TAS_HEIGHT']; - } - } - $positionX = $coordinateX + 60; - $positionY = $coordinateY - 45; - if ($nextTask != $taskSecJoin) { - $taskSecJoin = $nextTask; - $routeSecJoin = $sGateUID; - $arrayGateways[$countG]['0'] = $sGateUID; - $arrayGateways[$countG]['1'] = 'bpmnGatewayParallel'; - $arrayGateways[$countG]['2'] = $gatPosX; - $arrayGateways[$countG]['3'] = $gatPosY; - $countG = $countG + 1; - $arrayRoutes[$countRoutes]['0'] = G::generateUniqueID(); - $arrayRoutes[$countRoutes]['1'] = $routeSecJoin; - $arrayRoutes[$countRoutes]['2'] = $taskSecJoin; - $arrayRoutes[$countRoutes]['3'] = '1'; - $arrayRoutes[$countRoutes]['4'] = '2'; - $countRoutes = $countRoutes + 1; - $arrayRoutes[$countRoutes]['0'] = G::generateUniqueID(); - $arrayRoutes[$countRoutes]['1'] = $idTask; - $arrayRoutes[$countRoutes]['2'] = $routeSecJoin; - $arrayRoutes[$countRoutes]['3'] = '1'; - $arrayRoutes[$countRoutes]['4'] = '2'; - $countRoutes = $countRoutes + 1; - } else { - $arrayRoutes[$countRoutes]['0'] = G::generateUniqueID(); - $arrayRoutes[$countRoutes]['1'] = $idTask; - $arrayRoutes[$countRoutes]['2'] = $routeSecJoin; - $arrayRoutes[$countRoutes]['3'] = '1'; - $arrayRoutes[$countRoutes]['4'] = '2'; - $countRoutes = $countRoutes + 1; - } - break; - case 'EVALUATE': - $coordinateX = 0; - $coordinateY = 0; - foreach ($tasks as $taskVal => $idVal) { - if ($idVal['TAS_UID'] == $idTask) { - $coordinateX = $idVal['TAS_POSX'] + 60; - $coordinateY = $idVal['TAS_POSY'] + 60; - $tas_width = $idVal['TAS_WIDTH']; - $tas_height = $idVal['TAS_HEIGHT']; - } - } - $positionX = $coordinateX + 62; - $positionY = $coordinateY + 55; - if ($idTask != $taskEvaluate) { - $taskEvaluate = $idTask; - $routeEvaluate = $sGateUID; - if ($nextTask != "-1") { - $arrayGateways[$countG]['0'] = $sGateUID; - $arrayGateways[$countG]['1'] = 'bpmnGatewayExclusiveData'; - $arrayGateways[$countG]['2'] = $gatPosX; - $arrayGateways[$countG]['3'] = $gatPosY; - $countG = $countG + 1; - $arrayRoutes[$countRoutes]['0'] = G::generateUniqueID(); - $arrayRoutes[$countRoutes]['1'] = $taskEvaluate; - $arrayRoutes[$countRoutes]['2'] = $routeEvaluate; - $arrayRoutes[$countRoutes]['3'] = '1'; - $arrayRoutes[$countRoutes]['4'] = '2'; - $countRoutes = $countRoutes + 1; - $arrayRoutes[$countRoutes]['0'] = G::generateUniqueID(); - $arrayRoutes[$countRoutes]['1'] = $routeEvaluate; - $arrayRoutes[$countRoutes]['2'] = $nextTask; - $arrayRoutes[$countRoutes]['3'] = '1'; - $arrayRoutes[$countRoutes]['4'] = '2'; - $countRoutes = $countRoutes + 1; - } - } else { - if ($nextTask != "-1") { - $arrayRoutes[$countRoutes]['0'] = G::generateUniqueID(); - $arrayRoutes[$countRoutes]['1'] = $routeEvaluate; - $arrayRoutes[$countRoutes]['2'] = $nextTask; - $arrayRoutes[$countRoutes]['3'] = '1'; - $arrayRoutes[$countRoutes]['4'] = '2'; - $countRoutes = $countRoutes + 1; - } else { - $routeEnd = $routeEvaluate; - } - } - break; - case 'PARALLEL-BY-EVALUATION': - $coordinateX = 0; - $coordinateY = 0; - foreach ($tasks as $taskVal => $idVal) { - if ($idVal['TAS_UID'] == $idTask) { - $coordinateX = $idVal['TAS_POSX'] + 60; - $coordinateY = $idVal['TAS_POSY'] + 60; - $tas_width = $idVal['TAS_WIDTH']; - $tas_height = $idVal['TAS_HEIGHT']; - } - } - $positionX = $coordinateX + 62; - $positionY = $coordinateY + 55; - if ($idTask != $taskParallelEv) { - $taskParallelEv = $idTask; - $routeParallelEv = $sGateUID; - $arrayGateways[$countG]['0'] = $sGateUID; - $arrayGateways[$countG]['1'] = 'bpmnGatewayInclusive'; - $arrayGateways[$countG]['2'] = $gatPosX; - $arrayGateways[$countG]['3'] = $gatPosY; - $countG = $countG + 1; - $arrayRoutes[$countRoutes]['0'] = G::generateUniqueID(); - $arrayRoutes[$countRoutes]['1'] = $taskParallelEv; - $arrayRoutes[$countRoutes]['2'] = $routeParallelEv; - $arrayRoutes[$countRoutes]['3'] = '1'; - $arrayRoutes[$countRoutes]['4'] = '2'; - $countRoutes = $countRoutes + 1; - $arrayRoutes[$countRoutes]['0'] = G::generateUniqueID(); - $arrayRoutes[$countRoutes]['1'] = $routeParallelEv; - $arrayRoutes[$countRoutes]['2'] = $nextTask; - $arrayRoutes[$countRoutes]['3'] = '1'; - $arrayRoutes[$countRoutes]['4'] = '2'; - $countRoutes = $countRoutes + 1; - } else { - $arrayRoutes[$countRoutes]['0'] = G::generateUniqueID(); - $arrayRoutes[$countRoutes]['1'] = $routeParallelEv; - $arrayRoutes[$countRoutes]['2'] = $nextTask; - $arrayRoutes[$countRoutes]['3'] = '1'; - $arrayRoutes[$countRoutes]['4'] = '2'; - $countRoutes = $countRoutes + 1; - } - break; - case 'SELECT': - $coordinateX = 0; - $coordinateY = 0; - foreach ($tasks as $taskVal => $idVal) { - if ($idVal['TAS_UID'] == $idTask) { - $coordinateX = $idVal['TAS_POSX'] + 60; - $coordinateY = $idVal['TAS_POSY'] + 60; - $tas_width = $idVal['TAS_WIDTH']; - $tas_height = $idVal['TAS_HEIGHT']; - } - } - $positionX = $coordinateX + 60; - $positionY = $coordinateY + 40; - if ($idTask != $taskSelect) { - $taskSelect = $idTask; - $routeSelect = $sGateUID; - $arrayGateways[$countG]['0'] = $sGateUID; - $arrayGateways[$countG]['1'] = 'bpmnGatewayExclusiveData'; - $arrayGateways[$countG]['2'] = $gatPosX; - $arrayGateways[$countG]['3'] = $gatPosY; - $countG = $countG + 1; - $arrayRoutes[$countRoutes]['0'] = G::generateUniqueID(); - $arrayRoutes[$countRoutes]['1'] = $taskSelect; - $arrayRoutes[$countRoutes]['2'] = $routeSelect; - $arrayRoutes[$countRoutes]['3'] = '1'; - $arrayRoutes[$countRoutes]['4'] = '2'; - $countRoutes = $countRoutes + 1; - $arrayRoutes[$countRoutes]['0'] = G::generateUniqueID(); - $arrayRoutes[$countRoutes]['1'] = $routeSelect; - $arrayRoutes[$countRoutes]['2'] = $nextTask; - $arrayRoutes[$countRoutes]['3'] = '1'; - $arrayRoutes[$countRoutes]['4'] = '2'; - $countRoutes = $countRoutes + 1; - } else { - if ($nextTask != "-1") { - $arrayRoutes[$countRoutes]['0'] = G::generateUniqueID(); - $arrayRoutes[$countRoutes]['1'] = $routeSelect; - $arrayRoutes[$countRoutes]['2'] = $nextTask; - $arrayRoutes[$countRoutes]['3'] = '1'; - $arrayRoutes[$countRoutes]['4'] = '2'; - $countRoutes = $countRoutes + 1; - } else { - $routeEnd = $routeSelect; - } - } - break; - case 'DISCRIMINATOR': - $coordinateX = 0; - $coordinateY = 0; - $optional = $val['ROU_OPTIONAL']; - foreach ($tasks as $taskVal => $idVal) { - if ($idVal['TAS_UID'] == $nextTask) { - $coordinateX = $idVal['TAS_POSX'] + 60; - $coordinateY = $idVal['TAS_POSY'] + 60; - $tas_width = $idVal['TAS_WIDTH']; - $tas_height = $idVal['TAS_HEIGHT']; - } - } - $positionX = $coordinateX + 60; - $positionY = $coordinateY - 45; - if ($nextTask != $taskDiscriminator) { - $taskDiscriminator = $nextTask; - $routeDiscriminator = $sGateUID; - $arrayGateways[$countG]['0'] = $sGateUID; - $arrayGateways[$countG]['1'] = 'bpmnGatewayComplex'; - $arrayGateways[$countG]['2'] = $gatPosX; - $arrayGateways[$countG]['3'] = $gatPosY; - $countG = $countG + 1; - $arrayRoutes[$countRoutes]['0'] = G::generateUniqueID(); - $arrayRoutes[$countRoutes]['1'] = $routeDiscriminator; - $arrayRoutes[$countRoutes]['2'] = $taskDiscriminator; - $arrayRoutes[$countRoutes]['3'] = '1'; - $arrayRoutes[$countRoutes]['4'] = '2'; - $countRoutes = $countRoutes + 1; - $arrayRoutes[$countRoutes]['0'] = G::generateUniqueID(); - $arrayRoutes[$countRoutes]['1'] = $idTask; - $arrayRoutes[$countRoutes]['2'] = $routeDiscriminator; - $arrayRoutes[$countRoutes]['3'] = '1'; - $arrayRoutes[$countRoutes]['4'] = '2'; - $countRoutes = $countRoutes + 1; - } else { - $arrayRoutes[$countRoutes]['0'] = G::generateUniqueID(); - $arrayRoutes[$countRoutes]['1'] = $idTask; - $arrayRoutes[$countRoutes]['2'] = $routeDiscriminator; - $arrayRoutes[$countRoutes]['3'] = '1'; - $arrayRoutes[$countRoutes]['4'] = '2'; - $countRoutes = $countRoutes + 1; - } - break; - } - } - if ($end == 1) { - if ($typeRoute == "SEQUENTIAL") { - $coordinateX = 0; - $coordinateY = 0; - foreach ($tasks as $taskVal => $idVal) { - if ($idVal['TAS_UID'] == $idTask) { - $coordinateX = $idVal['TAS_POSX']; - $coordinateY = $idVal['TAS_POSY']; - $tas_width = $idVal['TAS_WIDTH']; - $tas_height = $idVal['TAS_HEIGHT']; - $tas_uid = $idVal['TAS_UID']; - } - } - $positionX = $coordinateX + 92; - $positionY = $coordinateY + 40; - $evn_uid = $val['ROU_EVN_UID']; - if ($evn_uid != '') { - $oEvent = new Event(); - $aEvent = $oEvent->load( $evn_uid ); - - $events[$countEvents]['0'] = $evn_uid; - $events[$countEvents]['1'] = $aEvent['EVN_TYPE']; - $events[$countEvents]['2'] = $positionX - 25; - $events[$countEvents]['3'] = $positionY + 35; - $events[$countEvents]['4'] = $tas_uid; - $countEvents = $countEvents + 1; - - $arrayRoutes[$countRoutes]['0'] = G::generateUniqueID(); - $arrayRoutes[$countRoutes]['1'] = $idTask; - $arrayRoutes[$countRoutes]['2'] = $evn_uid; - $arrayRoutes[$countRoutes]['3'] = $toPort; - $arrayRoutes[$countRoutes]['4'] = $fromPort; - $arrayRoutes[$countRoutes]['5'] = $typeRoute; - $countRoutes = $countRoutes + 1; - $end = 0; - $endEvent = 0; - } - } else { - $coordinateX = 0; - $coordinateY = 0; - foreach ($tasks as $taskVal => $idVal) { - if ($idVal['TAS_UID'] == $idTask) { - $coordinateX = $idVal['TAS_POSX']; - $coordinateY = $idVal['TAS_POSY']; - $tas_width = $idVal['TAS_WIDTH']; - $tas_height = $idVal['TAS_HEIGHT']; - $tas_uid = $idVal['TAS_UID']; - } - } - $positionX = $coordinateX + $tas_width / 1.5 + 19; - $positionY = $coordinateY + $tas_height / 2; - $idTask = $routeEnd; - $arrayRoutes[$countRoutes]['0'] = G::generateUniqueID(); - $arrayRoutes[$countRoutes]['1'] = $idTask; - $arrayRoutes[$countRoutes]['2'] = $idRoute; - $arrayRoutes[$countRoutes]['3'] = $toPort; - $arrayRoutes[$countRoutes]['4'] = $fromPort; - $arrayRoutes[$countRoutes]['5'] = $typeRoute; - $countRoutes = $countRoutes + 1; - - $events[$countEvents]['0'] = $idRoute; - $events[$countEvents]['1'] = 'bpmnEventEmptyEnd'; - $events[$countEvents]['2'] = $positionX - 25; - $events[$countEvents]['3'] = $positionY + 35; - $events[$countEvents]['4'] = $tas_uid; - $countEvents = $countEvents + 1; - $end = 0; - $endEvent = 0; - } - } else { - if ($typeRoute == "SEQUENTIAL") { - //Will Check for Intermediate Timer - $evn_uid = $val['ROU_EVN_UID']; - if ($evn_uid != '') { - $coordinateX = 0; - $coordinateY = 0; - foreach ($tasks as $taskVal => $idVal) { - if ($idVal['TAS_UID'] == $idTask) { - $coordinateX = $idVal['TAS_POSX']; - $coordinateY = $idVal['TAS_POSY']; - $tas_width = $idVal['TAS_WIDTH']; - $tas_height = $idVal['TAS_HEIGHT']; - } - } - $positionX = $coordinateX + $tas_width / 1.5 + 19; - $positionY = $coordinateY + $tas_height / 2; - - $oEvent = new Event(); - $aEvent = $oEvent->load( $evn_uid ); - $events[$countEvents]['0'] = $evn_uid; - $events[$countEvents]['1'] = $aEvent['EVN_TYPE']; - $events[$countEvents]['2'] = $aEvent['EVN_POSX']; - $events[$countEvents]['3'] = $aEvent['EVN_POSY']; - $countEvents = $countEvents + 1; - - $arrayRoutes[$countRoutes]['0'] = G::generateUniqueID(); - $arrayRoutes[$countRoutes]['1'] = $idTask; - $arrayRoutes[$countRoutes]['2'] = $evn_uid; - $arrayRoutes[$countRoutes]['3'] = '1'; - $arrayRoutes[$countRoutes]['4'] = '2'; - $countRoutes = $countRoutes + 1; - $arrayRoutes[$countRoutes]['0'] = G::generateUniqueID(); - $arrayRoutes[$countRoutes]['1'] = $evn_uid; - $arrayRoutes[$countRoutes]['2'] = $nextTask; - $arrayRoutes[$countRoutes]['3'] = '1'; - $arrayRoutes[$countRoutes]['4'] = '2'; - $countRoutes = $countRoutes + 1; - } else { - $arrayRoutes[$countRoutes]['0'] = $idRoute; - $arrayRoutes[$countRoutes]['1'] = $idTask; - $arrayRoutes[$countRoutes]['2'] = $nextTask; - $arrayRoutes[$countRoutes]['3'] = $toPort; - $arrayRoutes[$countRoutes]['4'] = $fromPort; - $countRoutes = $countRoutes + 1; - } - } - } - } - $data = array (); - $data['GATEWAYS'] = $arrayGateways; - $data['TRANSITION'] = $arrayRoutes; - $data['EVENTS'] = $events; - return $data; - } - - /** - * This public function Removes duplicate values from an array bi-dimensional - * - * @param array $array - * @return array - */ - public function super_unique ($array) - { - $result = array_map( "unserialize", array_unique( array_map( "serialize", $array ) ) ); - foreach ($result as $key => $value) { - if (is_array( $value )) { - $result[$key] = $this->super_unique( $value ); - } - } - return $result; - } - - /** - * This public function create a array for open the process in the new processmap - * - * @param array $array - * @return array - */ - public function createProcessPM ($array) - { - $result = array (); - $result['0'] = $array['PRO_UID']; - $result['1'] = $array['PRO_TITLE']; - $result['2'] = $array['PRO_DESCRIPTION']; - return $result; - } - - /** - * This public function creates an array for the lane that will be created according to the data given in an array - * - * @param array $lanes - * @return array $lane - */ - public function createSubProcessesPM ($array) - { - $arrayLanes = array (); - $field = array (); - foreach ($array as $key => $value) { - - $field['0'] = $value['SWI_UID']; - $field['1'] = $value['SWI_TEXT']; - $field['2'] = $value['SWI_X']; - $field['3'] = $value['SWI_Y']; - $field['4'] = ''; //$value['SWI_WIDTH']; - $field['5'] = ''; //$value['SWI_HEIGHT']; - } - return $arrayLanes; - } - - /** - * This public function creates an array for the lane that will be created according to the data given in an array - * - * @param array $lanes - * @return array $lane - */ - public function saveWebEntry ($array) - { - $file = new DOMDocument(); - foreach ($array as $key => $value) { - $link = $value->W_LINK; - // This split public function has been DEPRECATED as of PHP 5.3.0. - // $link = split('>',$link); - // $link = split('<',$link[2]); - $link = explode( '>', $link ); - $link = explode( '<', $link[2] ); - $link = $link['0']; - $uid = $value->W_PRO_UID; - $name = $value->W_FILENAME; - } - } -} - diff --git a/workflow/engine/controllers/bpmnDesigner.php b/workflow/engine/controllers/bpmnDesigner.php deleted file mode 100755 index a2f6273c8..000000000 --- a/workflow/engine/controllers/bpmnDesigner.php +++ /dev/null @@ -1,60 +0,0 @@ - - */ - -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'); - } -} \ No newline at end of file diff --git a/workflow/engine/controllers/bpmnProxy.php b/workflow/engine/controllers/bpmnProxy.php deleted file mode 100755 index e1441cf2f..000000000 --- a/workflow/engine/controllers/bpmnProxy.php +++ /dev/null @@ -1,255 +0,0 @@ - - */ - -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; - } -} - - - - - - - - - diff --git a/workflow/engine/methods/bpmn/cases_Scheduler_Save.php b/workflow/engine/methods/bpmn/cases_Scheduler_Save.php deleted file mode 100755 index af9e57266..000000000 --- a/workflow/engine/methods/bpmn/cases_Scheduler_Save.php +++ /dev/null @@ -1,301 +0,0 @@ -. - * - * 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."
"; - $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()); -} - -?> \ No newline at end of file diff --git a/workflow/engine/methods/bpmn/eventsEditAction.php b/workflow/engine/methods/bpmn/eventsEditAction.php deleted file mode 100755 index 23589f4a4..000000000 --- a/workflow/engine/methods/bpmn/eventsEditAction.php +++ /dev/null @@ -1,249 +0,0 @@ -. - * - * 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 '
';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('"', '"e;', $aData);
-}
diff --git a/workflow/engine/methods/bpmn/eventsSave.php b/workflow/engine/methods/bpmn/eventsSave.php
deleted file mode 100755
index 62d1611c6..000000000
--- a/workflow/engine/methods/bpmn/eventsSave.php
+++ /dev/null
@@ -1,56 +0,0 @@
-.
- *
- * 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());
-}
-
-?>
\ No newline at end of file
diff --git a/workflow/engine/methods/bpmn/get-tree.php b/workflow/engine/methods/bpmn/get-tree.php
deleted file mode 100755
index 1eabb39cd..000000000
--- a/workflow/engine/methods/bpmn/get-tree.php
+++ /dev/null
@@ -1,170 +0,0 @@
-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;$igetStepTriggersCriteria($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);
diff --git a/workflow/engine/methods/bpmn/get-triggers-tree.php b/workflow/engine/methods/bpmn/get-triggers-tree.php
deleted file mode 100755
index 7b30895c0..000000000
--- a/workflow/engine/methods/bpmn/get-triggers-tree.php
+++ /dev/null
@@ -1,124 +0,0 @@
-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;$igetStepTriggersCriteria($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);
diff --git a/workflow/engine/methods/bpmn/openProcess.php b/workflow/engine/methods/bpmn/openProcess.php
deleted file mode 100755
index 927df39c0..000000000
--- a/workflow/engine/methods/bpmn/openProcess.php
+++ /dev/null
@@ -1,272 +0,0 @@
-.
- *
- * 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";
-?>
diff --git a/workflow/engine/methods/bpmn/patterns_Ajax.php b/workflow/engine/methods/bpmn/patterns_Ajax.php
deleted file mode 100755
index f1635aef6..000000000
--- a/workflow/engine/methods/bpmn/patterns_Ajax.php
+++ /dev/null
@@ -1,190 +0,0 @@
-.
- * 
- * 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;
-}
-?>
\ No newline at end of file
diff --git a/workflow/engine/methods/bpmn/processes_Ajax.php b/workflow/engine/methods/bpmn/processes_Ajax.php
deleted file mode 100755
index 2cee1e82e..000000000
--- a/workflow/engine/methods/bpmn/processes_Ajax.php
+++ /dev/null
@@ -1,398 +0,0 @@
-.
- *
- * 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;
-                    
-                  }
-          
-    }
-}
-?>
diff --git a/workflow/engine/methods/bpmn/processes_doUpload.php b/workflow/engine/methods/bpmn/processes_doUpload.php
deleted file mode 100755
index 55f741459..000000000
--- a/workflow/engine/methods/bpmn/processes_doUpload.php
+++ /dev/null
@@ -1,179 +0,0 @@
- $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).'}');
-}
-?>
diff --git a/workflow/engine/methods/bpmn/proxyCaseSchLoad.php b/workflow/engine/methods/bpmn/proxyCaseSchLoad.php
deleted file mode 100755
index 583e83578..000000000
--- a/workflow/engine/methods/bpmn/proxyCaseSchLoad.php
+++ /dev/null
@@ -1,67 +0,0 @@
-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() );
-  }
-
-?>
diff --git a/workflow/engine/methods/bpmn/proxyCaseTrackerObjects.php b/workflow/engine/methods/bpmn/proxyCaseTrackerObjects.php
deleted file mode 100755
index 58a86a340..000000000
--- a/workflow/engine/methods/bpmn/proxyCaseTrackerObjects.php
+++ /dev/null
@@ -1,18 +0,0 @@
-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);
-?>
diff --git a/workflow/engine/methods/bpmn/proxyDatabaseConn.php b/workflow/engine/methods/bpmn/proxyDatabaseConn.php
deleted file mode 100755
index f569eb054..000000000
--- a/workflow/engine/methods/bpmn/proxyDatabaseConn.php
+++ /dev/null
@@ -1,27 +0,0 @@
-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() );
-  }
-?>
diff --git a/workflow/engine/methods/bpmn/proxyDynaform.php b/workflow/engine/methods/bpmn/proxyDynaform.php
deleted file mode 100755
index 740c62012..000000000
--- a/workflow/engine/methods/bpmn/proxyDynaform.php
+++ /dev/null
@@ -1,37 +0,0 @@
-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() );
-  }
diff --git a/workflow/engine/methods/bpmn/proxyEventsLoad.php b/workflow/engine/methods/bpmn/proxyEventsLoad.php
deleted file mode 100755
index 5ddf2e445..000000000
--- a/workflow/engine/methods/bpmn/proxyEventsLoad.php
+++ /dev/null
@@ -1,27 +0,0 @@
-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() );
-  }
-
-?>
diff --git a/workflow/engine/methods/bpmn/proxyExtjs.php b/workflow/engine/methods/bpmn/proxyExtjs.php
deleted file mode 100755
index e388932f9..000000000
--- a/workflow/engine/methods/bpmn/proxyExtjs.php
+++ /dev/null
@@ -1,454 +0,0 @@
-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' => '',
-                    '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' => '',
-                    'type' => $aField['sType'],
-                    'label' => $aField['sLabel']
-                    );
-                }
-              break;
-              default:
-                $rows[] = Array (
-                'fieldname' => $_GET['sFieldName'],
-                'variable' => $_GET['sSymbol'] . $aField['sName'],
-                'variable_label' => '',
-                '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;*/
-
diff --git a/workflow/engine/methods/bpmn/proxyInputDocument.php b/workflow/engine/methods/bpmn/proxyInputDocument.php
deleted file mode 100755
index 8bf76ed79..000000000
--- a/workflow/engine/methods/bpmn/proxyInputDocument.php
+++ /dev/null
@@ -1,30 +0,0 @@
-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() );
-  }
diff --git a/workflow/engine/methods/bpmn/proxyObjectPermissions.php b/workflow/engine/methods/bpmn/proxyObjectPermissions.php
deleted file mode 100755
index 45c40476f..000000000
--- a/workflow/engine/methods/bpmn/proxyObjectPermissions.php
+++ /dev/null
@@ -1,18 +0,0 @@
-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);
-?>
diff --git a/workflow/engine/methods/bpmn/proxyOutputDocument.php b/workflow/engine/methods/bpmn/proxyOutputDocument.php
deleted file mode 100755
index 5a9b7cf12..000000000
--- a/workflow/engine/methods/bpmn/proxyOutputDocument.php
+++ /dev/null
@@ -1,36 +0,0 @@
-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() );
-  }
diff --git a/workflow/engine/methods/bpmn/proxyProcessSupervisors.php b/workflow/engine/methods/bpmn/proxyProcessSupervisors.php
deleted file mode 100755
index a31c5d74d..000000000
--- a/workflow/engine/methods/bpmn/proxyProcessSupervisors.php
+++ /dev/null
@@ -1,40 +0,0 @@
-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() );
-  }
-?>
diff --git a/workflow/engine/methods/bpmn/proxyProcesses_Export.php b/workflow/engine/methods/bpmn/proxyProcesses_Export.php
deleted file mode 100755
index b0a073ccd..000000000
--- a/workflow/engine/methods/bpmn/proxyProcesses_Export.php
+++ /dev/null
@@ -1,58 +0,0 @@
-.
- *
- * 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' );
-}
diff --git a/workflow/engine/methods/bpmn/proxyReportTables.php b/workflow/engine/methods/bpmn/proxyReportTables.php
deleted file mode 100755
index 110d2e2e5..000000000
--- a/workflow/engine/methods/bpmn/proxyReportTables.php
+++ /dev/null
@@ -1,45 +0,0 @@
-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() );
-  }
-?>
diff --git a/workflow/engine/methods/bpmn/proxyStepTriggers.php b/workflow/engine/methods/bpmn/proxyStepTriggers.php
deleted file mode 100755
index 716377cba..000000000
--- a/workflow/engine/methods/bpmn/proxyStepTriggers.php
+++ /dev/null
@@ -1,40 +0,0 @@
-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() );
-  }
-
-?>
diff --git a/workflow/engine/methods/bpmn/proxySubProcessProperties.php b/workflow/engine/methods/bpmn/proxySubProcessProperties.php
deleted file mode 100755
index 9d973906c..000000000
--- a/workflow/engine/methods/bpmn/proxySubProcessProperties.php
+++ /dev/null
@@ -1,31 +0,0 @@
-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() );
-  }
-
-?>
diff --git a/workflow/engine/methods/bpmn/proxyTaskPropertiesDetails.php b/workflow/engine/methods/bpmn/proxyTaskPropertiesDetails.php
deleted file mode 100755
index 0faa1f5c4..000000000
--- a/workflow/engine/methods/bpmn/proxyTaskPropertiesDetails.php
+++ /dev/null
@@ -1,64 +0,0 @@
-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() );
-  }
-
-?>
diff --git a/workflow/engine/methods/bpmn/proxyTaskSteps.php b/workflow/engine/methods/bpmn/proxyTaskSteps.php
deleted file mode 100755
index fc657012a..000000000
--- a/workflow/engine/methods/bpmn/proxyTaskSteps.php
+++ /dev/null
@@ -1,28 +0,0 @@
-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() );
-  }
-
-?>
diff --git a/workflow/engine/methods/bpmn/proxyUsersList.php b/workflow/engine/methods/bpmn/proxyUsersList.php
deleted file mode 100755
index ab0bbb928..000000000
--- a/workflow/engine/methods/bpmn/proxyUsersList.php
+++ /dev/null
@@ -1,24 +0,0 @@
-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() );
-  }
-?>
diff --git a/workflow/engine/methods/bpmn/proxyVariable.php b/workflow/engine/methods/bpmn/proxyVariable.php
deleted file mode 100755
index 9dad9f008..000000000
--- a/workflow/engine/methods/bpmn/proxyVariable.php
+++ /dev/null
@@ -1,60 +0,0 @@
-
- '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' => '',
-            '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' => '',
-            'type' => $aField['sType'],
-            'label' => $aField['sLabel']
-            );
-        }
-      break;
-      default:
-        $aRows[] = Array (
-        'fieldname' => $_GET['sFieldName'],
-        'variable' => $_GET['sSymbol'] . $aField['sName'],
-        'variable_label' => '',
-        'type' => $aField['sType'],
-        'label' => $aField['sLabel']
-        );
-      break;
-  }
-
-}
-
-array_shift($aRows);
-$result['totalCount'] = count($aRows);
-$result['data'] = $aRows;
-print G::json_encode($result);
-?>
diff --git a/workflow/engine/methods/bpmn/saveProcess.php b/workflow/engine/methods/bpmn/saveProcess.php
deleted file mode 100755
index 058ac06eb..000000000
--- a/workflow/engine/methods/bpmn/saveProcess.php
+++ /dev/null
@@ -1,136 +0,0 @@
-.
- *
- * 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);
diff --git a/workflow/engine/methods/processes/processes_DownloadFileXpdl.php b/workflow/engine/methods/processes/processes_DownloadFileXpdl.php
deleted file mode 100755
index 8c0fbfaf3..000000000
--- a/workflow/engine/methods/processes/processes_DownloadFileXpdl.php
+++ /dev/null
@@ -1,36 +0,0 @@
-.
- *
- * 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 );
diff --git a/workflow/engine/methods/processes/processes_ImportExistingXpdl.php b/workflow/engine/methods/processes/processes_ImportExistingXpdl.php
deleted file mode 100755
index 3ea21ee39..000000000
--- a/workflow/engine/methods/processes/processes_ImportExistingXpdl.php
+++ /dev/null
@@ -1,132 +0,0 @@
-.
- *
- * 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" );
-}
diff --git a/workflow/engine/methods/processes/processes_ImportFileXpdl.php b/workflow/engine/methods/processes/processes_ImportFileXpdl.php
deleted file mode 100755
index 5e9fa8049..000000000
--- a/workflow/engine/methods/processes/processes_ImportFileXpdl.php
+++ /dev/null
@@ -1,105 +0,0 @@
-.
- *
- * 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" );
-}
diff --git a/workflow/engine/methods/processes/processes_Import_Ajax.php b/workflow/engine/methods/processes/processes_Import_Ajax.php
index 3e3fc4892..029581b17 100644
--- a/workflow/engine/methods/processes/processes_Import_Ajax.php
+++ b/workflow/engine/methods/processes/processes_Import_Ajax.php
@@ -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,21 +85,16 @@ 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
-        //1 -exist process
-        $result->ExistGroupsInDatabase = ""; //"" -Default
-        //0 -Dont exist process
-        //1 -exist process
+        $result->ExistProcessInDatabase = ""; //"" -Default
+        //0 -Dont exist process
+        //1 -exist process
+        $result->ExistGroupsInDatabase = ""; //"" -Default
+        //0 -Dont exist process
+        //1 -exist process
         $optionGroupExistInDatabase = isset( $_REQUEST["optionGroupExistInDatabase"] ) ? $_REQUEST["optionGroupExistInDatabase"] : null;
 
-        //!Upload file
+        //!Upload file
         if (! is_null( $optionGroupExistInDatabase )) {
             $filename = $_REQUEST["PRO_FILENAME"];
             $path = PATH_DOCUMENT . 'input' . PATH_SEP;
@@ -109,12 +103,12 @@ if ($action == "uploadFileNewProcess") {
                 $filename = $_FILES['form']['name']['PROCESS_FILENAME'];
                 $path = PATH_DOCUMENT . 'input' . PATH_SEP;
                 $tempName = $_FILES['form']['tmp_name']['PROCESS_FILENAME'];
-                //$action = "none";
+                //$action = "none";
                 G::uploadFile( $tempName, $path, $filename );
             }
         }
 
-        //importing a bpmn diagram, using external class to do it.
+        //importing a bpmn diagram, using external class to do it.
         if ($processFileType == "bpmn") {
             G::LoadClass( 'bpmnExport' );
             $bpmn = new bpmnExport();
@@ -122,16 +116,14 @@ 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 );
 
-        //!Upload file
+        //!Upload file
         $Fields['PRO_FILENAME'] = $filename;
         $Fields['IMPORT_OPTION'] = 2;
 
@@ -145,7 +137,7 @@ if ($action == "uploadFileNewProcess") {
             $result->ExistProcessInDatabase = 0;
         }
 
-        //!respect of the groups
+        //!respect of the groups
         $result->ExistGroupsInDatabase = 1;
         $result->groupBeforeAccion = $action;
         if (! is_null( $optionGroupExistInDatabase )) {
@@ -163,21 +155,16 @@ if ($action == "uploadFileNewProcess") {
                 $result->ExistGroupsInDatabase = 0;
             }
         }
-        //!respect of the groups
+        //!respect of the groups
 
 
         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 );
             }
         }
 
-        //!data ouput
+        //!data ouput
         $result->sNewProUid = $sProUid;
         $result->proFileName = $Fields['PRO_FILENAME'];
     } catch (Exception $e) {
@@ -193,34 +180,29 @@ if ($action == "uploadFileNewProcessExist") {
         $filename = $_REQUEST["PRO_FILENAME"];
         $processFileType = $_REQUEST["processFileType"];
 
-        $result->ExistGroupsInDatabase = ""; //"" -Default
-        //0 -Dont exist process
-        //1 -exist process
+        $result->ExistGroupsInDatabase = ""; //"" -Default
+        //0 -Dont exist process
+        //1 -exist process
 
 
         $optionGroupExistInDatabase = isset( $_REQUEST["optionGroupExistInDatabase"] ) ? $_REQUEST["optionGroupExistInDatabase"] : null;
         $sNewProUid = "";
 
         $oProcess = new stdClass();
-        if ($processFileType != "pm" && $processFileType != "xpdl") {
+        if ($processFileType != "pm") {
             throw new Exception( G::LoadTranslation( "ID_ERROR_UPLOAD_FILE_CONTACT_ADMINISTRATOR" ) );
         }
 
-        //load the variables
+        //load the variables
         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 );
@@ -248,7 +230,7 @@ if ($action == "uploadFileNewProcessExist") {
         }
 
         if ($result->ExistGroupsInDatabase == 0) {
-            //Update the current Process, overwriting all tasks and steps
+            //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 )) {
@@ -263,7 +245,7 @@ if ($action == "uploadFileNewProcessExist") {
                 $sNewProUid = $sProUid;
             }
 
-            //Disable current Process and create a new version of the Process
+            //Disable current Process and create a new version of the Process
             if ($option == 2) {
                 $oProcess->disablePreviousProcesses( $sProUid );
                 $sNewProUid = $oProcess->getUnusedProcessGUID();
@@ -274,18 +256,12 @@ 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 );
                 }
             }
 
-            //Create a completely new Process without change the current Process
+            //Create a completely new Process without change the current Process
             if ($option == 3) {
-                //krumo ($oData); die;
+                //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' );
@@ -293,24 +269,18 @@ 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 );
                 }
             }
         }
 
-        //!data ouput
+        //!data ouput
         $result->fileName = $filename;
         $result->importOption = $option;
         $result->sNewProUid = $sNewProUid;
         $result->success = true;
         $result->ExistGroupsInDatabase = $result->ExistGroupsInDatabase;
         $result->groupBeforeAccion = $action;
-        //!data ouput
+        //!data ouput
     } catch (Exception $e) {
         $result->response = $e->getMessage();
         $result->success = true;
@@ -318,5 +288,5 @@ if ($action == "uploadFileNewProcessExist") {
 }
 
 echo G::json_encode( $result );
-exit();
-
+exit();
+
diff --git a/workflow/engine/methods/services/xpdl.php b/workflow/engine/methods/services/xpdl.php
deleted file mode 100755
index fc75926a4..000000000
--- a/workflow/engine/methods/services/xpdl.php
+++ /dev/null
@@ -1,184 +0,0 @@
-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 "
"; - $aRoute = $oTask->getRoute($aProcess['PRO_UID'], $value['TAS_UID']); - //print_r($aRoute[0]['ROU_UID']); echo "
"; - /*foreach($aRoute as $k => $v) - echo $k."-->".$v."
"; - */ - 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!!!
"; - diff --git a/workflow/engine/templates/bpmn/Annotation.js b/workflow/engine/templates/bpmn/Annotation.js deleted file mode 100755 index 2382ad80d..000000000 --- a/workflow/engine/templates/bpmn/Annotation.js +++ /dev/null @@ -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 += '
'+ - 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.
- * The string is first cleared and new string is painted.

- **/ - 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); -}; diff --git a/workflow/engine/templates/bpmn/Dataobject.js b/workflow/engine/templates/bpmn/Dataobject.js deleted file mode 100755 index 375e499d5..000000000 --- a/workflow/engine/templates/bpmn/Dataobject.js +++ /dev/null @@ -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 -} diff --git a/workflow/engine/templates/bpmn/EventBoundaryTimerInter.js b/workflow/engine/templates/bpmn/EventBoundaryTimerInter.js deleted file mode 100755 index 68ba991f8..000000000 --- a/workflow/engine/templates/bpmn/EventBoundaryTimerInter.js +++ /dev/null @@ -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); -} -}; diff --git a/workflow/engine/templates/bpmn/EventCancelEnd.js b/workflow/engine/templates/bpmn/EventCancelEnd.js deleted file mode 100755 index 014a07236..000000000 --- a/workflow/engine/templates/bpmn/EventCancelEnd.js +++ /dev/null @@ -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); -} -}; diff --git a/workflow/engine/templates/bpmn/EventCancelInter.js b/workflow/engine/templates/bpmn/EventCancelInter.js deleted file mode 100755 index 7c5bc20e5..000000000 --- a/workflow/engine/templates/bpmn/EventCancelInter.js +++ /dev/null @@ -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(); -}; - - diff --git a/workflow/engine/templates/bpmn/EventCompEnd.js b/workflow/engine/templates/bpmn/EventCompEnd.js deleted file mode 100755 index 86bda85f3..000000000 --- a/workflow/engine/templates/bpmn/EventCompEnd.js +++ /dev/null @@ -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); -} -}; diff --git a/workflow/engine/templates/bpmn/EventCompInter.js b/workflow/engine/templates/bpmn/EventCompInter.js deleted file mode 100755 index 5f0f9b3ae..000000000 --- a/workflow/engine/templates/bpmn/EventCompInter.js +++ /dev/null @@ -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); -} -}; - diff --git a/workflow/engine/templates/bpmn/EventEmptyEnd.js b/workflow/engine/templates/bpmn/EventEmptyEnd.js deleted file mode 100755 index 832aebb81..000000000 --- a/workflow/engine/templates/bpmn/EventEmptyEnd.js +++ /dev/null @@ -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); -} -}; diff --git a/workflow/engine/templates/bpmn/EventEmptyInter.js b/workflow/engine/templates/bpmn/EventEmptyInter.js deleted file mode 100755 index 917346cb5..000000000 --- a/workflow/engine/templates/bpmn/EventEmptyInter.js +++ /dev/null @@ -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); -} -}; - diff --git a/workflow/engine/templates/bpmn/EventEmptyStart.js b/workflow/engine/templates/bpmn/EventEmptyStart.js deleted file mode 100755 index 608c461ea..000000000 --- a/workflow/engine/templates/bpmn/EventEmptyStart.js +++ /dev/null @@ -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); -} -}; - diff --git a/workflow/engine/templates/bpmn/EventEndSignal.js b/workflow/engine/templates/bpmn/EventEndSignal.js deleted file mode 100755 index db69dccae..000000000 --- a/workflow/engine/templates/bpmn/EventEndSignal.js +++ /dev/null @@ -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); -} -}; diff --git a/workflow/engine/templates/bpmn/EventErrorEnd.js b/workflow/engine/templates/bpmn/EventErrorEnd.js deleted file mode 100755 index 1269f803d..000000000 --- a/workflow/engine/templates/bpmn/EventErrorEnd.js +++ /dev/null @@ -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); -} -}; - diff --git a/workflow/engine/templates/bpmn/EventErrorInter.js b/workflow/engine/templates/bpmn/EventErrorInter.js deleted file mode 100755 index 8c5b8d338..000000000 --- a/workflow/engine/templates/bpmn/EventErrorInter.js +++ /dev/null @@ -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(); -}; - - diff --git a/workflow/engine/templates/bpmn/EventInterSignal.js b/workflow/engine/templates/bpmn/EventInterSignal.js deleted file mode 100755 index 0962e8582..000000000 --- a/workflow/engine/templates/bpmn/EventInterSignal.js +++ /dev/null @@ -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); -} -}; diff --git a/workflow/engine/templates/bpmn/EventLinkEnd.js b/workflow/engine/templates/bpmn/EventLinkEnd.js deleted file mode 100755 index 0ddc4eb74..000000000 --- a/workflow/engine/templates/bpmn/EventLinkEnd.js +++ /dev/null @@ -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(); -}; - - diff --git a/workflow/engine/templates/bpmn/EventLinkInter.js b/workflow/engine/templates/bpmn/EventLinkInter.js deleted file mode 100755 index 093c0e131..000000000 --- a/workflow/engine/templates/bpmn/EventLinkInter.js +++ /dev/null @@ -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); -} -}; diff --git a/workflow/engine/templates/bpmn/EventLinkStart.js b/workflow/engine/templates/bpmn/EventLinkStart.js deleted file mode 100755 index 23797ce33..000000000 --- a/workflow/engine/templates/bpmn/EventLinkStart.js +++ /dev/null @@ -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(); -}; - - diff --git a/workflow/engine/templates/bpmn/EventMessageEnd.js b/workflow/engine/templates/bpmn/EventMessageEnd.js deleted file mode 100755 index 89d1393f0..000000000 --- a/workflow/engine/templates/bpmn/EventMessageEnd.js +++ /dev/null @@ -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); -} -}; diff --git a/workflow/engine/templates/bpmn/EventMessageInter.js b/workflow/engine/templates/bpmn/EventMessageInter.js deleted file mode 100755 index 9bfbe5d07..000000000 --- a/workflow/engine/templates/bpmn/EventMessageInter.js +++ /dev/null @@ -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); -} -}; diff --git a/workflow/engine/templates/bpmn/EventMessageRecInter.js b/workflow/engine/templates/bpmn/EventMessageRecInter.js deleted file mode 100755 index 3a5d3c7c3..000000000 --- a/workflow/engine/templates/bpmn/EventMessageRecInter.js +++ /dev/null @@ -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); -} -}; diff --git a/workflow/engine/templates/bpmn/EventMessageSendInter.js b/workflow/engine/templates/bpmn/EventMessageSendInter.js deleted file mode 100755 index a1fdff3d5..000000000 --- a/workflow/engine/templates/bpmn/EventMessageSendInter.js +++ /dev/null @@ -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); -} -}; diff --git a/workflow/engine/templates/bpmn/EventMessageStart.js b/workflow/engine/templates/bpmn/EventMessageStart.js deleted file mode 100755 index 338ee2de0..000000000 --- a/workflow/engine/templates/bpmn/EventMessageStart.js +++ /dev/null @@ -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); - } -}; - diff --git a/workflow/engine/templates/bpmn/EventMulStart.js b/workflow/engine/templates/bpmn/EventMulStart.js deleted file mode 100755 index 9f1856d43..000000000 --- a/workflow/engine/templates/bpmn/EventMulStart.js +++ /dev/null @@ -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); -} -}; diff --git a/workflow/engine/templates/bpmn/EventMultipleEnd.js b/workflow/engine/templates/bpmn/EventMultipleEnd.js deleted file mode 100755 index 8a90e1f34..000000000 --- a/workflow/engine/templates/bpmn/EventMultipleEnd.js +++ /dev/null @@ -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); -} -}; diff --git a/workflow/engine/templates/bpmn/EventMultipleInter.js b/workflow/engine/templates/bpmn/EventMultipleInter.js deleted file mode 100755 index 24ccf7a83..000000000 --- a/workflow/engine/templates/bpmn/EventMultipleInter.js +++ /dev/null @@ -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); -} -}; diff --git a/workflow/engine/templates/bpmn/EventRuleInter.js b/workflow/engine/templates/bpmn/EventRuleInter.js deleted file mode 100755 index c8b613749..000000000 --- a/workflow/engine/templates/bpmn/EventRuleInter.js +++ /dev/null @@ -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); -} -}; diff --git a/workflow/engine/templates/bpmn/EventRuleStart.js b/workflow/engine/templates/bpmn/EventRuleStart.js deleted file mode 100755 index ebed18558..000000000 --- a/workflow/engine/templates/bpmn/EventRuleStart.js +++ /dev/null @@ -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); -} -}; diff --git a/workflow/engine/templates/bpmn/EventSignalStart.js b/workflow/engine/templates/bpmn/EventSignalStart.js deleted file mode 100755 index 1af578206..000000000 --- a/workflow/engine/templates/bpmn/EventSignalStart.js +++ /dev/null @@ -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); -} -}; diff --git a/workflow/engine/templates/bpmn/EventTerminateEnd.js b/workflow/engine/templates/bpmn/EventTerminateEnd.js deleted file mode 100755 index f5f23f41e..000000000 --- a/workflow/engine/templates/bpmn/EventTerminateEnd.js +++ /dev/null @@ -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); -} -}; diff --git a/workflow/engine/templates/bpmn/EventTimerInter.js b/workflow/engine/templates/bpmn/EventTimerInter.js deleted file mode 100755 index 28d22dad1..000000000 --- a/workflow/engine/templates/bpmn/EventTimerInter.js +++ /dev/null @@ -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); -} -}; diff --git a/workflow/engine/templates/bpmn/EventTimerStart.js b/workflow/engine/templates/bpmn/EventTimerStart.js deleted file mode 100755 index e99d4768e..000000000 --- a/workflow/engine/templates/bpmn/EventTimerStart.js +++ /dev/null @@ -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); -} -}; diff --git a/workflow/engine/templates/bpmn/GatewayComplex.js b/workflow/engine/templates/bpmn/GatewayComplex.js deleted file mode 100755 index fb8e8582b..000000000 --- a/workflow/engine/templates/bpmn/GatewayComplex.js +++ /dev/null @@ -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;iThis class represents the primary interface of a component based grid control to represent data - * in a tabular format of rows and columns. The GridPanel is composed of the following:

- *
    - *
  • {@link Ext.data.Store Store} : The Model holding the data records (rows) - *
  • - *
  • {@link Ext.grid.ColumnModel Column model} : Column makeup - *
  • - *
  • {@link Ext.grid.GridView View} : Encapsulates the user interface - *
  • - *
  • {@link Ext.grid.AbstractSelectionModel selection model} : Selection behavior - *
  • - *
- *

Example usage:

- *

-var grid = new Ext.grid.GridPanel({
-    {@link #store}: new {@link Ext.data.Store}({
-        {@link Ext.data.Store#autoDestroy autoDestroy}: true,
-        {@link Ext.data.Store#reader reader}: reader,
-        {@link Ext.data.Store#data data}: xg.dummyData
-    }),
-    {@link #colModel}: new {@link Ext.grid.ColumnModel}({
-        {@link Ext.grid.ColumnModel#defaults defaults}: {
-            width: 120,
-            sortable: true
-        },
-        {@link Ext.grid.ColumnModel#columns columns}: [
-            {id: 'company', header: 'Company', width: 200, sortable: true, dataIndex: 'company'},
-            {header: 'Price', renderer: Ext.util.Format.usMoney, dataIndex: 'price'},
-            {header: 'Change', dataIndex: 'change'},
-            {header: '% Change', dataIndex: 'pctChange'},
-            // instead of specifying renderer: Ext.util.Format.dateRenderer('m/d/Y') use xtype
-            {
-                header: 'Last Updated', width: 135, dataIndex: 'lastChange',
-                xtype: 'datecolumn', format: 'M d, Y'
-            }
-        ],
-    }),
-    {@link #viewConfig}: {
-        {@link Ext.grid.GridView#forceFit forceFit}: true,
-
-//      Return CSS class to apply to rows depending upon data values
-        {@link Ext.grid.GridView#getRowClass getRowClass}: function(record, index) {
-            var c = record.{@link Ext.data.Record#get get}('change');
-            if (c < 0) {
-                return 'price-fall';
-            } else if (c > 0) {
-                return 'price-rise';
-            }
-        }
-    },
-    {@link #sm}: new Ext.grid.RowSelectionModel({singleSelect:true}),
-    width: 600,
-    height: 300,
-    frame: true,
-    title: 'Framed with Row Selection and Horizontal Scrolling',
-    iconCls: 'icon-grid'
-});
- * 
- *

Notes:

- *
    - *
  • Although this class inherits many configuration options from base classes, some of them - * (such as autoScroll, autoWidth, layout, items, etc) are not used by this class, and will - * have no effect.
  • - *
  • A grid requires a width in which to scroll its columns, and a height in which to - * scroll its rows. These dimensions can either be set explicitly through the - * {@link Ext.BoxComponent#height height} and {@link Ext.BoxComponent#width width} - * configuration options or implicitly set by using the grid as a child item of a - * {@link Ext.Container Container} which will have a {@link Ext.Container#layout layout manager} - * provide the sizing of its child items (for example the Container of the Grid may specify - * {@link Ext.Container#layout layout}:'fit').
  • - *
  • To access the data in a Grid, it is necessary to use the data model encapsulated - * by the {@link #store Store}. See the {@link #cellclick} event for more details.
  • - *
- * @constructor - * @param {Object} config The config object - * @xtype grid - */ -Ext.grid.GridPanel = Ext.extend(Ext.Panel, { - /** - * @cfg {String} autoExpandColumn - *

The {@link Ext.grid.Column#id id} of a {@link Ext.grid.Column column} in - * this grid that should expand to fill unused space. This value specified here can not - * be 0.

- *

Note: If the Grid's {@link Ext.grid.GridView view} is configured with - * {@link Ext.grid.GridView#forceFit forceFit}=true the autoExpandColumn - * is ignored. See {@link Ext.grid.Column}.{@link Ext.grid.Column#width width} - * for additional details.

- *

See {@link #autoExpandMax} and {@link #autoExpandMin} also.

- */ - autoExpandColumn : false, - /** - * @cfg {Number} autoExpandMax The maximum width the {@link #autoExpandColumn} - * can have (if enabled). Defaults to 1000. - */ - autoExpandMax : 1000, - /** - * @cfg {Number} autoExpandMin The minimum width the {@link #autoExpandColumn} - * can have (if enabled). Defaults to 50. - */ - autoExpandMin : 50, - /** - * @cfg {Boolean} columnLines true to add css for column separation lines. - * Default is false. - */ - columnLines : false, - /** - * @cfg {Object} cm Shorthand for {@link #colModel}. - */ - /** - * @cfg {Object} colModel The {@link Ext.grid.ColumnModel} to use when rendering the grid (required). - */ - /** - * @cfg {Array} columns An array of {@link Ext.grid.Column columns} to auto create a - * {@link Ext.grid.ColumnModel}. The ColumnModel may be explicitly created via the - * {@link #colModel} configuration property. - */ - /** - * @cfg {String} ddGroup The DD group this GridPanel belongs to. Defaults to 'GridDD' if not specified. - */ - /** - * @cfg {String} ddText - * Configures the text in the drag proxy. Defaults to: - *

-     * ddText : '{0} selected row{1}'
-     * 
- * {0} is replaced with the number of selected rows. - */ - ddText : '{0} selected row{1}', - /** - * @cfg {Boolean} deferRowRender

Defaults to true to enable deferred row rendering.

- *

This allows the GridPanel to be initially rendered empty, with the expensive update of the row - * structure deferred so that layouts with GridPanels appear more quickly.

- */ - deferRowRender : true, - /** - * @cfg {Boolean} disableSelection

true to disable selections in the grid. Defaults to false.

- *

Ignored if a {@link #selModel SelectionModel} is specified.

- */ - /** - * @cfg {Boolean} enableColumnResize false to turn off column resizing for the whole grid. Defaults to true. - */ - /** - * @cfg {Boolean} enableColumnHide - * Defaults to true to enable {@link Ext.grid.Column#hidden hiding of columns} - * with the {@link #enableHdMenu header menu}. - */ - enableColumnHide : true, - /** - * @cfg {Boolean} enableColumnMove Defaults to true to enable drag and drop reorder of columns. false - * to turn off column reordering via drag drop. - */ - enableColumnMove : true, - /** - * @cfg {Boolean} enableDragDrop

Enables dragging of the selected rows of the GridPanel. Defaults to false.

- *

Setting this to true causes this GridPanel's {@link #getView GridView} to - * create an instance of {@link Ext.grid.GridDragZone}. Note: this is available only after - * the Grid has been rendered as the GridView's {@link Ext.grid.GridView#dragZone dragZone} - * property.

- *

A cooperating {@link Ext.dd.DropZone DropZone} must be created who's implementations of - * {@link Ext.dd.DropZone#onNodeEnter onNodeEnter}, {@link Ext.dd.DropZone#onNodeOver onNodeOver}, - * {@link Ext.dd.DropZone#onNodeOut onNodeOut} and {@link Ext.dd.DropZone#onNodeDrop onNodeDrop} are able - * to process the {@link Ext.grid.GridDragZone#getDragData data} which is provided.

- */ - enableDragDrop : false, - /** - * @cfg {Boolean} enableHdMenu Defaults to true to enable the drop down button for menu in the headers. - */ - enableHdMenu : true, - /** - * @cfg {Boolean} hideHeaders True to hide the grid's header. Defaults to false. - */ - /** - * @cfg {Object} loadMask An {@link Ext.LoadMask} config or true to mask the grid while - * loading. Defaults to false. - */ - loadMask : false, - /** - * @cfg {Number} maxHeight Sets the maximum height of the grid - ignored if autoHeight is not on. - */ - /** - * @cfg {Number} minColumnWidth The minimum width a column can be resized to. Defaults to 25. - */ - minColumnWidth : 25, - /** - * @cfg {Object} sm Shorthand for {@link #selModel}. - */ - /** - * @cfg {Object} selModel Any subclass of {@link Ext.grid.AbstractSelectionModel} that will provide - * the selection model for the grid (defaults to {@link Ext.grid.RowSelectionModel} if not specified). - */ - /** - * @cfg {Ext.data.Store} store The {@link Ext.data.Store} the grid should use as its data source (required). - */ - /** - * @cfg {Boolean} stripeRows true to stripe the rows. Default is false. - *

This causes the CSS class x-grid3-row-alt to be added to alternate rows of - * the grid. A default CSS rule is provided which sets a background colour, but you can override this - * with a rule which either overrides the background-color style using the '!important' - * modifier, or which uses a CSS selector of higher specificity.

- */ - stripeRows : false, - /** - * @cfg {Boolean} trackMouseOver True to highlight rows when the mouse is over. Default is true - * for GridPanel, but false for EditorGridPanel. - */ - trackMouseOver : true, - /** - * @cfg {Array} stateEvents - * An array of events that, when fired, should trigger this component to save its state. - * Defaults to:

-     * stateEvents: ['columnmove', 'columnresize', 'sortchange', 'groupchange']
-     * 
- *

These can be any types of events supported by this component, including browser or - * custom events (e.g., ['click', 'customerchange']).

- *

See {@link Ext.Component#stateful} for an explanation of saving and restoring - * Component state.

- */ - stateEvents : ['columnmove', 'columnresize', 'sortchange', 'groupchange'], - /** - * @cfg {Object} view The {@link Ext.grid.GridView} used by the grid. This can be set - * before a call to {@link Ext.Component#render render()}. - */ - view : null, - - /** - * @cfg {Array} bubbleEvents - *

An array of events that, when fired, should be bubbled to any parent container. - * See {@link Ext.util.Observable#enableBubble}. - * Defaults to []. - */ - bubbleEvents: [], - - /** - * @cfg {Object} viewConfig A config object that will be applied to the grid's UI view. Any of - * the config options available for {@link Ext.grid.GridView} can be specified here. This option - * is ignored if {@link #view} is specified. - */ - - // private - rendered : false, - // private - viewReady : false, - - // private - initComponent : function(){ - Ext.grid.GridPanel.superclass.initComponent.call(this); - - if(this.columnLines){ - this.cls = (this.cls || '') + ' x-grid-with-col-lines'; - } - // override any provided value since it isn't valid - // and is causing too many bug reports ;) - this.autoScroll = false; - this.autoWidth = false; - - if(Ext.isArray(this.columns)){ - this.colModel = new Ext.grid.ColumnModel(this.columns); - delete this.columns; - } - - // check and correct shorthanded configs - if(this.ds){ - this.store = this.ds; - delete this.ds; - } - if(this.cm){ - this.colModel = this.cm; - delete this.cm; - } - if(this.sm){ - this.selModel = this.sm; - delete this.sm; - } - this.store = Ext.StoreMgr.lookup(this.store); - - this.addEvents( - // raw events - /** - * @event click - * The raw click event for the entire grid. - * @param {Ext.EventObject} e - */ - 'click', - /** - * @event dblclick - * The raw dblclick event for the entire grid. - * @param {Ext.EventObject} e - */ - 'dblclick', - /** - * @event contextmenu - * The raw contextmenu event for the entire grid. - * @param {Ext.EventObject} e - */ - 'contextmenu', - /** - * @event mousedown - * The raw mousedown event for the entire grid. - * @param {Ext.EventObject} e - */ - 'mousedown', - /** - * @event mouseup - * The raw mouseup event for the entire grid. - * @param {Ext.EventObject} e - */ - 'mouseup', - /** - * @event mouseover - * The raw mouseover event for the entire grid. - * @param {Ext.EventObject} e - */ - 'mouseover', - /** - * @event mouseout - * The raw mouseout event for the entire grid. - * @param {Ext.EventObject} e - */ - 'mouseout', - /** - * @event keypress - * The raw keypress event for the entire grid. - * @param {Ext.EventObject} e - */ - 'keypress', - /** - * @event keydown - * The raw keydown event for the entire grid. - * @param {Ext.EventObject} e - */ - 'keydown', - - // custom events - /** - * @event cellmousedown - * Fires before a cell is clicked - * @param {Grid} this - * @param {Number} rowIndex - * @param {Number} columnIndex - * @param {Ext.EventObject} e - */ - 'cellmousedown', - /** - * @event rowmousedown - * Fires before a row is clicked - * @param {Grid} this - * @param {Number} rowIndex - * @param {Ext.EventObject} e - */ - 'rowmousedown', - /** - * @event headermousedown - * Fires before a header is clicked - * @param {Grid} this - * @param {Number} columnIndex - * @param {Ext.EventObject} e - */ - 'headermousedown', - - /** - * @event groupmousedown - * Fires before a group header is clicked. Only applies for grids with a {@link Ext.grid.GroupingView GroupingView}. - * @param {Grid} this - * @param {String} groupField - * @param {String} groupValue - * @param {Ext.EventObject} e - */ - 'groupmousedown', - - /** - * @event rowbodymousedown - * Fires before the row body is clicked. Only applies for grids with {@link Ext.grid.GridView#enableRowBody enableRowBody} configured. - * @param {Grid} this - * @param {Number} rowIndex - * @param {Ext.EventObject} e - */ - 'rowbodymousedown', - - /** - * @event containermousedown - * Fires before the container is clicked. The container consists of any part of the grid body that is not covered by a row. - * @param {Grid} this - * @param {Ext.EventObject} e - */ - 'containermousedown', - - /** - * @event cellclick - * Fires when a cell is clicked. - * The data for the cell is drawn from the {@link Ext.data.Record Record} - * for this row. To access the data in the listener function use the - * following technique: - *


-function(grid, rowIndex, columnIndex, e) {
-    var record = grid.getStore().getAt(rowIndex);  // Get the Record
-    var fieldName = grid.getColumnModel().getDataIndex(columnIndex); // Get field name
-    var data = record.get(fieldName);
-}
-
- * @param {Grid} this - * @param {Number} rowIndex - * @param {Number} columnIndex - * @param {Ext.EventObject} e - */ - 'cellclick', - /** - * @event celldblclick - * Fires when a cell is double clicked - * @param {Grid} this - * @param {Number} rowIndex - * @param {Number} columnIndex - * @param {Ext.EventObject} e - */ - 'celldblclick', - /** - * @event rowclick - * Fires when a row is clicked - * @param {Grid} this - * @param {Number} rowIndex - * @param {Ext.EventObject} e - */ - 'rowclick', - /** - * @event rowdblclick - * Fires when a row is double clicked - * @param {Grid} this - * @param {Number} rowIndex - * @param {Ext.EventObject} e - */ - 'rowdblclick', - /** - * @event headerclick - * Fires when a header is clicked - * @param {Grid} this - * @param {Number} columnIndex - * @param {Ext.EventObject} e - */ - 'headerclick', - /** - * @event headerdblclick - * Fires when a header cell is double clicked - * @param {Grid} this - * @param {Number} columnIndex - * @param {Ext.EventObject} e - */ - 'headerdblclick', - /** - * @event groupclick - * Fires when group header is clicked. Only applies for grids with a {@link Ext.grid.GroupingView GroupingView}. - * @param {Grid} this - * @param {String} groupField - * @param {String} groupValue - * @param {Ext.EventObject} e - */ - 'groupclick', - /** - * @event groupdblclick - * Fires when group header is double clicked. Only applies for grids with a {@link Ext.grid.GroupingView GroupingView}. - * @param {Grid} this - * @param {String} groupField - * @param {String} groupValue - * @param {Ext.EventObject} e - */ - 'groupdblclick', - /** - * @event containerclick - * Fires when the container is clicked. The container consists of any part of the grid body that is not covered by a row. - * @param {Grid} this - * @param {Ext.EventObject} e - */ - 'containerclick', - /** - * @event containerdblclick - * Fires when the container is double clicked. The container consists of any part of the grid body that is not covered by a row. - * @param {Grid} this - * @param {Ext.EventObject} e - */ - 'containerdblclick', - - /** - * @event rowbodyclick - * Fires when the row body is clicked. Only applies for grids with {@link Ext.grid.GridView#enableRowBody enableRowBody} configured. - * @param {Grid} this - * @param {Number} rowIndex - * @param {Ext.EventObject} e - */ - 'rowbodyclick', - /** - * @event rowbodydblclick - * Fires when the row body is double clicked. Only applies for grids with {@link Ext.grid.GridView#enableRowBody enableRowBody} configured. - * @param {Grid} this - * @param {Number} rowIndex - * @param {Ext.EventObject} e - */ - 'rowbodydblclick', - - /** - * @event rowcontextmenu - * Fires when a row is right clicked - * @param {Grid} this - * @param {Number} rowIndex - * @param {Ext.EventObject} e - */ - 'rowcontextmenu', - /** - * @event cellcontextmenu - * Fires when a cell is right clicked - * @param {Grid} this - * @param {Number} rowIndex - * @param {Number} cellIndex - * @param {Ext.EventObject} e - */ - 'cellcontextmenu', - /** - * @event headercontextmenu - * Fires when a header is right clicked - * @param {Grid} this - * @param {Number} columnIndex - * @param {Ext.EventObject} e - */ - 'headercontextmenu', - /** - * @event groupcontextmenu - * Fires when group header is right clicked. Only applies for grids with a {@link Ext.grid.GroupingView GroupingView}. - * @param {Grid} this - * @param {String} groupField - * @param {String} groupValue - * @param {Ext.EventObject} e - */ - 'groupcontextmenu', - /** - * @event containercontextmenu - * Fires when the container is right clicked. The container consists of any part of the grid body that is not covered by a row. - * @param {Grid} this - * @param {Ext.EventObject} e - */ - 'containercontextmenu', - /** - * @event rowbodycontextmenu - * Fires when the row body is right clicked. Only applies for grids with {@link Ext.grid.GridView#enableRowBody enableRowBody} configured. - * @param {Grid} this - * @param {Number} rowIndex - * @param {Ext.EventObject} e - */ - 'rowbodycontextmenu', - /** - * @event bodyscroll - * Fires when the body element is scrolled - * @param {Number} scrollLeft - * @param {Number} scrollTop - */ - 'bodyscroll', - /** - * @event columnresize - * Fires when the user resizes a column - * @param {Number} columnIndex - * @param {Number} newSize - */ - 'columnresize', - /** - * @event columnmove - * Fires when the user moves a column - * @param {Number} oldIndex - * @param {Number} newIndex - */ - 'columnmove', - /** - * @event sortchange - * Fires when the grid's store sort changes - * @param {Grid} this - * @param {Object} sortInfo An object with the keys field and direction - */ - 'sortchange', - /** - * @event groupchange - * Fires when the grid's grouping changes (only applies for grids with a {@link Ext.grid.GroupingView GroupingView}) - * @param {Grid} this - * @param {String} groupField A string with the grouping field, null if the store is not grouped. - */ - 'groupchange', - /** - * @event reconfigure - * Fires when the grid is reconfigured with a new store and/or column model. - * @param {Grid} this - * @param {Ext.data.Store} store The new store - * @param {Ext.grid.ColumnModel} colModel The new column model - */ - 'reconfigure', - /** - * @event viewready - * Fires when the grid view is available (use this for selecting a default row). - * @param {Grid} this - */ - 'viewready' - ); - }, - - // private - onRender : function(ct, position){ - Ext.grid.GridPanel.superclass.onRender.apply(this, arguments); - - var c = this.getGridEl(); - - this.el.addClass('x-grid-panel'); - - this.mon(c, { - scope: this, - mousedown: this.onMouseDown, - click: this.onClick, - dblclick: this.onDblClick, - contextmenu: this.onContextMenu - }); - - this.relayEvents(c, ['mousedown','mouseup','mouseover','mouseout','keypress', 'keydown']); - - var view = this.getView(); - view.init(this); - view.render(); - this.getSelectionModel().init(this); - }, - - // private - initEvents : function(){ - Ext.grid.GridPanel.superclass.initEvents.call(this); - - if(this.loadMask){ - this.loadMask = new Ext.LoadMask(this.bwrap, - Ext.apply({store:this.store}, this.loadMask)); - } - }, - - initStateEvents : function(){ - Ext.grid.GridPanel.superclass.initStateEvents.call(this); - this.mon(this.colModel, 'hiddenchange', this.saveState, this, {delay: 100}); - }, - - applyState : function(state){ - var cm = this.colModel, - cs = state.columns, - store = this.store, - s, - c, - oldIndex; - - if(cs){ - for(var i = 0, len = cs.length; i < len; i++){ - s = cs[i]; - c = cm.getColumnById(s.id); - if(c){ - c.hidden = s.hidden; - c.width = s.width; - oldIndex = cm.getIndexById(s.id); - if(oldIndex != i){ - cm.moveColumn(oldIndex, i); - } - } - } - } - if(store){ - s = state.sort; - if(s){ - store[store.remoteSort ? 'setDefaultSort' : 'sort'](s.field, s.direction); - } - s = state.group; - if(store.groupBy){ - if(s){ - store.groupBy(s); - }else{ - store.clearGrouping(); - } - } - - } - var o = Ext.apply({}, state); - delete o.columns; - delete o.sort; - Ext.grid.GridPanel.superclass.applyState.call(this, o); - }, - - getState : function(){ - var o = {columns: []}, - store = this.store, - ss, - gs; - - for(var i = 0, c; (c = this.colModel.config[i]); i++){ - o.columns[i] = { - id: c.id, - width: c.width - }; - if(c.hidden){ - o.columns[i].hidden = true; - } - } - if(store){ - ss = store.getSortState(); - if(ss){ - o.sort = ss; - } - if(store.getGroupState){ - gs = store.getGroupState(); - if(gs){ - o.group = gs; - } - } - } - return o; - }, - - // private - afterRender : function(){ - Ext.grid.GridPanel.superclass.afterRender.call(this); - var v = this.view; - this.on('bodyresize', v.layout, v); - v.layout(); - if(this.deferRowRender){ - if (!this.deferRowRenderTask){ - this.deferRowRenderTask = new Ext.util.DelayedTask(v.afterRender, this.view); - } - this.deferRowRenderTask.delay(10); - }else{ - v.afterRender(); - } - this.viewReady = true; - }, - - /** - *

Reconfigures the grid to use a different Store and Column Model - * and fires the 'reconfigure' event. The View will be bound to the new - * objects and refreshed.

- *

Be aware that upon reconfiguring a GridPanel, certain existing settings may become - * invalidated. For example the configured {@link #autoExpandColumn} may no longer exist in the - * new ColumnModel. Also, an existing {@link Ext.PagingToolbar PagingToolbar} will still be bound - * to the old Store, and will need rebinding. Any {@link #plugins} might also need reconfiguring - * with the new data.

- * @param {Ext.data.Store} store The new {@link Ext.data.Store} object - * @param {Ext.grid.ColumnModel} colModel The new {@link Ext.grid.ColumnModel} object - */ - reconfigure : function(store, colModel){ - var rendered = this.rendered; - if(rendered){ - if(this.loadMask){ - this.loadMask.destroy(); - this.loadMask = new Ext.LoadMask(this.bwrap, - Ext.apply({}, {store:store}, this.initialConfig.loadMask)); - } - } - if(this.view){ - this.view.initData(store, colModel); - } - this.store = store; - this.colModel = colModel; - if(rendered){ - this.view.refresh(true); - } - this.fireEvent('reconfigure', this, store, colModel); - }, - - // private - onDestroy : function(){ - if (this.deferRowRenderTask && this.deferRowRenderTask.cancel){ - this.deferRowRenderTask.cancel(); - } - if(this.rendered){ - Ext.destroy(this.view, this.loadMask); - }else if(this.store && this.store.autoDestroy){ - this.store.destroy(); - } - Ext.destroy(this.colModel, this.selModel); - this.store = this.selModel = this.colModel = this.view = this.loadMask = null; - Ext.grid.GridPanel.superclass.onDestroy.call(this); - }, - - // private - processEvent : function(name, e){ - this.view.processEvent(name, e); - }, - - // private - onClick : function(e){ - this.processEvent('click', e); - }, - - // private - onMouseDown : function(e){ - this.processEvent('mousedown', e); - }, - - // private - onContextMenu : function(e, t){ - this.processEvent('contextmenu', e); - }, - - // private - onDblClick : function(e){ - this.processEvent('dblclick', e); - }, - - // private - walkCells : function(row, col, step, fn, scope){ - var cm = this.colModel, - clen = cm.getColumnCount(), - ds = this.store, - rlen = ds.getCount(), - first = true; - - if(step < 0){ - if(col < 0){ - row--; - first = false; - } - while(row >= 0){ - if(!first){ - col = clen-1; - } - first = false; - while(col >= 0){ - if(fn.call(scope || this, row, col, cm) === true){ - return [row, col]; - } - col--; - } - row--; - } - } else { - if(col >= clen){ - row++; - first = false; - } - while(row < rlen){ - if(!first){ - col = 0; - } - first = false; - while(col < clen){ - if(fn.call(scope || this, row, col, cm) === true){ - return [row, col]; - } - col++; - } - row++; - } - } - return null; - }, - - /** - * Returns the grid's underlying element. - * @return {Element} The element - */ - getGridEl : function(){ - return this.body; - }, - - // private for compatibility, overridden by editor grid - stopEditing : Ext.emptyFn, - - /** - * Returns the grid's selection model configured by the {@link #selModel} - * configuration option. If no selection model was configured, this will create - * and return a {@link Ext.grid.RowSelectionModel RowSelectionModel}. - * @return {SelectionModel} - */ - getSelectionModel : function(){ - if(!this.selModel){ - this.selModel = new Ext.grid.RowSelectionModel( - this.disableSelection ? {selectRow: Ext.emptyFn} : null); - } - return this.selModel; - }, - - /** - * Returns the grid's data store. - * @return {Ext.data.Store} The store - */ - getStore : function(){ - return this.store; - }, - - /** - * Returns the grid's ColumnModel. - * @return {Ext.grid.ColumnModel} The column model - */ - getColumnModel : function(){ - return this.colModel; - }, - - /** - * Returns the grid's GridView object. - * @return {Ext.grid.GridView} The grid view - */ - getView : function(){ - if(!this.view){ - this.view = new Ext.grid.GridView(this.viewConfig); - } - return this.view; - }, - /** - * Called to get grid's drag proxy text, by default returns this.ddText. - * @return {String} The text - */ - getDragDropText : function(){ - var count = this.selModel.getCount(); - return String.format(this.ddText, count, count == 1 ? '' : 's'); - } - - /** - * @cfg {String/Number} activeItem - * @hide - */ - /** - * @cfg {Boolean} autoDestroy - * @hide - */ - /** - * @cfg {Object/String/Function} autoLoad - * @hide - */ - /** - * @cfg {Boolean} autoWidth - * @hide - */ - /** - * @cfg {Boolean/Number} bufferResize - * @hide - */ - /** - * @cfg {String} defaultType - * @hide - */ - /** - * @cfg {Object} defaults - * @hide - */ - /** - * @cfg {Boolean} hideBorders - * @hide - */ - /** - * @cfg {Mixed} items - * @hide - */ - /** - * @cfg {String} layout - * @hide - */ - /** - * @cfg {Object} layoutConfig - * @hide - */ - /** - * @cfg {Boolean} monitorResize - * @hide - */ - /** - * @property items - * @hide - */ - /** - * @method add - * @hide - */ - /** - * @method cascade - * @hide - */ - /** - * @method doLayout - * @hide - */ - /** - * @method find - * @hide - */ - /** - * @method findBy - * @hide - */ - /** - * @method findById - * @hide - */ - /** - * @method findByType - * @hide - */ - /** - * @method getComponent - * @hide - */ - /** - * @method getLayout - * @hide - */ - /** - * @method getUpdater - * @hide - */ - /** - * @method insert - * @hide - */ - /** - * @method load - * @hide - */ - /** - * @method remove - * @hide - */ - /** - * @event add - * @hide - */ - /** - * @event afterlayout - * @hide - */ - /** - * @event beforeadd - * @hide - */ - /** - * @event beforeremove - * @hide - */ - /** - * @event remove - * @hide - */ - - - - /** - * @cfg {String} allowDomMove @hide - */ - /** - * @cfg {String} autoEl @hide - */ - /** - * @cfg {String} applyTo @hide - */ - /** - * @cfg {String} autoScroll @hide - */ - /** - * @cfg {String} bodyBorder @hide - */ - /** - * @cfg {String} bodyStyle @hide - */ - /** - * @cfg {String} contentEl @hide - */ - /** - * @cfg {String} disabledClass @hide - */ - /** - * @cfg {String} elements @hide - */ - /** - * @cfg {String} html @hide - */ - /** - * @cfg {Boolean} preventBodyReset - * @hide - */ - /** - * @property disabled - * @hide - */ - /** - * @method applyToMarkup - * @hide - */ - /** - * @method enable - * @hide - */ - /** - * @method disable - * @hide - */ - /** - * @method setDisabled - * @hide - */ -}); -Ext.reg('grid', Ext.grid.GridPanel); \ No newline at end of file diff --git a/workflow/engine/templates/bpmn/Lane.js b/workflow/engine/templates/bpmn/Lane.js deleted file mode 100755 index bd1b12a80..000000000 --- a/workflow/engine/templates/bpmn/Lane.js +++ /dev/null @@ -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 -} diff --git a/workflow/engine/templates/bpmn/LoopingSubProcess.js b/workflow/engine/templates/bpmn/LoopingSubProcess.js deleted file mode 100755 index af7cae056..000000000 --- a/workflow/engine/templates/bpmn/LoopingSubProcess.js +++ /dev/null @@ -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 - * The string is first cleared and new string is painted.

-**/ -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); -}; \ No newline at end of file diff --git a/workflow/engine/templates/bpmn/LoopingTask.js b/workflow/engine/templates/bpmn/LoopingTask.js deleted file mode 100755 index b7271081c..000000000 --- a/workflow/engine/templates/bpmn/LoopingTask.js +++ /dev/null @@ -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 1300 - oShape.width) { - workflow.main.setWidth(oShape.x+150); - } - //Top Border - if (oShape.y < 20) { - oShape.y = 20; - } - //Bottom Border - if (oShape.y > 1000 - oShape.height) { - workflow.main.setHeight(oShape.y+75); - } -} - -/** - * ExtJS Form on Right Click of Task - * @Param Shape Object - * @Author Safan Maredia - */ -MyWorkflow.prototype.AddTaskContextMenu= function(oShape) -{ - var taskExtObj = new TaskContext(); - if (oShape.id != null) { - this.canvasTask = Ext.get(oShape.id); - this.contextTaskmenu = new Ext.menu.Menu({ - items: [ -/* - { - text: 'Steps', - iconCls: 'button_menu_ext ss_sprite ss_shape_move_forwards', - handler: taskExtObj.editTaskSteps, - scope: oShape - }, - { - text: 'Users & Users Group', - iconCls: 'button_menu_ext ss_sprite ss_group', - handler: taskExtObj.editUsers, - scope: oShape - }, - { - text: 'Users & Users Groups (ad-hoc)', - iconCls: 'button_menu_ext ss_sprite ss_group', - handler: taskExtObj.editUsersAdHoc, - scope: oShape - }, -*/ - { - text: 'Transform To', - iconCls: 'button_menu_ext ss_sprite ss_page_refresh', - menu: { // <-- submenu by nested config object - items: [ - // stick any markup in a menu - { - text: 'Sub Process', - iconCls: 'button_menu_ext ss_sprite ss_layout_link', - type:'bpmnSubProcess', - scope:oShape, - handler: MyWorkflow.prototype.toggleShapes - } - ] - }, - scope: this - }, - { - text: 'Attach Event', - iconCls: 'button_menu_ext ss_sprite ss_link', - menu: { // <-- submenu by nested config object - items: [ - // stick any markup in a menu - { - text: 'Timer Boundary Event', - iconCls: 'button_menu_ext ss_sprite ss_clock', - type:'bpmnEventBoundaryTimerInter', - scope:oShape, - handler: MyWorkflow.prototype.toggleShapes - } - ] - }, - scope: this - } -/* , - { - text: 'Properties', - handler: taskExtObj.editTaskProperties, - scope: oShape - } -*/ - ] - }); - } - - this.canvasTask.on('contextmenu', function (e) { - e.stopEvent(); - this.contextTaskmenu.showAt(e.getXY()); - }, this); - -} - -/** - * ExtJS Menu on Right Click of Connection - * @Param Shape Object - * @Author Girish Joshi - */ -MyWorkflow.prototype.connectionContextMenu=function(oShape) -{ - this.canvasEvent = Ext.get(oShape.id); - this.contextEventmenu = new Ext.menu.Menu({ - items: [{ - text: 'Straight Line', - iconCls: 'button_menu_ext ss_sprite ss_bullet_white ', - scope: this, - handler: MyWorkflow.prototype.toggleConnection - }, { - text: 'Curvy Line', - scope: this, - iconCls: 'button_menu_ext ss_sprite ss_vector', - handler: MyWorkflow.prototype.toggleConnection - }, { - text: 'Angled Line', - scope: this, - iconCls: 'button_menu_ext ss_sprite ss_bullet_white ', - handler: MyWorkflow.prototype.toggleConnection - }, { - text: 'Delete Line', - iconCls: 'button_menu_ext ss_sprite ss_delete', - scope: this, - handler:function() - { - MyWorkflow.prototype.deleteRoute(oShape.workflow.currentSelection,0) - } - }] - }); - - this.canvasEvent.on('contextmenu', function(e) { - e.stopEvent(); - this.contextEventmenu.showAt(e.getXY()); - }, this); -} - -/** - * Draw2d Functionality of Changing the routers - * @Param Shape Object - * @Author Girish Joshi - */ -MyWorkflow.prototype.toggleConnection=function(oShape) -{ - this.currentSelection.workflow.contextClicked = false; - switch (oShape.text) { - case 'NULL Router': - this.currentSelection.setRouter(null); - break; - case 'Angled Line': - this.currentSelection.setRouter(new ManhattanConnectionRouter()); - break; - case 'Curvy Line': - this.currentSelection.setRouter(new BezierConnectionRouter()); - break; - case 'Straight Line': - this.currentSelection.setRouter(new FanConnectionRouter()); - break; - case 'Delete Line': - this.currentSelection.workflow.getCommandStack().execute(new CommandDelete(this.currentSelection.workflow.getCurrentSelection())); - ToolGeneric.prototype.execute.call(this); - break; - } -} - -/** - * Draw2d Functionality of Adding Port to Gateways - * @Param Shape Object - * @Author Girish Joshi - */ -MyWorkflow.prototype.AddGatewayPorts = function(_40c5) -{ - var TaskPortName = ['inputPort1','inputPort2','outputPort1','outputPort2','outputPort3']; - var TaskPortType = ['InputPort','InputPort','OutputPort','OutputPort','OutputPort']; - var TaskPositionX= [0,_40c5.width/2,_40c5.width,_40c5.width/2, 0]; - var TaskPositionY= [_40c5.height/2,0,_40c5.height/2,_40c5.Height, _40c5.height/2 + 10]; - - for(var i=0; i< TaskPortName.length ; i++){ - eval('_40c5.'+TaskPortName[i]+' = new '+TaskPortType[i]+'()'); //Create New Port - eval('_40c5.'+TaskPortName[i]+'.setWorkflow(_40c5)'); //Add port to the workflow - eval('_40c5.'+TaskPortName[i]+'.setName("'+TaskPortName[i]+'")'); //Set PortName - eval('_40c5.'+TaskPortName[i]+'.setZOrder(-1)'); //Set Z-Order of the port to -1. It will be below all the figure - eval('_40c5.'+TaskPortName[i]+'.setBackgroundColor(new Color(255, 255, 255))'); //Setting Background of the port to white - eval('_40c5.'+TaskPortName[i]+'.setColor(new Color(255, 255, 255))'); //Setting Border of the port to white - this.workflow = _40c5.workflow; - this.workflow.currentSelection =_40c5; - eval('_40c5.addPort(_40c5.'+TaskPortName[i]+','+TaskPositionX[i]+', '+TaskPositionY[i]+')'); //Setting Position of the port - } -} -/** - * ExtJs Form on right Click of Gateways - * @Param Shape Object - * @Author Girish Joshi - */ -MyWorkflow.prototype.AddGatewayContextMenu=function(_4092) -{ - this.canvasGateway = Ext.get(_4092.id); - this.contextGatewaymenu = new Ext.menu.Menu({ - items: [{ - text: 'Gateway Type', - menu: { // <-- submenu by nested config object - items: [ - // stick any markup in a menu - { - text: 'Exclusive Gateway', - type:'bpmnGatewayExclusiveData', - scope:_4092, - handler: MyWorkflow.prototype.toggleShapes - }, { - text: 'Inclusive Gateway', - type:'bpmnGatewayInclusive', - scope:_4092, - handler: MyWorkflow.prototype.toggleShapes - }, { - text: 'Parallel Gateway', - type:'bpmnGatewayParallel', - scope:_4092, - handler: MyWorkflow.prototype.toggleShapes - } -/* , { - text: 'Complex Gateway', - type:'bpmnGatewayComplex', - scope:_4092, - handler: MyWorkflow.prototype.toggleShapes - }, { - text: 'Event Based Gateway', - type:'bpmnGatewayExclusiveEvent', - scope:_4092, - handler: MyWorkflow.prototype.toggleShapes - } -*/ - ] - }, - scope: this - },{ - text: 'Properties', - handler: this.editGatewayProperties, - scope: this - }] - }); - -this.canvasGateway.on('contextmenu', function(e) { - e.stopEvent(); - this.contextGatewaymenu.showAt(e.getXY()); -}, this); -} - -/** - * ExtJs Menu on right Click of SubProcess - * @Param Shape Object - * @Author Safan Maredia - */ -MyWorkflow.prototype.AddSubProcessContextMenu=function(_4092) -{ - var taskExtObj = new TaskContext(); - this.canvasSubProcess = Ext.get(_4092.id); - this.contextSubProcessmenu = new Ext.menu.Menu({ - items: [ - { - text: 'Transform To', - menu: { // <-- submenu by nested config object - items: [ - // stick any markup in a menu - { - text: 'Task', - type:'bpmnTask', - scope:_4092, - handler: MyWorkflow.prototype.toggleShapes - } - ] - }, - scope: this - }, - { - text: 'Properties', - handler: taskExtObj.editSubProcessProperties, - scope: this - }] - }); - -this.canvasSubProcess.on('contextmenu', function(e) { - e.stopEvent(); - this.contextSubProcessmenu.showAt(e.getXY()); -}, this); -} - - -//Window pop up function when user clicks on Gateways properties - -MyWorkflow.prototype.editGatewayProperties= function() -{ - -} -/** - * Changing the Shape and Maintaining the Connections - * @Param Shape Object - * @Author Girish Joshi - */ -MyWorkflow.prototype.toggleShapes=function(item) -{ - - //Set the context Clicked Flag to false because context click action is performed - if(item.scope.workflow != null){ - item.scope.workflow.contextClicked = false; - if(item.scope.workflow.currentSelection != null){ - - //Get all the ports of the shapes - var ports = item.scope.workflow.currentSelection.getPorts(); - var len =ports.data.length; - - //Get all the connection of the shape - var conn = new Array(); - for(var i=0; i<=len; i++){ - if(typeof ports.data[i] === 'object') - conn[i] = ports.data[i].getConnections(); - } - - //Initializing Arrays and variables - var connLength = conn.length; - var sourceNode = new Array(); - var targetNode = new Array(); - var countConn = 0; - var sourcePortName = new Array(); - var targetPortName = new Array(); - var sourcePortId = new Array(); - var targetPortId = new Array(); - - //Get the pre-selected id into new variable to compare in future code - var shapeId = this.workflow.currentSelection.id; - - //Get the current pre-selected figure object in the new object, because not accessible after adding new shapes - var oldWorkflow = this.workflow.currentSelection; - - //Get the source and Target object of all the connections in an array - for(i = 0; i< connLength ; i++) - { - for(var j = 0; j < conn[i].data.length ; j++) - { - if(typeof conn[i].data[j] != 'undefined') { - sourceNode[countConn] = conn[i].data[j].sourcePort.parentNode; - targetNode[countConn] = conn[i].data[j].targetPort.parentNode; - sourcePortName[countConn] = conn[i].data[j].sourcePort.properties.name; - targetPortName[countConn] = conn[i].data[j].targetPort.properties.name; - sourcePortId[countConn] = conn[i].data[j].sourcePort.parentNode.id; - targetPortId[countConn] = conn[i].data[j].targetPort.parentNode.id; - countConn++; - } - } - } - - //Add new selected Figure - var x =item.scope.workflow.currentSelection.getX(); //Get x co-ordinate from figure - var y =item.scope.workflow.currentSelection.getY(); //Get y co-ordinate from figure - - if(item.type == 'bpmnEventBoundaryTimerInter') { - workflow.currentSelection.boundaryEvent = true; - workflow.taskName = oldWorkflow.taskName; - var newShape = workflow.currentSelection; - newShape.setDimension(newShape.getWidth(),newShape.getHeight()); - } - else if(item.type == 'bpmnSubProcess') { - workflow.subProcessName = 'Sub Process'; - newShape = eval("new "+item.type+"(this.workflow)"); - } - else - newShape = eval("new "+item.type+"(this.workflow)"); - - if(item.type != 'bpmnEventBoundaryTimerInter') { - this.workflow.addFigure(newShape,x,y); //Add New Selected Shape First - //Delete Old Shape - item.scope.workflow.getCommandStack().execute(new CommandDelete(oldWorkflow)); - ToolGeneric.prototype.execute.call(item.scope); - //to create all the new connections again - var connObj; - for(i=0 ; i < countConn ; i++){ - if(sourcePortId[i] == shapeId) //If shapeId is equal to sourceId the , replace the oldShape object by new shape Object - sourceNode[i] = newShape; - else - targetNode[i] = newShape; - connObj = new DecoratedConnection(); - connObj.setTarget(eval('targetNode[i].getPort(targetPortName[i])')); - connObj.setSource(eval('sourceNode[i].getPort(sourcePortName[i])')); - newShape.workflow.addFigure(connObj); - } - } - //Saving Asynchronously deleted shape and new created shape into DB - if(item.type.match(/Boundary/)) { - newShape.actiontype = 'updateTask'; - workflow.saveShape(newShape); - } - if(newShape.type.match(/Event/) && !item.type.match(/Boundary/)) { - newShape.mode = 'ddEvent'; - newShape.actiontype = 'addEvent'; - //Set the Old Id to the Newly created Event - newShape.html.id = oldWorkflow.id; - newShape.id = oldWorkflow.id; - newShape.workflow.saveShape(newShape); - } - if(newShape.type.match(/Gateway/)) { - newShape.mode = 'ddGateway'; - newShape.actiontype = 'addGateway'; - //Set the Old Id to the Newly created Gateway - newShape.html.id = oldWorkflow.id; - newShape.id = oldWorkflow.id; - newShape.workflow.saveShape(newShape); - } - //Swapping from Task to subprocess and vice -versa - if((newShape.type == 'bpmnSubProcess' || newShape.type == 'bpmnTask') && !item.type.match(/Boundary/)) { - newShape.actiontype = 'addSubProcess'; - if(newShape.type == 'bpmnTask') - newShape.actiontype = 'addTask'; - newShape.workflow.saveShape(newShape); - } - if((this.type == 'bpmnTask' || this.type == 'bpmnSubProcess') && !item.type.match(/Boundary/)) { - this.actiontype = 'deleteTask'; - this.noAlert = true; - if(this.type == 'bpmnSubProcess') - this.actiontype = 'deleteSubProcess'; - newShape.workflow.deleteSilently(this); - } - } - } -} - -/** - * Toggling Between Task and SubProcess - * @Param Shape Object - * @Author Safan Maredia - */ -MyWorkflow.prototype.swapTaskSubprocess=function(itemObj) -{ - if(itemObj.type == 'bpmnSubProcess') - { - workflow.subProcessName = 'Sub Process'; - var newShape = eval("new "+itemObj.type+"(this.workflow)"); - } - else - newShape = eval("new "+itemObj.type+"(this.workflow)"); - - //Swapping from Task to subprocess and vice -versa - if((newShape.type == 'bpmnSubProcess' || newShape.type == 'bpmnTask') && !itemObj.type.match(/Boundary/)) { - newShape.actiontype = 'addSubProcess'; - if(newShape.type == 'bpmnTask') - newShape.actiontype = 'addTask'; - newShape.workflow.saveShape(newShape); - } - if((this.type == 'bpmnTask' || this.type == 'bpmnSubProcess') && !itemObj.type.match(/Boundary/)) { - this.actiontype = 'deleteTask'; - this.noAlert = true; - if(this.type == 'bpmnSubProcess') - this.actiontype = 'deleteSubProcess'; - newShape.workflow.deleteShape(this); - } -} - -/** - * Validating Connection on Input/Output onDrop Event - * @Param port - * @Param portType - * @Param portTypeName - * @Author Girish Joshi - */ -MyWorkflow.prototype.checkConnectionsExist=function(port,portType,portTypeName) -{ - //Get all the ports of the shapes - var ports = port.workflow.currentSelection.getPorts(); - var len =ports.data.length; - - //Get all the connection of the shape - var conn = new Array(); - for(var i=0; i<=len; i++){ - if(typeof ports.data[i] === 'object') - if(ports.data[i].type == portTypeName) - conn[i] = ports.data[i].getConnections(); - } - //Initializing Arrays and variables - var countConn = 0; - var portParentId= new Array(); - var portName = new Array(); - - //Get ALL the connections for the specified PORT - for(i = 0; i< conn.length ; i++) - { - if(typeof conn[i] != 'undefined') - for(var j = 0; j < conn[i].data.length ; j++) - { - if(typeof conn[i].data[j] != 'undefined') { - portParentId[countConn] = eval('conn[i].data[j].'+portType+'.parentNode.id'); - portName[countConn] = eval('conn[i].data[j].'+portType+'.properties.name'); - countConn++; - } - } - } - var conx = 0; - var parentid; - for(i=0 ; i < countConn ; i++) - { - if(portParentId[i] == port.parentNode.id) - conx++; - } - return conx; - -} -/** - * ExtJs Menu on right Click of Start Event - * @Param Shape Object - * @Author Girish Joshi - */ -MyWorkflow.prototype.AddEventStartContextMenu=function(oShape) -{ - this.canvasEvent = Ext.get(oShape.id); - this.contextEventmenu = new Ext.menu.Menu({ - items: [{ - text: 'Event Type', - menu: { // <-- submenu by nested config object - items: [ - // stick any markup in a menu - { - text: 'Empty', - type:'bpmnEventEmptyStart', - scope:oShape, - handler: MyWorkflow.prototype.toggleShapes - }, - { - text: 'Message', - type:'bpmnEventMessageStart', - scope:oShape, - handler: MyWorkflow.prototype.toggleShapes - }, { - text: 'Timer', - type:'bpmnEventTimerStart', - scope:oShape, - handler: MyWorkflow.prototype.toggleShapes - }/*, { - text: 'Conditional', - type:'bpmnEventRuleStart', - scope:oShape, - handler: MyWorkflow.prototype.toggleShapes - }/*, { - text: 'Signal', - type:'bpmnEventSignalStart', - scope:oShape, - handler: MyWorkflow.prototype.toggleShapes - }, { - text: 'Multiple', - type:'bpmnEventMulStart', - scope:oShape, - handler: MyWorkflow.prototype.toggleShapes - }*/ - ] - }, - scope: this - },{ - text: 'Properties', - scope: this, - handler: MyWorkflow.prototype.editEventProperties - }] - }); - -this.canvasEvent.on('contextmenu', function(e) { - e.stopEvent(); - this.contextEventmenu.showAt(e.getXY()); -}, this); -} -/** - * ExtJs Menu on right Click of Intermediate Event - * @Param Shape Object - * @Author Girish Joshi - */ -MyWorkflow.prototype.AddEventInterContextMenu=function(_4093) -{ - this.canvasEvent = Ext.get(_4093.id); - this.contextEventmenu = new Ext.menu.Menu({ - items: [{ - text: 'Event Type', - menu: { // <-- submenu by nested config object - items: [ - // stick any markup in a menu - /*{ - text: 'Empty', - type:'bpmnEventEmptyInter', - scope:_4093, - handler: MyWorkflow.prototype.toggleShapes - },*/ - { - text: 'Message : Throw', - type:'bpmnEventMessageSendInter', - scope:_4093, - handler: MyWorkflow.prototype.toggleShapes - }, - { - text: 'Timer', - type:'bpmnEventTimerInter', - scope:_4093, - handler: MyWorkflow.prototype.toggleShapes - } - /* - { - text: 'Intermediate Boundary Timer', - type:'bpmnEventBoundaryInter', - scope:_4093, - handler: MyWorkflow.prototype.toggleShapes - },{ - text: 'Message : Catch', - type:'bpmnEventMessageRecInter', - scope:_4093, - handler: MyWorkflow.prototype.toggleShapes - }, { - text: 'Compensate', - type:'bpmnEventCompInter', - scope:_4093, - handler: MyWorkflow.prototype.toggleShapes - }, { - text: 'Conditional', - type:'bpmnEventRuleInter', - scope:_4093, - handler: MyWorkflow.prototype.toggleShapes - }, { - text: 'Link', - type:'bpmnEventLinkInter', - scope:_4093, - handler: MyWorkflow.prototype.toggleShapes - }, { - text: 'Signal', - type:'bpmnEventInterSignal', - scope:_4093, - handler: MyWorkflow.prototype.toggleShapes - }, { - text: 'Multiple', - type:'bpmnEventMultipleInter', - scope:_4093, - handler: MyWorkflow.prototype.toggleShapes - }*/ - ] - }, - scope: this - },{ - text: 'Properties', - handler: MyWorkflow.prototype.editEventProperties, - scope: this - }] - }); - -this.canvasEvent.on('contextmenu', function(e) { - e.stopEvent(); - this.contextEventmenu.showAt(e.getXY()); -}, this); -} -/** - * ExtJs Menu on right Click of End Event - * @Param Shape Object - * @Author Girish Joshi - */ -MyWorkflow.prototype.AddEventEndContextMenu=function(_4093) -{ - this.canvasEvent = Ext.get(_4093.id); - this.contextEventmenu = new Ext.menu.Menu({ - items: [{ - text: 'Event Type', - menu: { // <-- submenu by nested config object - items: [ - // stick any markup in a menu - { - text: 'Empty', - type:'bpmnEventEmptyEnd', - scope:_4093, - handler: MyWorkflow.prototype.toggleShapes - }, - { - text: 'Message', - type:'bpmnEventMessageEnd', - scope:_4093, - handler: MyWorkflow.prototype.toggleShapes - }/*, - { - text: 'Error', - type:'bpmnEventErrorEnd', - scope:_4093, - handler: MyWorkflow.prototype.toggleShapes - }, { - text: 'Cancel', - type:'bpmnEventCancelEnd', - scope:_4093, - handler: MyWorkflow.prototype.toggleShapes - }, { - text: 'Compensate', - type:'bpmnEventCompEnd', - scope:_4093, - handler: MyWorkflow.prototype.toggleShapes - }, { - text: 'Signal', - type:'bpmnEventEndSignal', - scope:_4093, - handler: MyWorkflow.prototype.toggleShapes - }, { - text: 'Multiple', - type:'bpmnEventMultipleEnd', - scope:_4093, - handler: MyWorkflow.prototype.toggleShapes - }, { - text: 'Terminate', - type:'bpmnEventTerminate', - scope:_4093, - handler: MyWorkflow.prototype.toggleShapes - }*/ - ] - }, - scope: this - },{ - text: 'Properties', - handler: MyWorkflow.prototype.editEventProperties, - scope: this - }] - }); - -this.canvasEvent.on('contextmenu', function(e) { - e.stopEvent(); - this.contextEventmenu.showAt(e.getXY()); -}, this); -} - -/** - * Hiding Ports according to the Shape Selected - * @Param Shape Object - * @Author Girish Joshi - */ -MyWorkflow.prototype.disablePorts=function(oShape) -{ - if(oShape.type != ''){ - var ports =''; - if(oShape.type.match(/Gateway/)) { - ports = ['output1','input1','output2','input2', 'output3' ]; - } - else if(oShape.type.match(/Task/) || oShape.type.match(/Gateway/) || oShape.type.match(/Inter/) || oShape.type.match(/SubProcess/)) { - ports = ['output1','input1','output2','input2' ]; - } - else if(oShape.type.match(/End/)) { - ports = ['input1','input2']; - } - else if(oShape.type.match(/Start/)) { - ports = ['output1','output2']; - } - else if(oShape.type.match(/Annotation/)) { - ports = ['input1']; - } - for(var i=0; i< ports.length ; i++) { - eval('oShape.'+ports[i]+'.setZOrder(-1)'); - eval('oShape.'+ports[i]+'.setBackgroundColor(new Color(255, 255, 255))'); - eval('oShape.'+ports[i]+'.setColor(new Color(255, 255, 255))'); - } - } -} -/** - * Show Ports according to the Shape Selected - * @Param Shape Object - * @Param aPort Array - * @Author Girish Joshi - */ -MyWorkflow.prototype.enablePorts=function(oShape,aPort) -{ - /*Setting Background ,border and Z-order of the flow menu back to original when clicked - *on the shape - **/ - for(var i=0; i< aPort.length ; i++) - { - if(aPort[i].match(/input/)) { - eval('oShape.workflow.currentSelection.'+aPort[i]+'.setBackgroundColor(new Color(245, 115, 115))'); - eval('oShape.workflow.currentSelection.'+aPort[i]+'.setZOrder(49000)'); - } - else { - eval('oShape.workflow.currentSelection.'+aPort[i]+'.setBackgroundColor(new Color(115, 115, 245))'); - eval('oShape.workflow.currentSelection.'+aPort[i]+'.setZOrder(50000)'); - } - eval('oShape.workflow.currentSelection.'+aPort[i]+'.setColor(new Color(90, 150, 90))'); - } -} - -/** - * Hide Flow menu according to the Shape Selected - * @Param Shape Object - * @Param aPort Array - * @Author Girish Joshi - */ -MyWorkflow.prototype.disableFlowMenu =function(oShape,aPort) -{ - /*Setting Background ,border and Z-order of the flow menu back to original when clicked - *on the shape - */ - for(var i=0; i< aPort.length ; i++) - { - if(aPort[i].match(/input/)) - eval('oShape.workflow.currentSelection.'+aPort[i]+'.setBackgroundColor(new Color(245, 115, 115))'); - else - eval('oShape.workflow.currentSelection.'+aPort[i]+'.setBackgroundColor(new Color(115, 115, 245))'); - eval('oShape.workflow.currentSelection.'+aPort[i]+'.setColor(new Color(90, 150, 90))'); - eval('oShape.workflow.currentSelection.'+aPort[i]+'.setZOrder(50000)'); - } -} - -/** - * This function is called on Right Click of All Shapes - * and menu is shown according to the shape selected - * @Param Shape Object - * @Author Girish Joshi - */ -MyWorkflow.prototype.handleContextMenu=function(oShape) -{ - workflow.hideResizeHandles(); - //Enable the contextClicked Flag - workflow.contextClicked = true; - - //Set the current Selection to the selected Figure - workflow.setCurrentSelection(oShape); - - //Disable Resize of all the figures - //oShape.workflow.hideResizeHandles(); -// oShape.setSelectable(false); -// oShape.setResizeable(false); - //Handle the Right click menu - var pmosExtObj = new pmosExt(); - //Load all the process Data - pmosExtObj.loadProcess(oShape); - - //Load Dynaform List - // pmosExtObj.loadDynaforms(oShape); - - if(oShape.type != ''){ - if(oShape.type.match(/Task/)) { - oShape.workflow.taskid = new Array(); - oShape.workflow.taskid.value = oShape.id; - pmosExtObj.loadTask(oShape); - oShape.workflow.AddTaskContextMenu(oShape); - } - else if(oShape.type.match(/Start/)) { - oShape.workflow.taskUid = workflow.getStartEventConn(oShape,'targetPort','OutputPort'); - pmosExtObj.loadDynaforms(oShape); - oShape.workflow.AddEventStartContextMenu(oShape); - } - else if(oShape.type.match(/Inter/)) { - oShape.workflow.taskUidFrom = workflow.getStartEventConn(oShape,'sourcePort','InputPort'); - //oShape.workflow.taskid = oShape.workflow.taskUid[0]; - oShape.workflow.taskUidTo = workflow.getStartEventConn(oShape,'targetPort','OutputPort'); - oShape.workflow.taskid = oShape.workflow.taskUidFrom[0]; - pmosExtObj.loadTask(oShape); - pmosExtObj.getTriggerList(oShape); - oShape.workflow.AddEventInterContextMenu(oShape); - } - else if(oShape.type.match(/End/)) { - oShape.workflow.taskUid = workflow.getStartEventConn(oShape,'sourcePort','InputPort'); - oShape.workflow.AddEventEndContextMenu(oShape); - } - else if(oShape.type.match(/Gateway/)) { - oShape.workflow.AddGatewayContextMenu(oShape); - } - else if(oShape.type.match(/SubProcess/)) { - oShape.workflow.AddSubProcessContextMenu(oShape); - } - } - //this.workflow.AddEventStartContextMenu(oShape); - - -} - -/** - * This function is called in Save Process - * and menu is shown according to the shape selected - * @Param Shape Object - * @Author Javed Aman - */ -MyWorkflow.prototype.getCommonConnections = function(oShape) -{ - var routes = new Array(); - var counter = 0 - for(var p=0; p < oShape.workflow.commonPorts.data.length; p++) - { - if(typeof oShape.workflow.commonPorts.data[p] === "object" && oShape.workflow.commonPorts.data[p] != null) - { - counter++; - } - } - for(var j=0; j< counter; j++) - { - //var temp1 = eval("this.workflow.commonPorts.data["+i+"].parentNode.output"+count+".getConnections()"); - var tester = oShape.workflow.commonPorts.data; - var temp1 = eval("oShape.workflow.commonPorts.data["+j+"].getConnections()"); - if(temp1.data[0]) { - if(routes[j]) { - if(routes[j][1] != temp1.data[0].sourcePort.parentNode.id) { - routes[j] = new Array(3); - routes[j][0] = temp1.data[0].id; - routes[j][1] = temp1.data[0].sourcePort.parentNode.id; - routes[j][2] = temp1.data[0].targetPort.parentNode.id; - routes[j][3] = temp1.data[0].targetPort.properties.name; - routes[j][4] = temp1.data[0].sourcePort.properties.name; - } - } - else { - routes[j] = new Array(3); - routes[j][0] = temp1.data[0].id; - routes[j][1] = temp1.data[0].sourcePort.parentNode.id; - routes[j][2] = temp1.data[0].targetPort.parentNode.id; - routes[j][3] = temp1.data[0].targetPort.properties.name; - routes[j][4] = temp1.data[0].sourcePort.properties.name; - } - } - } - var j = 0; - var serial = new Array(); - for(key in routes) - { - if(typeof routes[key] === 'object') { - serial[j] = routes[key]; - j++; - } - } - var routes = serial.getUniqueValues(); - for(var i=0;i< routes.length ; i++) - { - routes[i] = routes[i].split(','); - } - - return routes; -} - -Array.prototype.getUniqueValues = function () { -var hash = new Object(); -for (j = 0; j < this.length; j++) {hash[this[j]] = true} -var array = new Array(); -for (value in hash) {array.push(value)}; -return array; -} -/** - * Get Process UID - * @Param Shape Object - * @Author Safan maredia - */ -MyWorkflow.prototype.getUrlVars = function() -{ - var vars = [], hash; - var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&'); - - for(var i = 0; i < hashes.length; i++) - { - hash = hashes[i].split('='); - vars.push(hash[0]); - vars[hash[0]] = hash[1]; - } - var pro_uid = vars["PRO_UID"]; - return pro_uid; -} - - -MyWorkflow.prototype.savePosition= function(oShape) -{ - var shapeId = oShape.id; - var actiontype = oShape.actiontype; - var xpos = oShape.x; - var ypos = oShape.y; - var pos = '{"x":'+xpos+',"y":'+ypos+'}'; - - var width = oShape.width; - var height = oShape.height; - var cordinates = '{"x":'+width+',"y":'+height+'}'; - var urlparams = ''; - switch(actiontype) - { - case 'saveTaskPosition': - urlparams = '?action='+actiontype+'&data={"uid":"'+ shapeId +'","position":'+pos+'}'; - break; - case 'saveEventPosition': - urlparams = '?action='+actiontype+'&data={"uid":"'+ shapeId +'","position":'+pos+'}'; - break; - case 'saveTextPosition': - urlparams = '?action='+actiontype+'&data={"uid":"'+ shapeId +'","position":'+pos+'}'; - break; - case 'saveGatewayPosition': - urlparams = '?action='+actiontype+'&data={"uid":"'+ shapeId +'","position":'+pos+'}'; - break; - case 'saveTaskCordinates': - urlparams = '?action='+actiontype+'&data={"uid":"'+ shapeId +'","position":'+cordinates+'}'; - break; - case 'saveAnnotationCordinates': - urlparams = '?action='+actiontype+'&data={"uid":"'+ shapeId +'","position":'+cordinates+'}'; - break; - } - if(urlparams != ''){ - Ext.Ajax.request({ - url: "bpmn/processes_Ajax.php"+ urlparams, - success: function(response) { - //Ext.Msg.alert (response.responseText); - }, - failure: function(){ - //Ext.Msg.alert ('Failure'); - } - }); - } -} -/** - * Saving Shape Asychronously - * @Param oNewShape Object - * @Author Safan maredia - */ -MyWorkflow.prototype.saveShape= function(oNewShape) -{ - //Initializing variables - var shapeId = oNewShape.id; - var shapetype = oNewShape.type; - var actiontype = oNewShape.actiontype; - var xpos = oNewShape.x; - var ypos = oNewShape.y; - var pos = '{"x":'+xpos+',"y":'+ypos+'}'; - var width = oNewShape.width; - var height = oNewShape.height; - var cordinates = '{"x":'+width+',"y":'+height+'}'; - - if(shapetype == 'bpmnTask'){ - var newlabel = oNewShape.taskName; - } - if(shapetype == 'bpmnAnnotation'){ - newlabel = oNewShape.annotationName; - } - - //var urlparams = "action=addTask&data={"uid":"4708462724ca1d281210739068208635","position":{"x":707,"y":247}}"; - var urlparams = ''; - switch(actiontype) - { - case 'addTask': - urlparams = '?action='+actiontype+'&data={"uid":"'+ pro_uid +'","position":'+pos+',"cordinate":'+cordinates+'}'; - break; - case 'updateTask': - urlparams = '?action='+actiontype+'&data={"uid":"'+ shapeId +'","boundary":"TIMER"}'; - break; - case 'updateTaskName': - urlparams = '?action='+actiontype+'&data={"uid":"'+ shapeId +'","label":"'+newlabel+'"}'; - break; - case 'addSubProcess': - urlparams = '?action='+actiontype+'&data={"uid":"'+ pro_uid +'","position":'+pos+'}'; - break; - case 'addText': - var next_uid = ''; - var taskUidFrom = workflow.getStartEventConn(oNewShape,'sourcePort','OutputPort'); - if(taskUidFrom.length > 0) - next_uid = taskUidFrom[0].value; - urlparams = '?action='+actiontype+'&data={"uid":"'+ pro_uid +'","label":"'+newlabel+'","task_uid":"'+ next_uid +'","position":'+pos+'}'; - break; - case 'updateText': - next_uid = ''; - if(workflow.currentSelection.type == 'bpmnTask') - taskUidFrom = workflow.getStartEventConn(oNewShape,'sourcePort','OutputPort'); - else - taskUidFrom = workflow.getStartEventConn(oNewShape,'sourcePort','InputPort'); - if(taskUidFrom.length > 0) - next_uid = taskUidFrom[0].value; - - urlparams = '?action='+actiontype+'&data={"uid":"'+ shapeId +'","label":"'+newlabel+'","next_uid":"'+ next_uid +'"}'; - break; - case 'saveStartEvent': - //If we change Event to start from Message/Timer then Delete the record from Events Table - this.deleteEvent(oNewShape); - var tas_start = 'TRUE'; - var tas_uid = oNewShape.task_uid; - urlparams = '?action='+actiontype+'&data={"tas_uid":"'+tas_uid+'","tas_start":"'+tas_start+'"}'; - break; - case 'addEvent': - urlparams = '?action='+actiontype+'&data={"uid":"'+ pro_uid +'","evn_type":"'+shapetype+'","position":'+pos+',"evn_uid":"'+shapeId+'"}'; - break; - case 'updateEvent': - urlparams = '?action='+actiontype+'&data={"evn_uid":"'+shapeId +'","evn_type":"'+shapetype+'"}'; - break; - case 'addGateway': - urlparams = '?action='+actiontype+'&data={"pro_uid":"'+ pro_uid +'","gat_uid":"'+ shapeId +'","gat_type":"'+ shapetype +'","position":'+ pos +'}'; - break; - } - //var urlparams = '?action='+actiontype+'&data={"uid":"'+ pro_uid +'","position":'+pos+'}'; - - if(urlparams != ''){ - Ext.Ajax.request({ - url: "bpmn/processes_Ajax.php"+ urlparams, - success: function(response) { - //Ext.Msg.alert (response.responseText); - if(response.responseText != 1 && response.responseText != ""){ - this.workflow.newTaskInfo = Ext.util.JSON.decode(response.responseText); - oNewShape.html.id = this.workflow.newTaskInfo.uid; - oNewShape.id = this.workflow.newTaskInfo.uid; - if(oNewShape.type == 'bpmnTask' && oNewShape.boundaryEvent != true){ - oNewShape.taskName = this.workflow.newTaskInfo.label; - workflow.redrawTaskText(oNewShape); - //After Figure is added, Update Start Event connected to Task - if(typeof this.workflow.preSelectedObj != 'undefined' ){ - var preSelectedFigure = this.workflow.preSelectedObj; - if(preSelectedFigure.type.match(/Start/) && preSelectedFigure.type.match(/Event/)) - this.workflow.saveEvents(preSelectedFigure,oNewShape.id); - else if(preSelectedFigure.type.match(/Task/)) - this.workflow.saveRoute(preSelectedFigure,oNewShape); - else if (preSelectedFigure.type.match(/Gateway/)) - //preSelectedFigure.rou_type = 'SEQUENTIAL'; - this.workflow.saveRoute(preSelectedFigure,oNewShape); - else if (preSelectedFigure.type.match(/Inter/)) { - //preSelectedFigure.rou_type = 'SEQUENTIAL'; - this.workflow.saveEvents(preSelectedFigure,oNewShape); - } - } - - /** - * erik: Setting Drop targets from users & groups grids to assignment to tasks - * for new tasks created recently - */ - //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 : Ext.getCmp('usersPanel')._onDrop}); - - } - else if(oNewShape.type == 'bpmnSubProcess'){ - oNewShape.subProcessName = this.workflow.newTaskInfo.label; - } - /*else if(oNewShape.type.match(/Inter/) && oNewShape.type.match(/Start/)) { - workflow.saveEvents(oNewShape); - } - else if(oNewShape.type.match(/Start/) && oNewShape.type.match(/Event/)) { - workflow.saveEvents(oNewShape); - }*/ - else if(oNewShape.type.match(/End/) && oNewShape.type.match(/Event/)) { - if(workflow.currentSelection != null && workflow.currentSelection != '') //will check for standalone event - workflow.saveRoute(workflow.currentSelection,oNewShape); - } - else if(oNewShape.type.match(/Gateway/)) { - workflow.saveGateways(oNewShape); - } - else if(oNewShape.type.match(/Inter/) && oNewShape.type.match(/Event/)) { - preSelectedFigure = this.workflow.preSelectedFigure; - workflow.saveEvents(oNewShape,preSelectedFigure.id); - } - } - }, - failure: function(){ - //Ext.Msg.alert ('Failure'); - } - }); - } -} - -MyWorkflow.prototype.saveTask= function(actiontype,xpos,ypos) -{ - if(actiontype != '') { - var pro_uid = this.getUrlVars(); - var actiontype = actiontype; - var pos = '{"x":'+xpos+',"y":'+ypos+'}'; - switch(actiontype) { - case 'addTask': - urlparams = '?action='+actiontype+'&data={"uid":"'+ pro_uid +'","position":'+pos+'}'; - break; - } - Ext.Ajax.request({ - url: "bpmn/processes_Ajax.php"+ urlparams, - success: function(response) { - //Ext.Msg.alert (response.responseText); - if(response.responseText != 1 && response.responseText != "") { - workflow.newTaskInfo = Ext.util.JSON.decode(response.responseText); - workflow.taskName = this.workflow.newTaskInfo.label; - workflow.task = eval("new bpmnTask(workflow) "); - workflow.addFigure(workflow.task, xpos, ypos); - workflow.task.html.id = workflow.newTaskInfo.uid; - workflow.task.id = workflow.newTaskInfo.uid; - } - } - }) - } -} -//Deleting shapes silently on swapping task to sub process and vice-versa -MyWorkflow.prototype.deleteSilently= function(oShape) -{ - //Initializing variables - var pro_uid = this.getUrlVars(); - var shapeId = oShape.id; - var actiontype = oShape.actiontype; - //var shapeName = ''; - - switch(actiontype) - { - case 'deleteTask': - var urlparams = '?action='+actiontype+'&data={"pro_uid":"'+ pro_uid +'","tas_uid":"'+shapeId+'"}'; - this.urlparameter = urlparams; - //shapeName = 'Task :'+ oShape.taskName; - break; - case 'deleteSubProcess': - urlparams = '?action='+actiontype+'&data={"pro_uid":"'+ pro_uid +'","tas_uid":"'+shapeId+'"}'; - this.urlparameter = urlparams; - break; - } - - Ext.Ajax.request({ - url: "bpmn/processes_Ajax.php"+ urlparams, - success: function(response) { - //Ext.Msg.alert (response.responseText); - }, - failure: function(){ - Ext.Msg.alert ('Failure'); - } - }); - //workflow.getCommandStack().execute(new CommandDelete(workflow.getCurrentSelection())); -} -/** - * Deleting Shape Asychronously - * @Param oShape Object - * @Author Safan maredia - */ -MyWorkflow.prototype.deleteShape= function(oShape) -{ - var shapeId = oShape.id; - var actiontype = oShape.actiontype; - var shapeName = ''; - switch(actiontype) - { - case 'deleteTask': - var urlparams = '?action='+actiontype+'&data={"pro_uid":"'+ pro_uid +'","tas_uid":"'+shapeId+'"}'; - this.urlparameter = urlparams; - shapeName = 'Task :'+ oShape.taskName; - break; - case 'deleteSubProcess': - urlparams = '?action='+actiontype+'&data={"pro_uid":"'+ pro_uid +'","tas_uid":"'+shapeId+'"}'; - this.urlparameter = urlparams; - shapeName = oShape.subProcessName; - break; - case 'deleteText': - urlparams = '?action='+actiontype+'&data={"uid":"'+shapeId+'"}'; - this.urlparameter = urlparams; - shapeName = 'Annotation'; - break; - case 'deleteStartEvent': - var task_detail = this.getStartEventConn(this.currentSelection,'targetPort','OutputPort'); - var evn_uid = this.currentSelection.id; - if(task_detail.length > 0){ - var tas_uid = task_detail[0].value; - var tas_start = 'FALSE'; - this.urlparameter = '?action=deleteStartEvent&data={"tas_uid":"'+tas_uid+'","tas_start":"'+tas_start+'","evn_uid":"'+evn_uid+'"}'; - } - else - this.urlparameter = '?action=deleteEvent&data={"uid":"'+evn_uid+'"}'; - shapeName = 'Start Event'; - break; - case 'deleteEndEvent': - shapeName = 'End Event'; - var evn_uid = this.currentSelection.id; - this.urlparameter = '?action=deleteEvent&data={"uid":"'+evn_uid+'"}'; - break; - case 'deleteInterEvent': - shapeName = 'Intermediate Event'; - var evn_uid = this.currentSelection.id; - this.urlparameter = '?action=deleteEvent&data={"uid":"'+evn_uid+'"}'; - break; - case 'deleteGateway': - shapeName = 'Gateway'; - urlparams = '?action='+actiontype+'&data={"pro_uid":"'+ pro_uid +'","gat_uid":"'+shapeId+'"}'; - this.urlparameter = urlparams; - break; - } -if(typeof oShape.noAlert == 'undefined' || oShape.noAlert == null){ - Ext.MessageBox.confirm('Confirm', 'Are you sure you want to delete the '+ shapeName,this.showAjaxDialog); -} -else{ - Ext.MessageBox.confirm('Confirm', 'Are you sure you want to delete the '+ shapeName,this.showDeleteDialog); -} -} - -MyWorkflow.prototype.showAjaxDialog = function(btn){ - //this.workflow.confirm = btn; - if(typeof workflow.urlparameter != 'undefined'){ - var url = workflow.urlparameter; - if(btn == 'yes'){ - var currentObj = workflow.currentSelection; - - //Check for End Event and delete from route table - if(workflow.currentSelection.type.match(/End/) && workflow.currentSelection.type.match(/Event/)){ - var ports = currentObj.getPorts(); - var len =ports.data.length; - var conn = new Array(); - for(var i=0; i<=len; i++){ - if(typeof ports.data[i] === 'object') - conn[i] = ports.data[i].getConnections(); - } - for(i = 0; i< conn.length ; i++) - { - if(typeof conn[i] != 'undefined') - for(var j = 0; j < conn[i].data.length ; j++) - { - if(typeof conn[i].data[j] != 'undefined'){ - if(conn[i].data[j].targetPort.parentNode.id == currentObj.id){ - route = conn[i].data[j]; - break; - } - } - } - } - if(typeof route != 'undefined'){ - workflow.deleteRoute(route,1); - } - } - Ext.Ajax.request({ - url: "bpmn/processes_Ajax.php"+ url, - success: function(response) { - workflow.getCommandStack().execute(new CommandDelete(currentObj)); - }, - failure: function(){ - Ext.Msg.alert ('Failure'); - } - }); - - } - } - }; - -MyWorkflow.prototype.showDeleteDialog = function(btn){ - if(btn == 'yes'){ - workflow.getCommandStack().execute(new CommandDelete(workflow.getCurrentSelection())); - } - }; - - -/** - * ExtJs Menu on right click on Event Shape - * @Param oShape Object - * @Author Girish joshi - */ -MyWorkflow.prototype.editEventProperties = function(oShape) -{ - var currentSelection = oShape.scope.currentSelection; - var pmosExtObj = new pmosExt(); - - switch (currentSelection.type){ - case 'bpmnEventMessageStart': - pmosExtObj.popWebEntry(currentSelection); - break; - case 'bpmnEventTimerStart': - pmosExtObj.popCaseSchedular(currentSelection); - break; - case 'bpmnEventMessageSendInter': - pmosExtObj.popTaskNotification(currentSelection); - break; - case 'bpmnEventTimerInter': - pmosExtObj.popMultipleEvent(currentSelection); - break; - case 'bpmnEventMessageEnd': - pmosExtObj.popMessageEvent(currentSelection); - break; - } -} - -/** - * Get the Source / Target of the shape - * @Param oShape Object - * @Param sPort string - * @Param sPortType string - * @return aStartTask array - * @Author Girish joshi - */ -MyWorkflow.prototype.getStartEventConn = function(oShape,sPort,sPortType) -{ - var aStartTask= new Array(); - - //Get all the ports of the shapes - if( workflow.currentSelection != null && typeof workflow.currentSelection != 'undefined') { - var ports = workflow.currentSelection.getPorts(); - //var ports = oShape.getPorts(); - var len = ports.data.length; - - //Get all the connection of the shape - var conn = new Array(); - for(var i=0; i<=len; i++){ - if(typeof ports.data[i] === 'object') - if(ports.data[i].type == sPortType) - conn[i] = ports.data[i].getConnections(); - } - //Initializing Arrays and variables - var countConn = 0; - - var type; - //Get ALL the connections for the specified PORT - for(i = 0; i< conn.length ; i++) - { - if(typeof conn[i] != 'undefined') - for(var j = 0; j < conn[i].data.length ; j++) - { - if(typeof conn[i].data[j] != 'undefined') - { - type = eval('conn[i].data[j].'+sPort+'.parentNode.type') - if(type == 'bpmnTask') - { - aStartTask[countConn] = new Array(); - aStartTask[countConn].value = eval('conn[i].data[j].'+sPort+'.parentNode.id'); - aStartTask[countConn].name = eval('conn[i].data[j].'+sPort+'.parentNode.taskName'); - countConn++; - } - } - } - } - } - return aStartTask; -} - -/** - * save Gateway depending on the Shape Type - * @Param oGateway Object - * @Param sTaskUID string - * @Author Safan Maredia - */ -MyWorkflow.prototype.saveGateways = function(oGateway){ - var task_uid = ''; - var next_task_uid = ''; - var next_task_type = ''; - var urlparams = ''; - var xpos = oGateway.x; - var ypos = oGateway.y; - var pos = '{"x":'+xpos+',"y":'+ypos+'}'; - - var ports = oGateway.getPorts(); - var len =ports.data.length; - //Get all the connection of the shape - var conn = new Array(); - var count1 = 0; - var count2 = 0; - for(var i=0; i<=len; i++){ - if(typeof ports.data[i] === 'object') - conn[i] = ports.data[i].getConnections(); - } - //Get ALL the connections for the specified PORT - for(i = 0; i< conn.length ; i++){ - if(typeof conn[i] != 'undefined') - for(var j = 0; j < conn[i].data.length ; j++){ - if(typeof conn[i].data[j] != 'undefined'){ - if(conn[i].data[j].sourcePort.parentNode.id != oGateway.id){ - // task_uid[count1] = new Array(); - task_uid = conn[i].data[j].sourcePort.parentNode.id; - count1++; - } - if(conn[i].data[j].targetPort.parentNode.id != oGateway.id){ - // task_uid[count2] = new Array(); - next_task_uid = conn[i].data[j].targetPort.parentNode.id; - next_task_type = conn[i].data[j].targetPort.parentNode.type; - //count2++; - } - } - } - } - // var staskUid = Ext.util.JSON.encode(task_uid); - // var sNextTaskUid = Ext.util.JSON.encode(next_task_uid); - urlparams = '?action=addGateway&data={"pro_uid":"'+ pro_uid +'","tas_from":"'+task_uid+'","tas_to":"'+next_task_uid+'","gat_type":"'+oGateway.type+'","gat_uid":"'+oGateway.id+'","gat_next_type":"'+next_task_type+'","position":'+pos+'}'; - if(urlparams != ''){ - Ext.Ajax.request({ - url: "bpmn/processes_Ajax.php"+ urlparams, - success: function(response) { - if(response.responseText != '') - { - // workflow.currentSelection.id = response.responseText; - /*if(workflow.currentSelection.type.match(/Inter/) && workflow.currentSelection.type.match(/Event/)){ - workflow.currentSelection.id = response.responseText; - var newObj = workflow.currentSelection; - var preObj = new Array(); - preObj.type = 'bpmnTask'; - preObj.id = task_uid[0]; - newObj.evn_uid = workflow.currentSelection.id; - newObj.task_to = next_task_uid[0]; - this.workflow.saveRoute(preObj,newObj); - }*/ - } - }, - failure: function(){ - Ext.Msg.alert ('Failure'); - } - }); - } -} - -/** - * save Event depending on the Shape Type - * @Param oShape Object - * @Param sPort string - * @Param sPortType string - * @Author Girish joshi - */ -MyWorkflow.prototype.saveEvents = function(oEvent,sTaskUID) -{ - var task_uid = new Array(); - var next_task_uid = new Array(); - var urlparams = ''; - - if(typeof sTaskUID == 'undefined') //Will be undefined for standalone events - sTaskUID = ''; - if(oEvent.type.match(/Start/)) - { - var tas_start = 'TRUE'; - urlparams = '?action=saveEvents&data={"tas_uid":"'+sTaskUID+'","tas_start":"'+tas_start+'","evn_type":"'+oEvent.type+'","evn_uid":"'+oEvent.id+'"}'; - } - else if(oEvent.type.match(/Inter/)) - { - var ports = oEvent.getPorts(); - var len =ports.data.length; - - //Get all the connection of the shape - var conn = new Array(); - var count1 = 0; - var count2 = 0; - for(var i=0; i<=len; i++) { - if(typeof ports.data[i] === 'object') - conn[i] = ports.data[i].getConnections(); - } - - //Get ALL the connections for the specified PORT - for(i = 0; i< conn.length ; i++){ - if(typeof conn[i] != 'undefined') - for(var j = 0; j < conn[i].data.length ; j++) { - if(typeof conn[i].data[j] != 'undefined'){ - if(conn[i].data[j].sourcePort.parentNode.type != oEvent.type){ - // task_uid[count1] = new Array(); - task_uid = conn[i].data[j].sourcePort.parentNode.id; - count1++; - } - if(conn[i].data[j].targetPort.parentNode.type != oEvent.type){ - // task_uid[count2] = new Array(); - next_task_uid = conn[i].data[j].targetPort.parentNode.id; - //count2++; - } - } - } - } - // var staskUid = Ext.util.JSON.encode(task_uid); - // var sNextTaskUid = Ext.util.JSON.encode(next_task_uid); - if(typeof task_uid == 'undefined') - task_uid = ''; - if(typeof next_task_uid == 'undefined') - next_task_uid = ''; - - urlparams = '?action=saveEvents&data={"tas_from":"'+task_uid+'","tas_to":"'+next_task_uid+'","evn_type":"'+oEvent.type+'","evn_uid":"'+oEvent.id+'"}'; - } - - if(urlparams != '') { - Ext.Ajax.request({ - url: "bpmn/processes_Ajax.php"+ urlparams, - success: function(response) { - if(response.responseText != '') - { - //Save Route - //disabled by Fernando, because the workflow.currentSelection arrives null and throwing an error in javascript -// if(workflow.currentSelection.type.match(/Inter/) && workflow.currentSelection.type.match(/Event/)){ -// workflow.currentSelection.id = response.responseText; -// var newObj = workflow.currentSelection; -// var preObj = new Array(); -// preObj.type = 'bpmnTask'; -// preObj.id = task_uid[0]; -// newObj.evn_uid = workflow.currentSelection.id; -// newObj.task_to = next_task_uid[0]; -// this.workflow.saveRoute(preObj,newObj); -// } - } - }, - failure: function(){ - Ext.Msg.alert ('Failure'); - } - }); - } -} - -/** - * save Route on Changing of route Ports depending on the Shape Type - * @Param preObj Object - * @Param newObj Object - * @Author Girish joshi - */ -MyWorkflow.prototype.saveRoute = function(preObj,newObj) -{ - var task_uid = new Array(); - var next_task_uid = new Array(); - var rou_type =''; - var rou_evn_uid = ''; - var port_numberIP = ''; - var port_numberOP = ''; - var sGatUid = ''; - var sGatType = ''; - - if(typeof newObj.sPortType != 'undefined') - { - sPortTypeIP = newObj.sPortType; - sPortTypeOP = preObj.sPortType; - var sPortType_lenIP = sPortTypeIP.length; - var sPortType_lenOP = sPortTypeOP.length; - port_numberIP = sPortTypeIP.charAt(sPortType_lenIP-1); - port_numberOP = sPortTypeOP.charAt(sPortType_lenOP-1); - } - if(preObj.type.match(/Task/) && newObj.type.match(/Event/) && newObj.type.match(/Inter/)) - { - task_uid[0] = preObj.id; - next_task_uid[0] = newObj.task_to; - rou_type = 'SEQUENTIAL'; - rou_evn_uid = newObj.id; - } - //If both the Object are Task - else if(preObj.type.match(/Task/) && newObj.type.match(/Task/)) - { - task_uid[0] = preObj.id; - next_task_uid[0] = newObj.id; - rou_type = 'SEQUENTIAL'; - } - else if(preObj.type.match(/Task/) && newObj.type.match(/End/) && newObj.type.match(/Event/) || newObj.reverse == 1) - { - //this.deleteRoute(newObj.conn,1); - if(newObj.reverse == 1) //Reverse Routing - task_uid[0] = newObj.id; - else - task_uid[0] = preObj.id; - - next_task_uid[0] = '-1'; - - rou_type = 'SEQUENTIAL'; - rou_evn_uid = newObj.id; - } - else if(preObj.type.match(/Gateway/)) - { - switch(preObj.type){ - case 'bpmnGatewayParallel': - rou_type ='PARALLEL'; - break; - case 'bpmnGatewayExclusiveData': - rou_type = 'EVALUATE'; - break; - case 'bpmnGatewayInclusive': - rou_type = 'PARALLEL-BY-EVALUATION'; - break; - case 'bpmnGatewayComplex': - rou_type = 'DISCRIMINATOR'; - break; - } - var ports = preObj.getPorts(); - var len =ports.data.length; - - //Get all the connection of the shape - var conn = new Array(); - var count1 = 0; - var count2 = 0; - for(var i=0; i<=len; i++){ - if(typeof ports.data[i] === 'object') - conn[i] = ports.data[i].getConnections(); - } - - //Get ALL the connections for the specified PORT - for(i = 0; i< conn.length ; i++) - { - if(typeof conn[i] != 'undefined') - for(var j = 0; j < conn[i].data.length ; j++) - { - if(typeof conn[i].data[j] != 'undefined') - { - if(conn[i].data[j].sourcePort.parentNode.type != preObj.type){ - // task_uid[count1] = new Array(); - task_uid[count1] = conn[i].data[j].sourcePort.parentNode.id; - count1++; - } - if(conn[i].data[j].targetPort.parentNode.type != preObj.type){ - // task_uid[count2] = new Array(); - next_task_uid[count2] = conn[i].data[j].targetPort.parentNode.id; - count2++; - } - - } - } - } - } - - var staskUid = Ext.util.JSON.encode(task_uid); - var sNextTaskUid = Ext.util.JSON.encode(next_task_uid); - if(preObj.type.match(/Gateway/)){ - sGatUid = preObj.id; - sGatType = preObj.type; - } - if(task_uid.length > 0 && next_task_uid.length > 0) - { - Ext.Ajax.request({ - url: "bpmn/patterns_Ajax.php", - success: function(response) { - if(response.responseText != 0) { - if(typeof newObj.conn != 'undefined') { - //var resp = response.responseText.split("|"); //resp[0] => gateway UID OR event_UID , resp[1] => route UID - var resp = response.responseText; //resp[0] => gateway UID OR event_UID , resp[1] => route UID - newObj.conn.html.id = resp; - newObj.conn.id = resp; - } - } - }, - failure: function(){ - Ext.Msg.alert ('Failure'); - }, - params: { - action :'savePattern', - PROCESS : pro_uid, - TASK : staskUid, - ROU_NEXT_TASK : sNextTaskUid, - ROU_TYPE : rou_type, - ROU_EVN_UID : rou_evn_uid, - PORT_NUMBER_IP: port_numberIP, - PORT_NUMBER_OP: port_numberOP, - GAT_UID : sGatUid, - GAT_TYPE : sGatType, - mode:'Ext' - } - }); - } - else - workflow.saveGateways(preObj); -} - -MyWorkflow.prototype.deleteRoute = function(oConn,iVal){ - workflow.oConn = oConn; - var sourceObjType = oConn.sourcePort.parentNode.type; - var targetObjType = oConn.targetPort.parentNode.type; - var rou_uid = oConn.id; - //Setting Condition for VALID ROUTE_UID present in Route Table - //For start and gateway event, we dont have entry in ROUTE table - if(rou_uid != '' && !sourceObjType.match(/Gateway/) && !sourceObjType.match(/Start/) && !targetObjType.match(/Gateway/)){ - workflow.urlDeleteparameter = '?action=deleteRoute&data={"uid":"'+ rou_uid +'"}'; - } - //Deleting route for Start event and also deleting start event - else if(sourceObjType.match(/Start/)){ - var targetObj = oConn.targetPort.parentNode; //Task - var tas_uid = targetObj.id; - var tas_start = 'FALSE'; - workflow.urlDeleteparameter = '?action=saveStartEvent&data={"tas_uid":"'+tas_uid+'","tas_start":"'+tas_start+'"}'; - } - if(iVal == 0) - Ext.MessageBox.confirm('Confirm', 'Are you sure you want to delete the Route',this.showEventResult); - else - this.showEventResult('yes'); -} - -MyWorkflow.prototype.showEventResult = function(btn){ - //this.workflow.confirm = btn; - if(typeof workflow.urlDeleteparameter != 'undefined') - { - var url = workflow.urlDeleteparameter; - if(btn == 'yes') - { - Ext.Ajax.request({ - url: "bpmn/processes_Ajax.php"+ url, - success: function(response) { - workflow.getCommandStack().execute(new CommandDelete(workflow.oConn)); - }, - failure: function(){ - Ext.Msg.alert ('Failure'); - } - }); - } - } - - }; -/** - * Deleting Event - * @Param eventObj Object - * @Author Girish joshi - */ -MyWorkflow.prototype.deleteEvent = function(eventObj){ - - var event_uid = eventObj.id; - if(event_uid != '') { - var urlparams = '?action=deleteEvent&data={"uid":"'+ event_uid +'"}'; - Ext.Ajax.request({ - url: "bpmn/processes_Ajax.php"+ urlparams, - success: function(response) { - }, - failure: function(){ - Ext.Msg.alert ('Failure'); - } - }); - } -} - -MyWorkflow.prototype.getDeleteCriteria = function() -{ - var shape = workflow.currentSelection.type; - var currentObj = workflow.currentSelection; - if(shape.match(/Task/)){ - workflow.currentSelection.actiontype = 'deleteTask'; - } - else if(shape.match(/SubProcess/)){ - workflow.currentSelection.actiontype = 'deleteSubProcess'; - } - else if(shape.match(/Annotation/)){ - workflow.currentSelection.actiontype = 'deleteText'; - } - else if(shape.match(/Event/) && shape.match(/Start/)){ - workflow.currentSelection.actiontype = 'deleteStartEvent'; - } - else if(shape.match(/Event/) && shape.match(/End/)){ - workflow.currentSelection.actiontype = 'deleteEndEvent'; - } - else if(shape.match(/Event/) && shape.match(/Inter/)){ - workflow.currentSelection.actiontype = 'deleteInterEvent'; - } - else if(shape.match(/Gateway/)){ - workflow.currentSelection.actiontype = 'deleteGateway'; - workflow.deleteShape(workflow.currentSelection); - } - if(workflow.currentSelection.actiontype != '') - workflow.deleteShape(workflow.currentSelection); -} - -/** - * Zoom Function - * @Param sType string(in/out) - * @Author Girish joshi - */ -MyWorkflow.prototype.zoom = function(sType) -{ - //workflow.zoomFactor = 1; - var loadMask = new Ext.LoadMask(document.body, {msg:'Zooming..'}); - var figures = workflow.getDocument().getFigures(); - - var lines=workflow.getLines(); - var size=lines.getSize(); - - sType =sType/100; - workflow.zoomfactor = sType; - var figSize = figures.getSize(); - // loadMask.show(); - for(f = 0;f @@ Replace the value in quotes ';}, - items: - { - xtype:'tabpanel', - activeTab: 0, - defaults:{ - autoHeight:true - }, - items:[{ - title:'All Variables', - id :'allVar', - layout:'form', - listeners: { - activate: function(tabPanel){ - // use {@link Ext.data.HttpProxy#setUrl setUrl} to change the URL for *just* this request. - var link = 'proxyVariable?pid='+pro_uid+'&type='+tabPanel.id+'&sFieldName=form[CTO_CONDITION]&sSymbol=@@'; - varStore.proxy.setUrl(link, true); - varStore.load(); - } - }, - items:[{ - xtype: 'grid', - ds: varStore, - cm: varColumns, - width: 380, - autoHeight: true, - //plugins: [editor], - //loadMask : true, - loadingText : 'Loading...', - border: false, - listeners: { - //rowdblclick: alert("ok"), - rowdblclick: function(){ - var getObjectGridRow = workflow.gridObjectRowSelected; - var FieldSelected = workflow.gridField; - - //getting selected row of variables - var rowSelected = this.getSelectionModel().getSelected(); - var rowLabel = rowSelected.data.variable; - - //Assigned new object with condition - if(typeof rowData.colModel != 'undefined') - rowData.colModel.config[3].editor.setValue(rowLabel); - //Assigning / updating Condition for a row - else - rowData[0].set(fieldName,rowLabel); - } - } - }] - }] - } -}); - var window = new Ext.Window({ - title: 'Variables', - collapsible: false, - maximizable: false, - scrollable: true, - width: 400, - height: 350, - minWidth: 200, - minHeight: 150, - autoScroll: true, - layout: 'fit', - plain: true, - buttonAlign: 'center', - items: [varForm] - }); - window.show(); - -} diff --git a/workflow/engine/templates/bpmn/Pool.js b/workflow/engine/templates/bpmn/Pool.js deleted file mode 100755 index 6c3946973..000000000 --- a/workflow/engine/templates/bpmn/Pool.js +++ /dev/null @@ -1,53 +0,0 @@ -bpmnPool = function (workflow) { - VectorFigure.call(this); - this.setDimension(800, 600); - var figures = workflow.getFigures(); - for(var i=0;i" + aData.FILENAME + "<\/a>"); - form.findField('XPDL_FILENAME').setValue("" + aData.FILENAMEXPDL + "<\/a>"); - }, - failure:function(form, action) { - } - }); - - var exportProcesswindow = new Ext.Window({ - title : _('ID_EXPORT_PROCESS'), - collapsible: false, - maximizable: false, - sizeable : false, - width : 420, - height : 210, - resizable : false, - layout : 'fit', - plain : true, - buttonAlign: 'center', - items : exportProcessForm - }); - - workflow.exportProcesswindow = exportProcesswindow; - exportProcesswindow.show(); -} - -ProcessMapContext.prototype.addTask= function() - { - var newShape = eval("new bpmnTask(workflow)"); - var xPos = workflow.contextX; - var yPos = workflow.contextY; - workflow.addFigure(newShape, xPos, yPos); - newShape.actiontype = 'addTask'; - workflow.saveShape(newShape); //Saving Annotations when user drags and drops it - } - -ProcessMapContext.prototype.horiLine= function() - { - PMExt.notify( _('ID_STATUS') , _('ID_HORIZONTAL_LINE') ); - } - -ProcessMapContext.prototype.vertiLine= function() - { - PMExt.notify( _('ID_STATUS') , _('ID_VERTICAL_LINE') ); - } - -ProcessMapContext.prototype.delLines= function() - { - PMExt.notify( _('ID_STATUS') , _('ID_DELETE_LINES') ); - } - -ProcessMapContext.prototype.processPermission= function() - { - //Process Permission store code starts here - var dbConnFields = Ext.data.Record.create([ - { name: 'OP_UID',type: 'string'}, - { name: 'LABEL',type: 'string'}, - { name: 'TASK_TARGET',type: 'string'}, - { name: 'GROUP_USER',type: 'string'}, - { name: 'TASK_SOURCE',type: 'string'}, - { name: 'PARTICIPATED',type: 'string'}, - { name: 'OBJECT_TYPE',type: 'string'}, - { name: 'OBJECT',type: 'string'}, - { name: 'ACTION',type: 'string'}, - { name: 'OP_CASE_STATUS',type: 'string'}, - { name: 'DYNAFORM',type: 'string'}, - { name: 'INPUT',type: 'string'}, - { name: 'OUTPUT',type: 'string'}, - { name: 'TAS_UID',type: 'string'}, - { name: 'OP_TASK_SOURCE',type: 'string'}, - { name: 'OP_PARTICIPATE',type: 'string'}, - { name: 'OP_OBJ_TYPE',type: 'string'}, - { name: 'OP_GROUP_USER',type: 'string'}, - { name: 'OBJ_NAME',type: 'string'}, - { name: 'OP_ACTION',type: 'string'}, - { name: 'USR_FULLNAME',type: 'string'}, - { name: 'DYNAFORM_NAME',type: 'string'}, - { name: 'INPUT_NAME',type: 'string'}, - { name: 'OUTPUT_NAME',type: 'string'} - ]); - - //Creating different stores required for fields in form - var selectField = Ext.data.Record.create([ - { name: 'LABEL',type: 'string'}, - { name: 'UID',type: 'string'} - ]); - - var editor = new Ext.ux.grid.RowEditor({ - saveText: _('ID_UPDATE') - }); - - var btnCreate = new Ext.Button({ - id: 'btnCreate', - text: _('ID_NEW'), - iconCls: 'button_menu_ext ss_sprite ss_add', - handler: function () { - PermissionForm.getForm().reset(); - formWindow.show(); - - } - }); - - var editProPermission = function() { - editor.stopEditing(); - var rowSelected = Ext.getCmp('permissiongrid').getSelectionModel().getSelections(); - if( rowSelected.length == 0 ) { - PMExt.error('', _('ID_NO_SELECTION_WARNING')); - return false; - } - var opUID = rowSelected[0].get('OP_UID'); - PermissionForm.form.load({ - url:'bpmn/proxyExtjs.php?pid='+pro_uid+'&op_uid=' +opUID+'&action=editObjectPermission', - method:'GET', - waitMsg:'Loading', - success:function(form, action) { - formWindow.show(); - if(action.result.data.OP_PARTICIPATE == 1) - form.findField('OP_PARTICIPATE').setValue('Yes'); - else - form.findField('OP_PARTICIPATE').setValue('No'); - - if(action.result.data.OP_OBJ_TYPE == 'DYNAFORM') - Ext.getCmp('dynaform').show(); - if(action.result.data.OP_OBJ_TYPE == 'INPUT') - Ext.getCmp('inputdoc').show(); - if(action.result.data.OP_OBJ_TYPE == 'OUTPUT') - Ext.getCmp('outputdoc').show(); - }, - failure:function(form, action) { - PMExt.notify( _('ID_STATUS') , _('ID_LOAD_FAILED') ); - } - }); - } - - var deleteProPermission = function(){ - ids = Array(); - - editor.stopEditing(); - var rowsSelected = Ext.getCmp('permissiongrid').getSelectionModel().getSelections(); - - if( rowsSelected.length == 0 ) { - PMExt.error('', _('ID_NO_SELECTION_WARNING')); - return false; - } - - for(i=0; i",record.data.CTO_UID); - } - }*/] - }), - sm: new Ext.grid.RowSelectionModel({ - singleSelect: true, - listeners: { - rowselect: function(smObj, rowIndex, record) { - workflow.currentrowIndex = rowIndex; - } - } - }), - stripeRows: true, - viewConfig: {forceFit: true}, - tbar: tb, - bbar: new Ext.PagingToolbar({ - pageSize: 10, - store: assignedStore, - displayInfo: true, - displayMsg: 'Displaying Case Tracker Object {0} - {1} of {2}', - emptyMsg: "No Case Tracker Object to display", - items:[] - }) - }); - - editor.on({ - scope: this, - afteredit: function(roweditor, changes, record, rowIndex) { - var objType = record.data.OBJECT_TYPE; - var objUID = record.data.OBJECT_UID; - var objTitle = record.data.OBJECT_TITLE; - var cto_uid = record.data.CTO_UID; - var condition = record.data.CTO_CONDITION; - - Ext.Ajax.request({ - url : '../tracker/tracker_Ajax.php', - method: 'POST', - params:{ - PRO_UID : pro_uid, - OBJECT_TYPE : objType, - OBJECT_UID : objUID, - action :'assignCaseTrackerObject' - }, - success: function (response) - { - cto_uid = response.responseText; - Ext.Ajax.request({ - url : '../tracker/tracker_ConditionsSave.php', - method: 'POST', - params: - { - PRO_UID : pro_uid, - CTO_UID : cto_uid, - CTO_CONDITION : condition - }, - success: function (response){ - PMExt.notify( _('ID_STATUS') , _('ID_OBJECT_ASSIGNED') ); - availableStore.reload(); - assignedStore.reload(); - } - }) - }, - failure: function () { // when saving data failed - PMExt.notify( _('ID_STATUS') , _('ID_OBJECT_FAILED') ); - } - }) - //Updating the user incase if already assigned user has been replaced by other user - if(changes != '' && typeof record.json != 'undefined') - { - var obj_type = record.json.CTO_TYPE_OBJ; - var obj_UID = record.json.CTO_UID; - var obj_title = record.json.CTO_TITLE; - var obj_uid = record.json.CTO_UID; - var obj_condition = record.json.CTO_CONDITION; - var obj_position = record.json.CTO_POSITION; - - Ext.Ajax.request({ - url: '../tracker/tracker_Ajax.php', - method: 'POST', - params: { - action :'removeCaseTrackerObject', - CTO_UID : obj_UID, - PRO_UID : pro_uid, - STEP_POSITION : obj_position - }, - success: function(response) { - PMExt.notify( _('ID_STATUS') , _('ID_OBJECT_UPDATE') ); - } - }); - } - availableStore.reload(); - assignedStore.reload(); - } - }); - - var gridObjectWindow = new Ext.Window({ - title : 'Objects', - collapsible : false, - maximizable : false, - width : 550, - defaults :{ autoScroll:true }, - height : 380, - minWidth : 200, - minHeight : 150, - plain : true, - items : Objectsgrid, - buttonAlign : 'center' - }); - gridObjectWindow.show() -} - -ProcessMapContext.prototype.ExtVariables = function() -{ - var varFields = Ext.data.Record.create([ - { - name: 'variable', - type: 'string' - }, - { - name: 'type', - type: 'string' - }, - { - name: 'label', - type: 'string' - } - ]); - var varStore = ''; - varStore = new Ext.data.JsonStore({ - root : 'data', - totalProperty: 'totalCount', - idProperty : 'gridIndex', - remoteSort : true, - fields : varFields, - proxy : new Ext.data.HttpProxy({ - url : 'bpmn/proxyExtjs?pid='+pro_uid+'&action=getVariables&sFieldName=form[CTO_CONDITION]&sSymbol=@@' - }) - }); - //varStore.load(); - - var varColumns = new Ext.grid.ColumnModel({ - columns: [ - new Ext.grid.RowNumberer(), - { - id: 'FLD_NAME', - header: _('ID_VARIABLES'), - dataIndex: 'variable', - width: 170, - editable: false, - sortable: true - },{ - id: 'PRO_VARIABLE', - header: _('ID_LABEL'), - dataIndex: 'label', - width: 150, - sortable: true - } - ] - }); - - var varForm = new Ext.FormPanel({ - labelWidth: 100, - monitorValid : true, - width : 400, - bodyStyle : 'padding:10px 0 0 10px;', - height : 350, - renderer: function(val){return '
@@ Replace the value in quotes
';}, - items: - { - xtype:'tabpanel', - activeTab: 0, - defaults:{ - autoHeight:true - }, - items:[{ - title:_('ID_ALL_VARIABLES'), - id :'allVar', - layout:'form', - listeners: { - activate: function(tabPanel){ - // use {@link Ext.data.HttpProxy#setUrl setUrl} to change the URL for *just* this request. - var link = 'bpmn/proxyExtjs?pid='+pro_uid+'&action=getVariables&type='+tabPanel.id+'&sFieldName=form[CTO_CONDITION]&sSymbol=@@'; - varStore.proxy.setUrl(link, true); - varStore.load(); - } - }, - items:[{ - xtype: 'grid', - ds: varStore, - cm: varColumns, - width: 380, - autoHeight: true, - //plugins: [editor], - //loadMask : true, - loadingText : 'Loading...', - border: false, - listeners: { - //rowdblclick: alert("ok"), - rowdblclick: function(){ - var objectSelected = workflow.variablesAction; - switch(objectSelected) - { - case 'grid': - var getObjectGridRow = workflow.gridObjectRowSelected; - var FieldSelected = workflow.gridField; - //getting selected row of variables - var rowSelected = this.getSelectionModel().getSelected(); - var rowLabel = rowSelected.data.variable; - - //Assigned new object with condition - if(typeof getObjectGridRow.colModel != 'undefined') - getObjectGridRow.colModel.config[3].editor.setValue(rowLabel); - //Assigning / updating Condition for a row - else - getObjectGridRow[0].set(FieldSelected,rowLabel); - - if(FieldSelected=='CTO_CONDITION') - { - Ext.Ajax.request({ - url : '../tracker/tracker_ConditionsSave.php', - method: 'POST', - params: - { - PRO_UID : pro_uid, - CTO_UID : getObjectGridRow[0].data.CTO_UID, - CTO_CONDITION : getObjectGridRow[0].data.CTO_CONDITION - }, - success: function (response){ - Ext.MessageBox.alert ('Status','Objects has been edited successfully '); - } - }) - } - else if (FieldSelected=='STEP_CONDITION') - { - Ext.Ajax.request({ - url : '../steps/conditions_Save.php', - method: 'POST', - params: - { - PRO_UID : pro_uid, - STEP_UID : getObjectGridRow[0].data.STEP_UID, - STEP_CONDITION : getObjectGridRow[0].data.STEP_CONDITION - }, - success: function (response){ - Ext.MessageBox.alert ('Status','Objects has been edited successfully '); - } - }) - } - else if (FieldSelected=='ST_CONDITION') - { - Ext.Ajax.request({ - url : '../steps/steps_Ajax.php', - method: 'POST', - params: - { - action : 'saveTriggerCondition', - PRO_UID : pro_uid, - STEP_UID : getObjectGridRow[0].data.STEP_UID, - ST_CONDITION : getObjectGridRow[0].data.STEP_CONDITION, - TAS_UID : taskId, - TRI_UID : getObjectGridRow[0].data.TRI_UID, - ST_TYPE : getObjectGridRow[0].data.ST_TYPE - - }, - success: function (response){ - Ext.MessageBox.alert ('Status','Objects has been edited successfully '); - } - }) - } - - window.hide(); - - - break; - case 'form': - FormSelected = workflow.formSelected; - rowSelected = this.getSelectionModel().getSelected(); - FieldSelected = workflow.fieldName; - rowLabel = rowSelected.data.variable; - var value = FormSelected.getForm().findField(FieldSelected).setValue(rowLabel); - window.hide(); - break; - - } - - } - } - }] - },{ - title:_('ID_SYSTEM'), - id:'system', - layout:'form', - listeners:{ - activate: function(tabPanel){ - // use {@link Ext.data.HttpProxy#setUrl setUrl} to change the URL for *just* this request. - var link = 'bpmn/proxyExtjs?pid='+pro_uid+'&action=getVariables&type='+tabPanel.id+'&sFieldName=form[CTO_CONDITION]&sSymbol=@@'; - varStore.proxy.setUrl(link, true); - varStore.load(); - } - }, - items:[{ - xtype: 'grid', - ds: varStore, - cm: varColumns, - width: 380, - autoHeight: true, - //plugins: [editor], - //loadMask : true, - loadingText : 'Loading...', - border: false, - listeners: { - //rowdblclick: alert("ok"), - rowdblclick: function(){ - var objectSelected = workflow.variablesAction; - switch(objectSelected) - { - case 'grid': - var getObjectGridRow = workflow.gridObjectRowSelected; - var FieldSelected = workflow.gridField; - //getting selected row of variables - var rowSelected = this.getSelectionModel().getSelected(); - var rowLabel = rowSelected.data.variable; - //Assigned new object with condition - if(typeof getObjectGridRow.colModel != 'undefined') - getObjectGridRow.colModel.config[3].editor.setValue(rowLabel); - //Assigning / updating Condition for a row - else - getObjectGridRow[0].set(FieldSelected,rowLabel); - if(CTO_UID!='') - { - Ext.Ajax.request({ - url : '../tracker/tracker_ConditionsSave.php', - method: 'POST', - params: - { - PRO_UID : pro_uid, - CTO_UID : getObjectGridRow[0].data.CTO_UID, - CTO_CONDITION : getObjectGridRow[0].data.CTO_CONDITION - }, - success: function (response){ - Ext.MessageBox.alert ('Status','Objects has been edited successfully '); - } - }) - window.hide(); - } - - break; - case 'form': - FormSelected = workflow.formSelected; - rowSelected = this.getSelectionModel().getSelected(); - FieldSelected = workflow.fieldName; - rowLabel = rowSelected.data.variable; - var value = FormSelected.getForm().findField(FieldSelected).setValue(rowLabel); - window.hide(); - break; - - } - - } - } - }] - },{ - title:_('ID_CASESLIST_APP_PRO_TITLE'), - id :'process', - layout:'form', - listeners: { - activate: function(tabPanel){ - // use {@link Ext.data.HttpProxy#setUrl setUrl} to change the URL for *just* this request. - var link = 'bpmn/proxyExtjs?pid='+pro_uid+'&action=getVariables&type='+tabPanel.id+'&sFieldName=form[CTO_CONDITION]&sSymbol=@@'; - varStore.proxy.setUrl(link, true); - varStore.load(); - } - }, - items:[{ - xtype: 'grid', - ds: varStore, - cm: varColumns, - width: 380, - autoHeight: true, - //plugins: [editor], - //loadMask : true, - loadingText : 'Loading...', - border: false, - listeners: { - //rowdblclick: alert("ok"), - rowdblclick: function(){ - var objectSelected = workflow.variablesAction; - switch(objectSelected) - { - case 'grid': - var getObjectGridRow = workflow.gridObjectRowSelected; - var FieldSelected = workflow.gridField; - //getting selected row of variables - var rowSelected = this.getSelectionModel().getSelected(); - var rowLabel = rowSelected.data.variable; - //Assigned new object with condition - if(typeof getObjectGridRow.colModel != 'undefined') - getObjectGridRow.colModel.config[3].editor.setValue(rowLabel); - //Assigning / updating Condition for a row - else - getObjectGridRow[0].set(FieldSelected,rowLabel); - Ext.Ajax.request({ - url : '../tracker/tracker_ConditionsSave.php', - method: 'POST', - params: - { - PRO_UID : pro_uid, - CTO_UID : getObjectGridRow[0].data.CTO_UID, - CTO_CONDITION : getObjectGridRow[0].data.CTO_CONDITION - }, - success: function (response){ - Ext.MessageBox.alert ('Status','Objects has been edited successfully '); - } - }) - window.hide(); - break; - case 'form': - FormSelected = workflow.formSelected; - rowSelected = this.getSelectionModel().getSelected(); - FieldSelected = workflow.fieldName; - rowLabel = rowSelected.data.variable; - var value = FormSelected.getForm().findField(FieldSelected).setValue(rowLabel); - window.hide(); - break; - - } - - } - } - }] - }] - } - - }); - - var window = new Ext.Window({ - title: _('ID_VARIABLES'), - collapsible: false, - maximizable: false, - scrollable: true, - width: 400, - height: 350, - minWidth: 200, - minHeight: 150, - autoScroll: true, - layout: 'fit', - plain: true, - buttonAlign: 'center', - items: [varForm] - }); - window.show(); -} diff --git a/workflow/engine/templates/bpmn/ProcessOptions.js b/workflow/engine/templates/bpmn/ProcessOptions.js deleted file mode 100755 index 373200f8a..000000000 --- a/workflow/engine/templates/bpmn/ProcessOptions.js +++ /dev/null @@ -1,3911 +0,0 @@ -var workflow = {}; - -var ProcessOptions = function(id){ - //Workflow.call(this,id); -}; - -//ProcessOptions.prototype=new Workflow; -//ProcessOptions.prototype.type="ProcessOptions"; - -/** - * 'addDynaform' function that will allow adding new dynaforms and showing list of - * dynaforms available - */ -ProcessOptions.prototype.addDynaform= function(_5625) -{ - var dynaFields = Ext.data.Record.create([ - {name: 'DYN_UID'}, - {name: 'DYN_TYPE'}, - {name: 'DYN_TITLE'}, - {name: 'DYN_DESCRIPTION'}, - {name: 'TAS_EDIT'}, - {name: 'TAS_VIEW'}, - {name: 'ACTION'} - ]); - - var editor = new Ext.ux.grid.RowEditor({ - saveText: 'Update' - }); - - var btnAdd = new Ext.Button({ - id: 'btnEdit', - text: _('ID_NEW'), - iconCls: 'button_menu_ext ss_sprite ss_add', - //iconCls: 'application_add', - handler: function () { - dynaformDetails.getForm().reset(); - dynaformDetails.getForm().items.items[0].focus('',200); - dynaformDetails.getForm().items.items[1].setValue('normal'); - formWindow.show(); - } - }); - - //edit dynaform Function - var editDynaform = function() { - var rowSelected = Ext.getCmp('dynaformGrid').getSelectionModel().getSelected(); - - if( rowSelected ) { - //location.href = '../dynaforms/dynaforms_Editor?PRO_UID='+pro_uid+'&DYN_UID='+rowSelected.data.DYN_UID+'&bpmn=1' - var url = 'dynaforms/dynaforms_Editor?PRO_UID='+pro_uid+'&DYN_UID='+rowSelected.data.DYN_UID+'&bpmn=1'; - Ext.getCmp('mainTabPanel')._addTabFrame(rowSelected.data.DYN_UID, rowSelected.data.DYN_TITLE, url); - } else - PMExt.error('', _('ID_NO_SELECTION_WARNING')); - } - - var removeDynaform = function() { - ids = Array(); - - editor.stopEditing(); - var rowsSelected = Ext.getCmp('dynaformGrid').getSelectionModel().getSelections(); - - if( rowsSelected.length == 0 ) { - PMExt.error('', _('ID_NO_SELECTION_WARNING')); - return false; - } - - for(i=0; i"+TRANSLATIONS.ID_DESCRIPTION+": {DYN_DESCRIPTION}

") - }); - - var dynaformColumns = new Ext.grid.ColumnModel({ - defaults: { - width: 90, - sortable: true - }, - columns: [ - expander, - { - header: _('ID_TITLE_FIELD'), - dataIndex: 'DYN_TITLE', - width: 280 - },{ - header: _('ID_TYPE'), - dataIndex: 'DYN_TYPE', - width: 90 - },{ - sortable: false, - header: _('ID_TAS_EDIT'), - dataIndex: 'TAS_EDIT', - width: 110 - },{ - sortable: false, - header: _('ID_TAS_VIEW'), - dataIndex: 'TAS_VIEW', - width: 110 - } - ] - }); - - - var addTableColumns = new Ext.grid.ColumnModel({ - columns: [ - new Ext.grid.RowNumberer(), - { - id: 'FLD_NAME', - header: _('ID_PRIMARY_KEY'), - dataIndex: 'FLD_NAME', - width: 200, - editable: false, - sortable: true, - editor: new Ext.form.TextField({ - allowBlank: false - }) - },{ - id: 'PRO_VARIABLE', - header: _('ID_VARIABLES'), - dataIndex: 'PRO_VARIABLE', - width: 200, - sortable: true, - editor: new Ext.form.TextField({ - allowBlank: false - }) - },{ - sortable: false, - renderer: function(val){return '';} - } - ] - }); - - var dynaformGrid = new Ext.grid.GridPanel({ - store: taskDynaform, - id : 'dynaformGrid', - loadMask: true, - loadingText: 'Loading...', - //renderTo: 'cases-grid', - frame: false, - autoHeight:false, - minHeight:400, - height :400, - width: '', - layout: 'fit', - cm: dynaformColumns, - stateful : true, - stateId : 'grid', - plugins: expander, - stripeRows: true, - tbar: tb, - bbar: new Ext.PagingToolbar({ - pageSize: 10, - store: taskDynaform, - displayInfo: true, - displayMsg: 'Displaying dynaforms {0} - {1} of {2}', - emptyMsg: "No users to display", - items:[] - }), - viewConfig: {forceFit: true} - }); - - //connecting context menu to grid - dynaformGrid.addListener('rowcontextmenu', onDynaformsContextMenu,this); - dynaformGrid.addListener('rowdblclick', editDynaform,this); - - //by default the right click is not selecting the grid row over the mouse - //we need to set this four lines - dynaformGrid.on('rowcontextmenu', function (grid, rowIndex, evt) { - var sm = grid.getSelectionModel(); - sm.selectRow(rowIndex, sm.isSelected(rowIndex)); - }, this); - - //prevent default - dynaformGrid.on('contextmenu', function (evt) { - evt.preventDefault(); - }, this); - - function onDynaformsContextMenu(grid, rowIndex, e) { - e.stopEvent(); - var coords = e.getXY(); - dynaformsContextMenu.showAt([coords[0], coords[1]]); - } - - var dynaformsContextMenu = new Ext.menu.Menu({ - id: 'messageContextMenu', - items: [{ - text: _('ID_EDIT'), - iconCls: 'button_menu_ext ss_sprite ss_pencil', - handler: editDynaform - },{ - text: _('ID_DELETE'), - icon: '/images/delete.png', - handler: removeDynaform - },{ - text: _('ID_UID'), - handler: function(){ - var rowSelected = Ext.getCmp('dynaformGrid').getSelectionModel().getSelected(); - workflow.createUIDButton(rowSelected.data.DYN_UID); - } - } - ] - }); - - - - var dynaformDetails = new Ext.FormPanel({ - labelWidth : 100, - buttonAlign : 'center', - width : 490, - height : 420, - bodyStyle : 'padding:10px 0 0 10px;', - autoHeight: true, - items: - [ -// { -// xtype: 'fieldset', -// layout: 'fit', -// border:true, -// title: _('ID_SELECT_DYNAFORM'), -// width: 500, -// collapsible: false, -// labelAlign: 'top', -// items:[{ -// xtype: 'radiogroup', -// //id: 'dynaformType', -// layout: 'fit', -// fieldLabel: _('ID_TYPE'), -// itemCls: 'x-check-group-alt', -// columns: 1, -// items: [ -// { -// boxLabel: _('ID_BLANK_DYNAFORM'), -// name: 'DYN_SOURCE', -// inputValue: 'blankDyna', -// checked: true -// }, -// { -// boxLabel: _('ID_PM_DYNAFORM'), -// name: 'DYN_SOURCE', -// inputValue: 'pmTableDyna' -// }], -// listeners: { -// change: function(radiogroup, radio) { -// if(radio.inputValue == 'blankDyna') -// { -// Ext.getCmp("blankDynaform").show(); -// var f = form.findField('yourField'); -// f.container.up('div.x-form-item').hide(); -// } -// else -// { -// Ext.getCmp("blankDynaform").hide(); -// Ext.getCmp("pmTableDynaform").show(); -// } -// } -// } -// }] -// }, - - { - xtype: 'fieldset', - id: 'blankDynaform', - border:true, - hidden: false, - title: _('ID_DYNAFORM_INFORMATION'), - width: 500, - items:[{ - xtype : 'textfield', - fieldLabel: _('ID_TITLE'), - name : 'DYN_TITLE1', - width : 350, - allowBlank: false - },{ - width : 350, - xtype : 'combo', - allowBlank : false, - mode : 'local', - editable : false, - fieldLabel : _('ID_TYPE'), - triggerAction : 'all', - forceSelection : true, - name : 'DYN_TYPE', - valueField : 'value', - displayField : 'name', - value : 'normal', - store : new Ext.data.JsonStore({ - fields : ['value', 'name'], - data : [ - {value: 'normal', name : _('ID_NORMAL')}, - {value: 'grid', name : _('ID_GRID')} - ] - }) - },{ - xtype : 'textarea', - fieldLabel: _('ID_DESCRIPTION'), - name : 'DYN_DESCRIPTION1', - height : 120, - width : 350 - } - ] - } -// ,{ -// xtype: 'fieldset', -// id: 'pmTableDynaform', -// border:true, -// hidden: true, -// title: 'Dynaform Information', -// width: 500, -// items:[{ -// width: 350, -// xtype: 'combo', -// mode: 'local', -// editable: true, -// triggerAction: 'all', -// forceSelection: true, -// fieldLabel: _('ID_CREATE_PM_TABLE'), -// emptyText : 'Select Table', -// displayField: 'ADD_TAB_NAME', -// valueField: 'ADD_TAB_UID', -// value : '---------------------------', -// store : additionalTables, -// onSelect: function(record, index){ -// var link = 'bpmn/proxyExtjs?tabId='+record.data.ADD_TAB_UID+'&action=getPMTableDynaform'; -// tablesFieldsStore.proxy.setUrl(link, true); -// tablesFieldsStore.load(); -// -// Ext.getCmp("fieldsGrid").show(); -// Ext.getCmp("pmTable").setValue(record.data.ADD_TAB_UID); -// -// this.setValue(record.data[this.valueField || this.displayField]); -// this.collapse(); -// } -// },{ -// xtype:'hidden',//<--hidden field -// name:'ADD_TABLE', -// id :'pmTable' -// }, -// { -// xtype : 'textfield', -// fieldLabel: _('ID_TITLE'), -// name : 'DYN_TITLE2', -// allowBlank: false, -// width : 350 -// },{ -// xtype : 'textarea', -// fieldLabel: _('ID_DESCRIPTION'), -// name : 'DYN_DESCRIPTION2', -// height : 120, -// width : 350 -// }, -// { -// xtype: 'grid', -// id:'fieldsGrid', -// hidden: true, -// store: tablesFieldsStore, -// cm: addTableColumns, -// width: 500, -// //height: 300, -// autoHeight: true, -// clicksToEdit: 1, -// plugins: [editor], -// //loadMask : true, -// loadingText : 'Loading...', -// border: false -// //renderTo : Ext.getBody() -// } -// ] -// } - ], buttons: [{ - text: _('ID_SAVE'), - handler: function(){ - var getForm = dynaformDetails.getForm().getValues(); - //var sDynaformType = getForm.DYN_TYPE; - var sDynaformType = dynaformDetails.getForm().items.items[1].getValue(); - if ( sDynaformType == 'normal' || sDynaformType == '' ) - sDynaformType = 'xmlform'; - else - sDynaformType = 'grid'; - -// if ( getForm.DYN_SOURCE == 'blankDyna') -// { - var sTitle = getForm.DYN_TITLE1; - var sDesc = getForm.DYN_DESCRIPTION1; -// } -// else -// { -// var sAddTab = getForm.ADD_TABLE; -// var aStoreFields = tablesFieldsStore.data.items; -// var fName = new Array(); -// var pVar = new Array(); -// for(var i=0;i"+TRANSLATIONS.ID_DESCRIPTION+": {DBS_DESCRIPTION}

" - ) - }); - - - var dbGridColumn = new Ext.grid.ColumnModel({ - columns: [ - expander, - { - id: 'DBS_TYPE', - header: _('ID_TYPE'), - dataIndex: 'DBS_TYPE', - //width: 100, - editable: false, - sortable: true, - editor: new Ext.form.TextField({ - //allowBlank: false - }) - },{ - id: 'DBS_SERVER', - header: _('ID_SERVER'), - dataIndex: 'DBS_SERVER', - //width: 100, - sortable: true, - editor: new Ext.form.TextField({ - //allowBlank: false - }) - },{ - id: 'DBS_DATABASE_NAME', - header: _('ID_DATABASE_NAME'), - dataIndex: 'DBS_DATABASE_NAME', - width: 150, - sortable: true, - editor: new Ext.form.TextField({ - // allowBlank: false - }) - },{ - id: 'DBS_DESCRIPTION', - header: _('ID_DESCRIPTION'), - dataIndex: 'DBS_DESCRIPTION', - width: 100, - sortable: true, - editor: new Ext.form.TextField({ - }) - } - ] - }); - - var dbGrid = new Ext.grid.GridPanel({ - store: dbStore, - id : 'dbConnGrid', - loadMask: true, - loadingText: 'Loading...', - //renderTo: 'cases-grid', - frame: false, - autoHeight:false, - clicksToEdit: 1, - width:480, - minHeight:400, - height :380, - layout: 'fit', - cm: dbGridColumn, - plugins: expander, - stripeRows: true, - tbar: tb, - bbar: new Ext.PagingToolbar({ - pageSize: 10, - store: dbStore, - displayInfo: true, - displayMsg: 'Displaying DB Connection {0} - {1} of {2}', - emptyMsg: "No DB Connection to display", - items:[] - }), - viewConfig: {forceFit: true} - }); - - //connecting context menu to grid - dbGrid.addListener('rowcontextmenu', ondbGridContextMenu,this); - - //by default the right click is not selecting the grid row over the mouse - //we need to set this four lines - dbGrid.on('rowcontextmenu', function (grid, rowIndex, evt) { - var sm = grid.getSelectionModel(); - sm.selectRow(rowIndex, sm.isSelected(rowIndex)); - }, this); - - //prevent default - dbGrid.on('contextmenu', function (evt) { - evt.preventDefault(); - }, this); - - function ondbGridContextMenu(grid, rowIndex, e) { - e.stopEvent(); - var coords = e.getXY(); - dbGridContextMenu.showAt([coords[0], coords[1]]); - } - - var dbGridContextMenu = new Ext.menu.Menu({ - id: 'messageContextMenu', - items: [{ - text: _('ID_EDIT'), - iconCls: 'button_menu_ext ss_sprite ss_pencil', - handler: editDBConn - },{ - text: _('ID_DELETE'), - icon: '/images/delete.png', - handler: removeDBConn - },{ - text: _('ID_UID'), - handler: function(){ - var rowSelected = Ext.getCmp('dbConnGrid').getSelectionModel().getSelected(); - workflow.createUIDButton(rowSelected.data.DBS_UID); - } - } - ] - }); - - - var dbconnForm =new Ext.FormPanel({ - // title:"Add new Database Source", - collapsible: false, - maximizable: true, - //allowBlank:false, - width:400, - frame:false, - autoDestroy : true, - monitorValid : true, - plain: true, - bodyStyle : 'padding:10px 0 0 10px;', - buttonAlign: 'center', - items:[{ - xtype: 'combo', - width: 200, - mode: 'local', - editable: false, - fieldLabel: _('ID_ENGINE'), - triggerAction: 'all', - forceSelection: true, - name: 'DBS_TYPE', - displayField: 'name', - emptyText : 'Select Format', - valueField : 'value', - allowBlank: false, - //value : 'Select', - store: new Ext.data.JsonStore({ - fields : ['name', 'value'], - data : [ - {name : 'Select', value: 'select'}, - {name : 'MySql', value: 'MySql'}, - {name : 'PostGreSql', value: 'PostGreSql'}, - {name : 'Microsoft SQL server', value: 'Microsoft SQL server'} - ]}), - onSelect: function(record, index) { - //Show-Hide Format Type Field - if(record.data.value == 'MySql') - { - Ext.getCmp("encode").show(); - Ext.getCmp("postgre").hide(); - dbconnForm.getForm().findField('DBS_PORT').setValue('3306'); - } - else if(record.data.value == 'PostGreSql') - { - Ext.getCmp("postgre").show(); - Ext.getCmp("encode").hide(); - dbconnForm.getForm().findField('DBS_PORT').setValue('5432'); - } - else - { - Ext.getCmp("sqlserver").show(); - Ext.getCmp("postgre").hide(); - dbconnForm.getForm().findField('DBS_PORT').setValue('1433'); - } - this.setValue(record.data[this.valueField || this.displayField]); - this.collapse(); - } - },{ - xtype: 'fieldset', - id: 'encode', - border:false, - hidden: true, - items: [{ - xtype: 'combo', - width: 220, - mode: 'local', - // hidden: true, - editable: false, - fieldLabel: _('ID_ENCODE'), - triggerAction: 'all', - forceSelection: true, - //dataIndex : 'ENGINE', - displayField: 'value', - valueField: 'name', - name: 'DBS_ENCODE', - store: new Ext.data.JsonStore({ - fields : ['name', 'value'], - data : [ - {name:'armscii8', value:'armscii8 - ARMSCII-8 Armenian'}, - {name:'ascii', value:'ascii - US ASCII'}, - {name:'big5', value:'big5 - Big5 Traditional Chinese'}, - {name:'binary', value: 'binary - Binary pseudo charset'}, - {name:'cp850', value:'cp850 - DOS West European'}, - {name:'cp852', value: 'cp852 - DOS Central European'}, - {name:'cp866', value:'cp866 - DOS Russian'}, - {name:'cp932', value: 'cp932] - SJIS for Windows Japanese'}, - {name:'cp1250', value: 'cp1250 - Windows Central European'}, - {name:'cp1251', value: 'cp1251 - Windows Cyrillic'}, - {name:'cp1256', value: 'cp1256 - Windows Arabic'}, - {name:'cp1257', value: 'cp1257 - Windows Baltic'}, - {name:'dec8', value:'dec8 - DEC West European'}, - {name:'eucjpms', value: 'eucjpms - UJIS for Windows Japanese'}, - {name:'euckr', value: 'euckr - EUC-KR Korean'}, - {name:'gb2312', value: 'gb2312 - GB2312 Simplified Chinese'}, - {name:'gbk', value: 'gbk - GBK Simplified Chinese'}, - {name:'geostd8', value: 'geostd8 - GEOSTD8 Georgian'}, - {name:'greek', value: 'greek - ISO 8859-7 Greek'}, - {name:'hebrew', value: 'hebrew - ISO 8859-8 Hebrew'}, - {name:'hp8', value: 'hp8 - HP West European'}, - {name:'keybcs2', value: 'keybcs2 - DOS Kamenicky Czech-Slovak'}, - {name:'koi8r', value:'koi8r - KOI8-R Relcom Russian'}, - {name:'koi8u', value: 'koi8u - KOI8-U Ukrainian'}, - {name:'latin1', value:'latin1 - cp1252 West European'}, - {name:'latin2', value:'latin2 - ISO 8859-2 Central European'}, - {name:'latin5', value:'latin5 - ISO 8859-9 Turkish'}, - {name:'latin7', value: 'atin7 - ISO 8859-13 Baltic'}, - {name:'macce', value: 'macce - Mac Central European'}, - {name:'macroman', value:'macroman - Mac West European'}, - {name:'sjis', value:'sjis - Shift-JIS Japanese'}, - {name:'swe7', value:'swe7 - 7bit Swedish'}, - {name:'tis620', value: 'tis620 - TIS620 Thai'}, - {name:'ucs2', value:'ucs2 - UCS-2 Unicode'}, - {name:'ujis', value:'ujis - EUC-JP Japanese'}, - {name:'utf8', value:'utf8 - UTF-8 Unicode'} - ]}), - onSelect: function(record, index){ - dbconnForm.getForm().findField('DBS_ENCODE').setValue(record.data.value); - this.setValue(record.data[this.valueField || this.displayField]); - this.collapse(); - } - }] - - },{ - xtype: 'fieldset', - id: 'postgre', - border:false, - hidden: true, - items:[{ - xtype: 'combo', - width: 220, - mode: 'local', - // hidden: true, - editable:false, - fieldLabel:_('ID_ENCODE'), - triggerAction: 'all', - forceSelection: true, - //dataIndex : 'ENGINE', - displayField: 'name', - valueField: 'value', - name: 'DBS_ENCODE', - store: new Ext.data.JsonStore({ - fields : ['name', 'value'], - data : [ - {name:"BIG5", value:"BIG5"}, - {name:"EUC_CN", value:"EUC_CN"}, - {name:"EUC_JP", value:"EUC_JP"}, - {name:"EUC_KR", value:"EUC_KR"}, - {name:"EUC_TW", value:"EUC_TW"}, - {name:"GB18030", value:"GB18030"}, - {name:"GBK", value:"GBK"}, - {name:"ISO_8859_5", value:"ISO_8859_5"}, - {name:"ISO_8859_6", value:"ISO_8859_6"}, - {name:"ISO_8859_7", value:"ISO_8859_7"}, - {name:"ISO_8859_8", value: "ISO_8859_8"}, - {name:"JOHAB", value:"JOHAB"}, - {name:"KOI8", value: "KOI8"}, - {name:"selected", value: "LATIN1"}, - {name:"LATIN2", value:"LATIN2"}, - {name:"LATIN3", value:"LATIN3"}, - {name:"LATIN4", value: "LATIN4"}, - {name:"LATIN5", value:"LATIN5"}, - {name:"LATIN6", value: "LATIN6"}, - {name:"LATIN7", value:"LATIN7"}, - {name:"LATIN8", value:"LATIN8"}, - {name:"LATIN9", value:"LATIN9"}, - {name:"LATIN10", value:"LATIN10"}, - {name:"SJIS", value:"SJIS"}, - {name:"SQL_ASCII", value:"SQL_ASCII"}, - {name:"UHC", value: "UHC"}, - {name:"UTF8", value: "UTF8"}, - {name:"WIN866", value: "WIN866"}, - {name:"WIN874", value:"WIN874"}, - {name:"WIN1250", value:"WIN1250"}, - {name:"WIN1251", value:"WIN1251"}, - {name:"WIN1252", value:"WIN1252"}, - {name:"WIN1256", value:"WIN1256"}, - {name:"WIN1258", value:"WIN1258"} - ]}), - onSelect: function(record, index){ - dbconnForm.getForm().findField('DBS_ENCODE').setValue(record.data.value); - this.setValue(record.data[this.valueField || this.displayField]); - this.collapse(); - } - }] - },{ - xtype: 'fieldset', - id: 'sqlserver', - border:false, - hidden: true, - items:[{ - xtype: 'combo', - width: 220, - mode: 'local', - editable: false, - fieldLabel: _('ID_ENCODE'), - triggerAction: 'all', - forceSelection: true, - //dataIndex : 'ENGINE', - displayField: 'name', - valueField: 'value', - name: 'DBS_ENCODE', - store: new Ext.data.JsonStore({ - fields : ['name', 'value'], - data : [ - {name:'utf8', value: 'utf8'} - ]}), - onSelect: function(record, index){ - dbconnForm.getForm().findField('DBS_ENCODE').setValue(record.data.value); - this.setValue(record.data[this.valueField || this.displayField]); - this.collapse(); - } - }] - - },{ - xtype: 'textfield', - fieldLabel: _('ID_SERVER'), - name: 'DBS_SERVER', - width: 200, - allowBlank: false - },{ - xtype: 'textfield', - fieldLabel: _('ID_DATABASE_NAME'), - name: 'DBS_DATABASE_NAME', - width: 200, - allowBlank: false - },{ - xtype: 'textfield', - fieldLabel: _('ID_USERNAME'), - name: 'DBS_USERNAME', - width: 200, - allowBlank: false - },{ - xtype: 'textfield', - fieldLabel: _('ID_CACHE_PASSWORD'), - inputType:'password', - width: 200, - name: 'DBS_PASSWORD', - allowBlank: true - },{ - xtype: 'textfield', - fieldLabel: _('ID_PORT'), - name: 'DBS_PORT', - width: 200, - //id:'port', - //allowBlank: false, - editable:false - },{ - xtype: 'textarea', - fieldLabel: _('ID_DESCRIPTION'), - name: 'DBS_DESCRIPTION', - allowBlank: true, - width: 220, - height:100 - },{ - id : 'DBS_UID', - xtype: 'hidden', - name : 'DBS_UID' - },{ - id : 'DBS_ENCODE', - xtype: 'hidden', - name : 'DBS_ENCODE' - }], - buttons: [{text:_('ID_TEST_CONNECTION'), - id: 'test', - //formbind: true, - handler: function(){ - // testConnWindow.show(); - } - },{ - text: _('ID_SAVE'), - formBind :true, - handler: function(){ - var getForm = dbconnForm.getForm().getValues(); - var dbConnUID = getForm.DBS_UID; - var Type = getForm.DBS_TYPE; - var Server = getForm.DBS_SERVER; - var DatabaseName = getForm.DBS_DATABASE_NAME; - var Username = getForm.DBS_USERNAME; - var Password = getForm.DBS_PASSWORD; - var Port = getForm.DBS_PORT; - var Description = getForm.DBS_DESCRIPTION; - var encode = getForm.DBS_ENCODE; - - - if(dbConnUID=='') - { - Ext.Ajax.request({ - url : '../dbConnections/dbConnectionsAjax.php', - method: 'POST', - params:{ - dbs_uid :dbConnUID, - type :Type, - server :Server, - db_name :DatabaseName, - user :Username , - passwd :Password, - port :Port, - desc :Description, - PROCESS :pro_uid, - enc :encode, - action :'saveConnection' - }, - success: function(response) { - PMExt.notify( _('ID_STATUS') , _('ID_DBS_CONNECTION_SAVE') ); - } - }); - } - else - { - Ext.Ajax.request({ - url : '../dbConnections/dbConnectionsAjax.php', - method: 'POST', - params:{ - dbs_uid :dbConnUID, - type :Type, - server :Server, - db_name :DatabaseName, - user :Username , - passwd :Password, - port :Port, - PROCESS :pro_uid, - desc :Description, - enc :encode, - action :'saveEditConnection' - }, - success: function(response) { - PMExt.notify( _('ID_STATUS') , _('ID_DBS_CONNECTION_EDIT') ); - } - }); - } - formWindow.hide(); - dbStore.reload(); - } - },{ - text: _('ID_CANCEL'), - handler: function(){ - // when this button clicked, - formWindow.hide(); - } - }] - }) - - - var formWindow = new Ext.Window({ - title: _('ID_DBS_SOURCE'), - collapsible: false, - maximizable: true, - width: 400, - //autoHeight: true, - //height: 400, - //layout: 'fit', - plain: true, - buttonAlign: 'center', - items: dbconnForm - }); - - var gridWindow = new Ext.Window({ - title: _('ID_DBS_LIST'), - collapsible: false, - maximizable: true, - width: 480, - //autoHeight: true, - height: 350, - //layout: 'fit', - plain: true, - buttonAlign: 'center', - items: dbGrid - }); - gridWindow.show(); -} -*/ - -ProcessOptions.prototype.addInputDoc= function(_5625) -{ - var gridWidow; - var inputDocGrid; - var inputDocStore; - var expander; - var inputDocColumns; - var render_version; - var newButton; - var editButton; - var deleteButton; - var saveButton; - var cancelButton; - var smodel; - var bbarpaging; - var idocsContextMenu; - var newIDocWindow; - var inputDocForm; - - //Renderer for Versioning Field - render_version = function(value){ - var out = ''; - switch(value){ - case '0': out = 'No'; break; - case '1': out = 'Yes'; break; - } - return out; - } - - - - newButton = new Ext.Action({ - text : _('ID_NEW'), - iconCls: 'button_menu_ext ss_sprite ss_add', - handler: function(){ - inputDocForm.getForm().reset(); - Ext.getCmp('idoc_FORM_NEEDED').setValue('VIRTUAL'); - Ext.getCmp('idoc_VERSIONING').setValue('0'); - inputDocForm.getForm().findField('INP_DOC_TAGS').setValue('INPUT'); - inputDocForm.getForm().findField('PRO_UID').setValue(pro_uid); - newIDocWindow.setTitle(_('ID_NEW_INPUTDOCS')); - newIDocWindow.show(); - } - }); - - editButton = new Ext.Action({ - text : _('ID_EDIT'), - iconCls: 'button_menu_ext ss_sprite ss_pencil', - disabled: true, - handler: function(){ - Ext.getCmp('designerTab').getEl().mask(_('ID_PROCESSING')); - rowselected = inputDocGrid.getSelectionModel().getSelected(); - Ext.Ajax.request({ - url: 'processOptionsProxy/loadInputDoc', - params: {IDOC_UID: rowselected.data.INP_DOC_UID}, - success: function(r,o){ - Ext.getCmp('designerTab').getEl().unmask(); - var res = Ext.decode(r.responseText); - if (res.success){ - inputDocForm.getForm().reset(); - Ext.getCmp('idoc_FORM_NEEDED').setValue(res.data.INP_DOC_FORM_NEEDED); - if (res.data.INP_DOC_FORM_NEEDED != 'VIRTUAL'){ - Ext.getCmp('formType').setValue(res.data.INP_DOC_ORIGINAL); - Ext.getCmp("formType").enable(); - } - Ext.getCmp('idoc_VERSIONING').setValue(res.data.INP_DOC_VERSIONING); - inputDocForm.getForm().findField('INP_DOC_TITLE').setValue(res.data.INP_DOC_TITLE); - inputDocForm.getForm().findField('INP_DOC_DESCRIPTION').setValue(res.data.INP_DOC_DESCRIPTION); - inputDocForm.getForm().findField('INP_DOC_DESTINATION_PATH').setValue(res.data.INP_DOC_DESTINATION_PATH); - inputDocForm.getForm().findField('INP_DOC_TAGS').setValue(res.data.INP_DOC_TAGS); - inputDocForm.getForm().findField('INP_DOC_UID').setValue(res.data.INP_DOC_UID); - inputDocForm.getForm().findField('PRO_UID').setValue(pro_uid); - newIDocWindow.setTitle(_('ID_EDIT_INPUTDOCS')); - newIDocWindow.show(); - }else{ - PMExt.notify(_('ID_REQUEST_DOCUMENTS'),res.msg); - } - }, - failure: function(r,o){ - Ext.getCmp('designerTab').getEl().unmask(); - PMExt.notify( _('ID_STATUS') , _('ID_LOAD_FAILED')); - } - }); - } - }); - - deleteButton = new Ext.Action({ - text : _('ID_DELETE'), - iconCls: 'button_menu_ext ss_sprite ss_delete', - disabled: true, - handler : function(){ - Ext.getCmp('designerTab').getEl().mask(_('ID_PROCESSING')); - rowselected = inputDocGrid.getSelectionModel().getSelected(); - Ext.Ajax.request({ - url: 'processOptionsProxy/canDeleteInputDoc', - params: {PRO_UID: pro_uid, IDOC_UID: rowselected.data.INP_DOC_UID}, - success: function(r,o){ - Ext.getCmp('designerTab').getEl().unmask(); - var res = Ext.decode(r.responseText); - if (res.success){ - Ext.Msg.confirm(_('ID_CONFIRM'),_('ID_CONFIRM_DELETE_INPUT_DOC'), function(btn, text){ - if (btn=='yes'){ - Ext.getCmp('designerTab').getEl().mask(_('ID_PROCESSING')); - Ext.Ajax.request({ - url: 'processOptionsProxy/deleteInputDoc', - params: {PRO_UID: pro_uid, IDOC_UID: rowselected.data.INP_DOC_UID}, - success: function(r,o){ - Ext.getCmp('designerTab').getEl().unmask(); - var resp = Ext.decode(r.responseText); - if (resp.success){ - editButton.disable(); - deleteButton.disable(); - inputDocGrid.store.load(); - PMExt.notify(_('ID_REQUEST_DOCUMENTS'),resp.msg); - }else{ - PMExt.error(_('ID_ERROR'), resp.msg); - } - }, - failure: function(r,o){ - Ext.getCmp('designerTab').getEl().unmask(); - PMExt.notify( _('ID_STATUS') , _('ID_LOAD_FAILED')); - } - - }); - } - }); - }else{ - PMExt.warning(_('ID_REQUEST_DOCUMENTS'),_('ID_MSG_CANNOT_DELETE_INPUT_DOC')); - } - }, - failure: function(r,o){ - Ext.getCmp('designerTab').getEl().unmask(); - PMExt.notify( _('ID_STATUS') , _('ID_LOAD_FAILED')); - } - }); - } - }); - - saveButton = new Ext.Action({ - text : _('ID_SAVE'), - disabled: false, - handler: function(){ - Ext.getCmp('designerTab').getEl().mask(_('ID_PROCESSING')); - inputDocForm.getForm().submit({ - success: function(f,a){ - Ext.getCmp('designerTab').getEl().unmask(); - var resp = Ext.decode(a.response.responseText); - if (resp.success){ - editButton.disable(); - deleteButton.disable(); - inputDocGrid.store.load(); - Ext.getCmp('frmNewInputDoc').hide(); - PMExt.notify(_('ID_REQUEST_DOCUMENTS'),resp.msg); - }else{ - PMExt.notify( _('ID_ERROR') , resp.msg); - } - }, - failure: function(f,a){ - Ext.getCmp('designerTab').getEl().unmask(); - PMExt.notify( _('ID_REQUEST_DOCUMENTS') , _('ID_SOME_FIELDS_REQUIRED')); - } - }); - } - }); - - cancelButton = new Ext.Action({ - text : _('ID_CANCEL'), - disabled: false, - handler: function(){ - Ext.getCmp('frmNewInputDoc').hide(); - } - }); - - inputDocForm = new Ext.FormPanel({ - labelWidth: 10, - autoWidth : true, - height : 380, - monitorValid : true, - autoHeight: true, - buttonAlign: 'center', - url: 'processOptionsProxy/saveInputDoc', - items: [{ - xtype : 'fieldset', - layout : 'form', - border : true, - title : _('ID_INPUT_INFO'), - autoWidth : true, - labelWidth : 150, - collapsible : false, - labelAlign : '', - plain: false, - items : [ - {xtype: 'textfield', fieldLabel: _('ID_TITLE'),width: 300,name: 'INP_DOC_TITLE', allowBlank: false}, - { - width: 300, - xtype: 'combo', - mode: 'local', - editable: false, - fieldLabel: _('ID_TYPE'), - triggerAction: 'all', - name: 'INP_DOC_FORM_NEEDED', - displayField: 'name', - valueField : 'value', - id: 'idoc_FORM_NEEDED', - autoSelect: true, - allowBlank: false, - submitValue : false, - hiddenName: 'INP_DOC_FORM_NEEDED', - store: new Ext.data.JsonStore({ - fields : ['name', 'value'], - data : [ - {name : 'Digital', value: 'VIRTUAL'}, - {name : 'Printed', value: 'REAL'}, - {name : 'Digital/Printed', value: 'VREAL'} - ] - }), - onSelect: function(record, index) { - if(record.data.value != 'VIRTUAL') { - Ext.getCmp("formType").enable(); - } - else { - Ext.getCmp("formType").disable(); - } - this.collapse(); - this.setValue(record.data[this.valueField || this.displayField]); - } - }, - { - xtype : 'combo', - id : 'formType', - width : 150, - mode : 'local', - editable : false, - hiddenName : 'INP_DOC_ORIGINAL', - disabled : true, - submitValue : false, - fieldLabel : _('ID_FORMAT'), - triggerAction : 'all', - forceSelection : true, - displayField : 'name', - valueField : 'value', - allowBlank : false, - value : 'ORIGINAL', - store : new Ext.data.JsonStore({ - fields : ['name', 'value'], - data : [ - {name : 'Original', value: 'ORIGINAL'}, - {name : 'Legal Copy', value: 'COPYLEGAL'}, - {name : 'Copy', value: 'COPY'} - ]} - ) - }, - {xtype: 'textarea', fieldLabel: _('ID_DESCRIPTION'), name: 'INP_DOC_DESCRIPTION', height: 120, width: 300}, - { - width : 150, - xtype: 'combo', - mode: 'local', - editable: false, - fieldLabel: _('ID_ENABLE_VERSIONING'), - triggerAction: 'all', - forceSelection: true, - hiddenName: 'INP_DOC_VERSIONING', - id: 'idoc_VERSIONING', - submitValue: false, - displayField: 'name', - valueField: 'value', - value : '0', - allowBlank: false, - store: new Ext.data.JsonStore({ - fields : ['name', 'value'], - data : [ - {name : 'No', value: '0'}, - {name : 'Yes', value: '1'} - ]}) - }, - { - layout :'column', - border :false, - items :[{ - layout : 'form', - border :false, - items : [{ - xtype : 'textfield', - width : 250, - fieldLabel : _('ID_DESTINATION_PATH'), - name : 'INP_DOC_DESTINATION_PATH', - anchor :'100%' - }] - },{ - //columnWidth :.4, - layout : 'form', - border :false, - items : [{ - xtype :'button', - title : ' ', - width :50, - text : '@@', - name : 'selectorigin', - handler: function (s) { - workflow.variablesAction = 'form'; - workflow.fieldName = 'INP_DOC_DESTINATION_PATH' ; - workflow.variable = '@@', - workflow.formSelected = inputDocForm; - var rowData = PMVariables(); - } - }] - }] - },{ - layout :'column', - border :false, - items :[{ - //columnWidth :.6, - layout : 'form', - border :false, - items : [{ - xtype : 'textfield', - width : 250, - //id :'tags', - fieldLabel : _('ID_TAGS'), - name : 'INP_DOC_TAGS', - anchor :'100%' - }] - },{ - //columnWidth :.4, - layout : 'form', - border :false, - items : [{ - xtype :'button', - title : ' ', - width:50, - text : '@@', - name : 'selectorigin', - handler: function (s) { - workflow.variablesAction = 'form'; - workflow.fieldName = 'INP_DOC_TAGS' ; - workflow.variable = '@@', - workflow.formSelected = inputDocForm; - var rowData = PMVariables(); - } - }] - }] - }, - {id : 'INP_DOC_UID', xtype: 'hidden', name : 'INP_DOC_UID'}, - {id : 'PRO_UID', xtype: 'hidden', name : 'PRO_UID'} - ] - }], - buttons: [saveButton, cancelButton] - }); - - - smodel = new Ext.grid.RowSelectionModel({ - singleSelect: true, - listeners:{ - rowselect: function(sm){ - editButton.enable(); - deleteButton.enable(); - }, - rowdeselect: function(sm){ - editButton.disable(); - deleteButton.disable(); - } - } - }); - - idocsContextMenu = new Ext.menu.Menu({ - items: [editButton, deleteButton] - }); - - - inputDocStore = new Ext.data.GroupingStore( { - proxy : new Ext.data.HttpProxy({ - url: 'processOptionsProxy/loadInputDocuments?PRO_UID='+pro_uid - //params: {PRO_UID: pro_uid} - }), - reader : new Ext.data.JsonReader( { - root: 'idocs', - totalProperty: 'total_idocs', - fields : [ - {name: 'INP_DOC_UID', type: 'string'}, - {name: 'PRO_UID',type: 'string'}, - {name: 'INP_DOC_TITLE', type: 'string'}, - {name: 'INP_DOC_DESCRIPTION', type: 'string'}, - {name: 'INP_DOC_VERSIONING',type: 'string'}, - {name: 'INP_DOC_DESTINATION_PATH',type: 'string'}, - {name: 'INP_DOC_TASKS', type: 'int'} - ] - }) - }); - - bbarpaging = new Ext.PagingToolbar({ - pageSize: 10, - store: inputDocStore, - displayInfo: true, - displayMsg: _('ID_GRID_PAGE_DISPLAYING_ROLES_MESSAGE') + '    ', - emptyMsg: _('ID_GRID_PAGE_NO_ROLES_MESSAGE'), - items: [] - }); - - expander = new Ext.ux.grid.RowExpander({ - tpl : new Ext.Template("

"+TRANSLATIONS.ID_DESCRIPTION+": {INP_DOC_DESCRIPTION}

") - }); - - inputDocColumns = new Ext.grid.ColumnModel({ - defaults: { - editable: false, - sortable: true - }, - columns: [ - expander, - {id: 'INP_DOC_UID', dataIndex: 'INP_DOC_UID', hidden:true, hideable:false}, - {header: _('ID_TITLE'), dataIndex: 'INP_DOC_TITLE', width: 350}, - {header: _('ID_VERSIONING'), dataIndex: 'INP_DOC_VERSIONING', width: 100, renderer: render_version}, - {header: _('ID_DESTINATION_PATH'), dataIndex: 'INP_DOC_DESTINATION_PATH', width: 150}, - {header: _('ID_TASK'), dataIndex: 'INP_DOC_TASKS', width: 100, align: 'center'} - ] - }); - - inputDocGrid = new Ext.grid.GridPanel({ - store: inputDocStore, - cm: inputDocColumns, - sm: smodel, - id: 'inputdocGrid', - loadMask: true, - frame: false, - autoWidth: true, - clicksToEdit: 1, - height:100, - layout: 'fit', - plugins: expander, - stripeRows: true, - tbar: [newButton, '-', editButton, deleteButton], - bbar: bbarpaging, - viewConfig: {forceFit: true}, - view: new Ext.grid.GroupingView({ - forceFit:true, - groupTextTpl: '{text}' - }) - }); - - //connecting context menu to grid - inputDocGrid.addListener('rowcontextmenu', onInputDocContextMenu,this); - - //by default the right click is not selecting the grid row over the mouse - //we need to set this four lines - inputDocGrid.on('rowcontextmenu', function (grid, rowIndex, evt) { - var sm = grid.getSelectionModel(); - sm.selectRow(rowIndex, sm.isSelected(rowIndex)); - }, this); - - //prevent default - inputDocGrid.on('contextmenu', function (evt) { - evt.preventDefault(); - }, this); - - function onInputDocContextMenu(grid, rowIndex, e) { - e.stopEvent(); - var coords = e.getXY(); - idocsContextMenu.showAt([coords[0], coords[1]]); - } - - inputDocGrid.store.load(); - - gridWindow = new Ext.Window({ - title: _('ID_REQUEST_DOCUMENTS'), - width: 600, - height: 350, - minWidth: 200, - minHeight: 350, - layout: 'fit', - plain: true, - items: inputDocGrid, - autoScroll: true, - modal: true - }); - - newIDocWindow = new Ext.Window({ - title: _('ID_NEW_INPUTDOCS'), - width: 550, - id: 'frmNewInputDoc', - autoHeight: true, - autoScroll: true, - closable: false, - layout: 'fit', - plain: true, - modal: true, - items: inputDocForm - }); - - gridWindow.show(); -} - -ProcessOptions.prototype.addOutputDoc= function(_5625) -{ - - - var outputDocFields = Ext.data.Record.create([ - { - name: 'OUT_DOC_UID', - type: 'string' - }, - { - name: 'OUT_DOC_TYPE', - type: 'string' - }, - { - name: 'OUT_DOC_TITLE', - type: 'string' - }, - { - name: 'OUT_DOC_DESCRIPTION', - type: 'string' - } - ]); - - - var editor = new Ext.ux.grid.RowEditor({ - saveText: _('ID_UPDATE') - }); - - var btnAdd = new Ext.Button({ - id: 'btnAdd', - text: _('ID_NEW'), - iconCls: 'button_menu_ext ss_sprite ss_add', - handler: function () { - outputDocForm.getForm().reset(); - outputDocForm.getForm().items.items[3].setValue('Portrait'); - //outputDocForm.getForm().items.items[4].setValue('Letter'); - outputDocForm.getForm().items.items[9].setValue('BOTH'); - outputDocForm.getForm().items.items[10].setValue(0); - outputDocForm.getForm().items.items[0].focus('',500); - newOPWindow.show(); - } - }); - - //edit output document Function - var editOutputDoc = function(){ - - var rowSelected = Ext.getCmp('outputdocGrid').getSelectionModel().getSelections(); - if( rowSelected.length == 0 ) { - PMExt.error('', _('ID_NO_SELECTION_WARNING')); - return false; - } - var outputDocUID = rowSelected[0].get('OUT_DOC_UID'); - - - - Ext.QuickTips.init(); - - // turn on validation errors beside the field globally - Ext.form.Field.prototype.msgTarget = 'side'; - - var bd = Ext.getBody(); - - var importOption = new Ext.Action({ - text: _('ID_LOAD_FROM_FILE'), - iconCls: 'silk-add', - icon: '/images/import.gif', - handler: function(){ - var w = new Ext.Window({ - title: '', - width: 420, - height: 140, - modal: true, - autoScroll: false, - maximizable: false, - resizable: false, - - items: [ - new Ext.FormPanel({ - /*renderTo: 'form-panel',*/ - id:'uploader', - fileUpload: true, - width: 400, - frame: true, - title: _('ID_OUT_PUT_DOC_UPLOAD_TITLE'), - autoHeight: false, - bodyStyle: 'padding: 10px 10px 0 10px;', - labelWidth: 50, - defaults: { - anchor: '90%', - allowBlank: false, - msgTarget: 'side' - }, - items: [{ - xtype: 'fileuploadfield', - id: 'form-file', - emptyText: _('ID_SELECT_TEMPLATE_FILE'), - fieldLabel: _('ID_FILE'), - name: 'templateFile', - buttonText: '', - buttonCfg: { - iconCls: 'upload-icon' - } - }], - buttons: [{ - text: _('ID_UPLOAD'), - handler: function(){ - var uploader = Ext.getCmp('uploader'); - if(uploader.getForm().isValid()){ - uploader.getForm().submit({ - url: '../outputdocs/outputdocs_Ajax?action=setTemplateFile', - waitMsg: _('ID_UPLOADING_FILE'), - success: function(o, resp){ - w.close(); - - Ext.Ajax.request({ - url: '../outputdocs/outputdocs_Ajax?action=getTemplateFile&r='+Math.random(), - success: function(response){ - top.getForm().findField('OUT_DOC_TEMPLATE').setValue(response.responseText); - if(top.getForm().findFields('OUT_DOC_TEMPLATE').getValue(response.responseText)=='') - Ext.Msg.alert(_('ID_ALERT_MESSAGE'), _('ID_INVALID_FILE')); - }, - failure: function(){}, - params: {request: 'getRows'} - }); - - }, - failure: function(o, resp){ - w.close(); - //alert('ERROR "'+resp.result.msg+'"'); - Ext.MessageBox.show({title: '', msg: resp.result.msg, buttons: - Ext.MessageBox.OK, animEl: 'mb9', fn: function(){}, icon: - Ext.MessageBox.ERROR}); - //setTimeout(function(){Ext.MessageBox.hide(); }, 2000); - } - }); - } - } - },{ - text: _('ID_CANCEL'), - handler: function(){ - // when this button clicked, - w.hide(); - } - }] - }) - ] - }); - w.show(); - } - }); - - - var top = new Ext.FormPanel({ - labelAlign: 'top', - frame:true, - title: '', - bodyStyle:'padding:5px 5px 0', - width: 790, - tbar:[importOption], - items: [ - { - xtype:'htmleditor', - //id:'OUT_DOC_TEMPLATE', - name:'OUT_DOC_TEMPLATE', - fieldLabel:'Output Document Template', - height:300, - anchor:'98%' - }], - - buttons: [{ - text: _('ID_SAVE'), - handler: function(){ - editor.stopEditing(); - Ext.Ajax.request({ - url: 'outputdocs/outputdocs_Save.php', - method: 'POST', - params: { - OUT_DOC_UID: outputDocUID, - functions:'', - OUT_DOC_TEMPLATE:top.getForm().findField('OUT_DOC_TEMPLATE').getValue() - - }, - success: function(response){ - Ext.Msg.show({ - title: '', - msg: 'Saved Successfully', - fn: function(){ - window.hide(); - }, - animEl: 'elId', - icon: Ext.MessageBox.INFO, - buttons: Ext.MessageBox.OK - }); - }, - failure: function(){} - - }); - } - },{ - text: _('ID_CANCEL'), - handler: function(){ - // when this button clicked, - window.hide(); - } - }] - }); - - top.render(document.body); - - var window = new Ext.Window({ - title: _('ID_NEW_INPUTDOCS'), - width: 650, - height: 450, - minWidth: 200, - minHeight: 450, - autoScroll: true, - layout: 'fit', - plain: true, - items: top - }); - window.show(); - - top.form.load({ - url :'bpmn/processes_Ajax.php?OUT_DOC_UID='+outputDocUID+'&action=getOutputDocsTemplates', - method: 'GET', - waitMsg:'Loading', - success:function(form, action) { - //Ext.MessageBox.alert('Message', 'Loaded OK'); - window.show(); - //OUT_DOC_TEMPLATE:Ext.getCmp('OUT_DOC_TEMPLATE').setValue() - }, - failure:function(form, action) { - PMExt.notify( _('ID_STATUS') , _('ID_LOAD_FAILED') ); - } - }); - - -} - - var removeOutputDoc = function(){ - ids = Array(); - - editor.stopEditing(); - var rowsSelected = Ext.getCmp('outputdocGrid').getSelectionModel().getSelections(); - - if( rowsSelected.length == 0 ) { - PMExt.error('', _('ID_NO_SELECTION_WARNING')); - return false; - } - - for(i=0; i"+TRANSLATIONS.ID_DESCRIPTION+": {OUT_DOC_DESCRIPTION}

" - ) - }); - - var outputDocColumns = new Ext.grid.ColumnModel({ - columns: [ - expander, - { - id: 'OUT_DOC_TITLE', - header: _('ID_TITLE'), - dataIndex: 'OUT_DOC_TITLE', - width: 280, - editable: false, - editor: new Ext.form.TextField({ - //allowBlank: false - }) - }, - { - id: 'OUT_DOC_TYPE', - header: _('ID_TYPE'), - dataIndex: 'OUT_DOC_TYPE', - editable: false, - editor: new Ext.form.TextField({ - //allowBlank: false - }) - } - ] - }); - - var outputDocGrid = new Ext.grid.GridPanel({ - store : outputDocStore, - id : 'outputdocGrid', - loadMask : true, - loadingText : 'Loading...', - //renderTo : 'cases-grid', - frame : false, - autoHeight :false, - clicksToEdit: 1, - minHeight :400, - height :400, - layout : 'fit', - cm : outputDocColumns, - stripeRows : true, - plugins: expander, - tbar : tb, - bbar: new Ext.PagingToolbar({ - pageSize: 10, - store: outputDocStore, - displayInfo: true, - displayMsg: 'Displaying Output Document {0} - {1} of {2}', - emptyMsg: "No Output Document to display", - items:[] - }), - viewConfig : {forceFit: true} - }); - - var outputDocForm = new Ext.FormPanel({ - monitorValid :true, - labelWidth : 140, - defaults : {width : 300, autoScroll:true}, - width : 300, - bodyStyle : 'padding:8px 0 0 8px;', - items : [ - { - xtype : 'textfield', - fieldLabel : _('ID_TITLE'), - allowBlank : false, - blankText : 'Enter Title of Output Document', - name : 'OUT_DOC_TITLE' - },{ - width : 450, - layout:'column', - border:false, - items:[{ - columnWidth:.8, - layout : 'form', - width : 300, - border:false, - items: [{ - xtype : 'textfield', - fieldLabel : _('ID_FILENAME_GENERATED'), - name : 'OUT_DOC_FILENAME', - allowBlank : false, - blankText : 'Select Filename generated', - anchor : '100%' - }] - },{ - columnWidth:.2, - layout: 'form', - border:false, - items: [{ - xtype:'button', - title: ' ', - text: '@@', - name: 'selectorigin', - handler: function (s) { - workflow.variablesAction = 'form'; - workflow.fieldName = 'OUT_DOC_FILENAME' ; - workflow.variable = '@#', - workflow.formSelected = outputDocForm; - var rowData = PMVariables(); - console.log(rowData); - } - }] - }] - },{ - xtype : 'textarea', - fieldLabel : _('ID_DESCRIPTION'), - name : 'OUT_DOC_DESCRIPTION', - height : 50, - width : 300 - },{ - width :150, - xtype :'combo', - mode :'local', - editable :false, - fieldLabel :_('ID_ORIENTATION'), - triggerAction :'all', - forceSelection : true, - name :'OUT_DOC_LANDSCAPE', - displayField :'name', - value :'Portrait', - valueField :'value', - store :new Ext.data.JsonStore({ - fields : ['name', 'value'], - data : [ - {name : 'Portrait', value: '0'}, - {name : 'Landscape', value: '1'}]}) - },{ - width :150, - xtype :'combo', - mode :'local', - editable :false, - fieldLabel :_('ID_MEDIA'), - forceSelection : true, - name :'OUT_DOC_MEDIA', - displayField :'name', - value :'Letter', - valueField :'value', - store : new Ext.data.JsonStore({ - fields : ['name', 'value'], - data : [ - {name : 'Letter', value: 'Letter'}, - {name : 'Legal', value: 'Legal'}, - {name : 'Executive', value: 'Executive'}, - {name : 'B5', value: 'B5'}, - {name : 'Folio', value: 'Folio'}, - {name : 'A0Oversize', value: 'A0Oversize'}, - {name : 'A0', value: 'A0'}, - {name : 'A1', value: 'A1'}, - {name : 'A2', value: 'A2'}, - {name : 'A3', value: 'A3'}, - {name : 'A4', value: 'A4'}, - {name : 'A5', value: 'A5'}, - {name : 'A6', value: 'A6'}, - {name : 'A7', value: 'A7'}, - {name : 'A8', value: 'A8'}, - {name : 'A9', value: 'A9'}, - {name : 'A10', value: 'A10'}, - {name : 'Screenshot640', value: 'Screenshot640'}, - {name : 'Screenshot800', value: 'Screenshot800'}, - {name : 'Screenshot1024', value: 'Screenshot1024'} - ] - }) - },{ - xtype : 'numberfield', - fieldLabel : _('ID_LEFT_MARGIN'), - name : 'OUT_DOC_LEFT_MARGIN', - width : 50 - },{ - xtype : 'numberfield', - fieldLabel : _('ID_RIGHT_MARGIN'), - name : 'OUT_DOC_RIGHT_MARGIN', - width : 50 - },{ - xtype : 'numberfield', - fieldLabel : _('ID_TOP_MARGIN'), - name : 'OUT_DOC_TOP_MARGIN', - width : 50 - },{ - xtype : 'numberfield', - fieldLabel : _('ID_BOTTOM_MARGIN'), - name : 'OUT_DOC_BOTTOM_MARGIN', - width : 50 - },{ - width :150, - xtype :'combo', - mode :'local', - editable :false, - fieldLabel :_('ID_OUTPUT_GENERATE'), - triggerAction :'all', - forceSelection :true, - name :'OUT_DOC_GENERATE', - displayField :'name', - value :'Doc', - valueField :'value', - store :new Ext.data.JsonStore({ - fields :['name', 'value'], - data :[ - {name : 'BOTH', value: 'BOTH'}, - {name : 'DOC', value: 'DOC'}, - {name : 'PDF', value: 'PDF'}]}) - },{ - width : 50, - xtype :'combo', - mode :'local', - editable :false, - fieldLabel :_('ID_ENABLE_VERSIONING'), - triggerAction :'all', - forceSelection :true, - name :'OUT_DOC_VERSIONING', - displayField :'name', - value :'NO', - valueField :'value', - store :new Ext.data.JsonStore({ - fields : ['name', 'value'], - data : [ - {name : 'NO', value: '0'}, - {name : 'YES', value: '1'}]}) - },{ - layout :'column', - width : 450, - border :false, - items :[{ - columnWidth :.8, - layout : 'form', - border :false, - items : [{ - xtype : 'textfield', - fieldLabel : _('ID_DESTINATION_PATH'), - name : 'OUT_DOC_DESTINATION_PATH', - anchor :'100%', - width : 300 - }] - },{ - columnWidth :.2, - layout : 'form', - border :false, - items : [{ - xtype : 'button', - title : ' ', - text : '@@', - name : 'selectorigin', - handler: function (s) { - workflow.variablesAction = 'form'; - workflow.fieldName = 'OUT_DOC_DESTINATION_PATH' ; - workflow.variable = '@@', - workflow.formSelected = outputDocForm; - var rowData = PMVariables(); - } - }] - }] - },{ - layout :'column', - width : 450, - border :false, - items :[{ - columnWidth :.8, - layout : 'form', - border :false, - items : [{ - xtype : 'textfield', - fieldLabel : _('ID_TAGS'), - name : 'OUT_DOC_TAGS', - anchor :'100%', - width : 300 - }] - },{ - columnWidth :.2, - layout : 'form', - border :false, - items : [{ - xtype :'button', - title : ' ', - text : '@@', - name : 'selectorigin', - handler: function (s) { - workflow.variablesAction = 'form'; - workflow.fieldName = 'OUT_DOC_TAGS' ; - workflow.variable = '@@', - workflow.formSelected = outputDocForm; - var rowData = PMVariables(); - } - }] - }] - },{ - id : 'OUT_DOC_UID', - xtype: 'hidden', - name : 'OUT_DOC_UID' - } - ], - buttons : [{ - text : _('ID_SAVE'), - formBind :true, - handler : function(){ - var getForm = outputDocForm.getForm().getValues(); - var sDocUID = getForm.OUT_DOC_UID; - var sDocTitle = getForm.OUT_DOC_TITLE; - var sFilename = getForm.OUT_DOC_FILENAME; - var sDesc = getForm.OUT_DOC_DESCRIPTION; - var sLandscape = getForm.OUT_DOC_LANDSCAPE; - if(getForm.OUT_DOC_LANDSCAPE == 'Portrait') - sLandscape=0; - if(getForm.OUT_DOC_LANDSCAPE == 'Landscape') - sLandscape=1; - var sMedia = getForm.OUT_DOC_MEDIA; - var sLeftMargin = getForm.OUT_DOC_LEFT_MARGIN; - var sRightMargin = getForm.OUT_DOC_RIGHT_MARGIN; - var sTopMargin = getForm.OUT_DOC_TOP_MARGIN; - var sBottomMargin = getForm.OUT_DOC_BOTTOM_MARGIN; - var sGenerated = getForm.OUT_DOC_GENERATE; - var sVersioning = getForm.OUT_DOC_VERSIONING; - if(getForm.OUT_DOC_VERSIONING == 'NO') - sVersioning=0; - if(getForm.OUT_DOC_VERSIONING == 'YES') - sVersioning=1; - var sDestPath = getForm.OUT_DOC_DESTINATION_PATH; - var sTags = getForm.OUT_DOC_TAGS; - if(sDocUID == "") - { - Ext.Ajax.request({ - url : 'outputdocs/outputdocs_Save.php', - method: 'POST', - params:{ - functions : 'lookForNameOutput', - NAMEOUTPUT : sDocTitle, - proUid : pro_uid - }, - success: function(response) { - if(response.responseText == "1") - { - Ext.Ajax.request({ - url : 'outputdocs/outputdocs_Save.php', - method: 'POST', - params:{ - functions : '', - OUT_DOC_UID : sDocUID, - OUT_DOC_TITLE : sDocTitle, - OUT_DOC_FILENAME : sFilename, - OUT_DOC_DESCRIPTION : sDesc, - OUT_DOC_LANDSCAPE : sLandscape, - OUT_DOC_MEDIA : sMedia, - OUT_DOC_LEFT_MARGIN : sLeftMargin, - OUT_DOC_RIGHT_MARGIN : sRightMargin, - OUT_DOC_TOP_MARGIN : sTopMargin, - OUT_DOC_BOTTOM_MARGIN : sBottomMargin, - OUT_DOC_GENERATE : sGenerated, - OUT_DOC_VERSIONING : sVersioning, - OUT_DOC_DESTINATION_PATH : sDestPath, - OUT_DOC_TAGS : sTags, - PRO_UID : pro_uid - }, - success: function(response) { - PMExt.notify( _('ID_STATUS') , _('OUTPUT_CREATE') ); - outputDocStore.reload(); - newOPWindow.hide(); - } - }); - - } - - - else - PMExt.error( _('ID_ERROR') , _('ID_OUTPUT_NOT_SAVE') ); - } - }); - } - else - { - Ext.Ajax.request({ - url : 'outputdocs/outputdocs_Save.php', - method: 'POST', - params:{ - functions : '', - OUT_DOC_UID : sDocUID, - OUT_DOC_TITLE : sDocTitle, - OUT_DOC_FILENAME : sFilename, - OUT_DOC_DESCRIPTION : sDesc, - OUT_DOC_LANDSCAPE : sLandscape, - OUT_DOC_MEDIA : sMedia, - OUT_DOC_LEFT_MARGIN : sLeftMargin, - OUT_DOC_RIGHT_MARGIN : sRightMargin, - OUT_DOC_TOP_MARGIN : sTopMargin, - OUT_DOC_BOTTOM_MARGIN : sBottomMargin, - OUT_DOC_GENERATE : sGenerated, - OUT_DOC_VERSIONING : sVersioning, - OUT_DOC_DESTINATION_PATH : sDestPath, - OUT_DOC_TAGS : sTags, - PRO_UID : pro_uid - }, - success: function(response) { - PMExt.notify( _('ID_STATUS') , _('ID_OUTPUT_UPDATE') ); - outputDocStore.reload(); - newOPWindow.hide(); - } - }); - - } - } - },{ - text: _('ID_CANCEL'), - handler: function(){ - // when this button clicked, - newOPWindow.hide(); - } - }], - buttonAlign : 'center' - }); - - var newOPWindow = new Ext.Window({ - title : _('ID_OUTPUT_DOCUMENTS'), - width : 520, - closable : false, - defaults :{autoScroll:true}, - height : 470, - minWidth : 200, - minHeight : 350, - layout : 'fit', - plain : true, - items : outputDocForm, - buttonAlign : 'center' - }); - - //connecting context menu to grid - outputDocGrid.addListener('rowcontextmenu', onOutputDocContextMenu,this); - - //by default the right click is not selecting the grid row over the mouse - //we need to set this four lines - outputDocGrid.on('rowcontextmenu', function (grid, rowIndex, evt) { - var sm = grid.getSelectionModel(); - sm.selectRow(rowIndex, sm.isSelected(rowIndex)); - }, this); - - //prevent default - outputDocGrid.on('contextmenu', function (evt) { - evt.preventDefault(); - }, this); - - function onOutputDocContextMenu(grid, rowIndex, e) { - e.stopEvent(); - var coords = e.getXY(); - outputdocContextMenu.showAt([coords[0], coords[1]]); - } - - var outputdocContextMenu = new Ext.menu.Menu({ - id: 'messageContextMenu', - items: [{ - text: _('ID_EDIT'), - iconCls: 'button_menu_ext ss_sprite ss_pencil', - handler: editOutputDoc - },{ - text: _('ID_PROPERTIES'), - iconCls: 'button_menu_ext ss_sprite ss_application_edit', - handler: propertiesOutputDoc - },{ - text: _('ID_DELETE'), - icon: '/images/delete.png', - handler: removeOutputDoc - },{ - text: _('ID_UID'), - handler: function(){ - var rowSelected = Ext.getCmp('outputdocGrid').getSelectionModel().getSelected(); - workflow.createUIDButton(rowSelected.data.OUT_DOC_UID); - } - } - ] - }); - - var gridWindow = new Ext.Window({ - title : _('ID_OUTPUT_DOCUMENTS'), - collapsible : false, - maximizable : false, - width : 550, - defaults :{autoScroll:true}, - height : 350, - minWidth : 200, - minHeight : 350, - layout : 'fit', - plain : true, - items : outputDocGrid, - buttonAlign : 'center' - }); - gridWindow.show(); -} - -/* -ProcessOptions.prototype.addReportTable= function(_5625) -{ - var reportFields = Ext.data.Record.create([ - { - name:'REP_TAB_UID', - type: 'string' - }, - { - name: 'REP_TAB_TITLE', - type: 'string' - }, - { - name: 'FIELD_NAME', - type: 'string' - }, - { - name: 'FIELD_UID', - type: 'string' - } - ]); - - var editor = new Ext.ux.grid.RowEditor({ - saveText: _('ID_UPDATE') - }); - - var btnAdd = new Ext.Button({ - id: 'btnAdd', - text: _('ID_NEW'), - iconCls: 'button_menu_ext ss_sprite ss_add', - handler: function () { - formWindow.show(); - reportForm.getForm().reset(); - } - }); - - //edit report table Function - var editReportTable = function() { - editor.stopEditing(); - var rowSelected = Ext.getCmp('reportTableGrid').getSelectionModel().getSelections(); - if( rowSelected.length == 0 ) { - PMExt.error('', _('ID_NO_SELECTION_WARNING')); - return false; - } - var repTabUID = rowSelected[0].get('REP_TAB_UID'); - reportForm.form.load({ - url :'bpmn/proxyExtjs.php?pid='+pro_uid+'&REP_TAB_UID=' +repTabUID+'&action=editReportTables', - method: 'GET', - waitMsg:'Loading', - success:function(form, action) { - formWindow.show(); - }, - failure:function(form, action) { - PMExt.notify( _('ID_STATUS') , _('ID_LOAD_FAILED') ); - } - }); - } - - var removeReportTable = function(){ - ids = Array(); - - editor.stopEditing(); - var rowsSelected = Ext.getCmp('reportTableGrid').getSelectionModel().getSelections(); - - if( rowsSelected.length == 0 ) { - PMExt.error('', _('ID_NO_SELECTION_WARNING')); - return false; - } - - for(i=0; i

" - ) - }); - - var reportColumns = new Ext.grid.ColumnModel({ - columns: [ - new Ext.grid.RowNumberer(), - { - id: 'REP_TAB_TITLE', - header: _('ID_TITLE'), - dataIndex: 'REP_TAB_TITLE', - width: 380, - editable: false, - editor: new Ext.form.TextField({ - //allowBlank: false - }) - } - ] - }); - - var reportGrid = new Ext.grid.GridPanel({ - store : reportStore, - id : 'reportTableGrid', - loadMask : true, - loadingText : 'Loading...', - //renderTo : 'cases-grid', - frame : false, - autoHeight :false, - clicksToEdit: 1, - width :420, - height :400, - layout : 'fit', - plugins: expander, - cm : reportColumns, - stripeRows: true, - tbar: tb, - bbar: new Ext.PagingToolbar({ - pageSize: 10, - store: reportStore, - displayInfo: true, - displayMsg: 'Displaying Report Tables {0} - {1} of {2}', - emptyMsg: "No Report Tables to display" - }), - viewConfig: {forceFit: true} - }); - - //connecting context menu to grid - reportGrid.addListener('rowcontextmenu', onreportTableContextMenu,this); - - //by default the right click is not selecting the grid row over the mouse - //we need to set this four lines - reportGrid.on('rowcontextmenu', function (grid, rowIndex, evt) { - var sm = grid.getSelectionModel(); - sm.selectRow(rowIndex, sm.isSelected(rowIndex)); - }, this); - - //prevent default - reportGrid.on('contextmenu', function (evt) { - evt.preventDefault(); - }, this); - - function onreportTableContextMenu(grid, rowIndex, e) { - e.stopEvent(); - var coords = e.getXY(); - reportTableContextMenu.showAt([coords[0], coords[1]]); - } - - var reportTableContextMenu = new Ext.menu.Menu({ - id: 'messageContextMenu', - items: [{ - text: _('ID_EDIT'), - iconCls: 'button_menu_ext ss_sprite ss_pencil', - handler: editReportTable - },{ - text: _('ID_DELETE'), - icon: '/images/delete.png', - handler: removeReportTable - },{ - text: _('ID_UID'), - handler: function(){ - var rowSelected = Ext.getCmp('reportTableGrid').getSelectionModel().getSelected(); - workflow.createUIDButton(rowSelected.data.REP_TAB_UID); - } - } - ] - }); - - var gridWindow = new Ext.Window({ - title : _('ID_REPORT_TABLES'), - collapsible : false, - maximizable : false, - width : 420, - defaults :{autoScroll:true}, - height : 350, - minWidth : 200, - minHeight : 350, - layout : 'fit', - plain : true, - items : reportGrid, - buttonAlign : 'center' - }); - gridWindow.show(); - -var reportForm =new Ext.FormPanel({ - collapsible: false, - maximizable: true, - width:450, - height:325, - frame:false, - monitorValid : true, - plain: true, - bodyStyle : 'padding:10px 0 0 10px;', - buttonAlign: 'center', - items:[{ - xtype: 'textfield', - fieldLabel: _('ID_TITLE'), - width: 250, - name: 'REP_TAB_TITLE', - allowBlank: false - },{ - - xtype: 'textfield', - fieldLabel: _('ID_TABLE_NAME'), - width: 250, - name: 'REP_TAB_NAME', - allowBlank: false - }, - { - xtype: 'combo', - width: 250, - mode: 'local', - editable:false, - fieldLabel: _('ID_TYPE'), - triggerAction: 'all', - forceSelection: true, - name: 'REP_TAB_TYPE', - displayField: 'name', - valueField : 'value', - value : 'Global', - store: new Ext.data.JsonStore({ - fields : ['name', 'value'], - data : [ - {name : 'Global', value: 'NORMAL'}, - {name : 'Grid', value: 'GRID'} - ]}), - onSelect: function(record, index) { - //Show-Hide Format Type Field - if(record.data.value == 'NORMAL') - { - Ext.getCmp("fields").show(); - Ext.getCmp("gridfields").hide(); - } - else - { - Ext.getCmp("gridfields").show(); - Ext.getCmp("fields").hide(); - } - var link = 'bpmn/proxyExtjs?pid='+pro_uid+'&type='+record.data.value+'&action=getReportTableType'; - reportTableTypeStore.proxy.setUrl(link, true); - reportTableTypeStore.load(); - - this.setValue(record.data[this.valueField || this.displayField]); - this.collapse(); - } - }, - { - xtype: 'fieldset', - id: 'fields', - border:false, - hidden: false, - items: [{ - xtype: 'multiselect', - width: 240, - height: 150, - mode: 'local', - style : 'margin-bottom:10px', - editable:true, - fieldLabel: _('ID_FIELDS'), - triggerAction: 'all', - allowblank: true, - forceSelection: false, - dataIndex : 'FIELD_NAME', - name: 'FIELDS', - valueField: 'FIELD_UID', - displayField: 'FIELD_NAME', - store: reportTableTypeStore - }] - }, { - xtype: 'fieldset', - id: 'gridfields', - border:false, - hidden: true, - align:'left', - items:[{ - xtype: 'combo', - width: 200, - mode: 'local', - editable:false, - fieldLabel: _('ID_GRID_FIELDS'), - triggerAction: 'all', - forceSelection: true, - displayField: 'name', - valueField: 'value', - name: 'REP_TAB_GRID', - store: new Ext.data.JsonStore({ - fields : ['name', 'value'], - data : [] - }) - }] - },{xtype:'hidden', name:'REP_TAB_UID'} - ], buttons: [{ - text: _('ID_SAVE'), - formBind :true, - handler: function(){ - var getForm = reportForm.getForm().getValues(); - //var pro_uid = getForm.PRO_UID; - var tableUID = getForm.REP_TAB_UID; - var Title = getForm.REP_TAB_TITLE; - var Name = getForm.REP_TAB_NAME; - var Type = getForm.REP_TAB_TYPE; - if(Type == 'Global') - Type = 'NORMAL'; - else - Type = 'GRID'; - - var Grid = getForm.REP_TAB_GRID; - var Fields = getForm.FIELDS; - - if(tableUID=='') - { - Ext.Ajax.request({ - url : '../reportTables/reportTables_Save.php', - method: 'POST', - params:{ - PRO_UID :pro_uid, - REP_TAB_UID :'', - REP_TAB_TITLE :Title, - REP_TAB_NAME :Name, - REP_TAB_TYPE :Type , - REP_TAB_GRID :Grid, - FIELDS :Fields - }, - success: function(response) { - PMExt.notify( _('ID_STATUS') , _('ID_REPORT_SAVE') ); - } - }); - } - else - { - Ext.Ajax.request({ - url : '../reportTables/reportTables_Save.php', - method: 'POST', - params:{ - PRO_UID :pro_uid, - REP_TAB_UID :tableUID, - REP_TAB_TITLE :Title, - REP_TAB_NAME :Name, - REP_TAB_TYPE :Type , - REP_TAB_GRID :Grid, - FIELDS :Fields - //REP_TAB_CONNECTION: Connection - }, - success: function(response) { - PMExt.notify( _('ID_STATUS') , _('ID_REPORT_EDITED') ); - } - - - }); - } - formWindow.hide(); - reportStore.reload(); - - } - },{ - text: _('ID_CANCEL'), - handler: function(){ - // when this button clicked, - formWindow.hide(); - } - }] - }) - -var formWindow = new Ext.Window({ - title: _('ID_NEW_REPORT_TABLE'), - collapsible: false, - maximizable: true, - width: 400, - //autoHeight: true, - height: 330, - layout: 'fit', - plain: true, - buttonAlign: 'center', - items: reportForm - }); - //gridWindow.show(); -} -*/ - - -ProcessOptions.prototype.addTriggers = function() -{ - - var triggerFields = Ext.data.Record.create([ - {name: 'TRI_UID'}, - {name: 'TRI_TITLE'}, - {name: 'TRI_DESCRIPTION'}, - {name: 'TRI_WEBBOT'} - ]); - - var editor = new Ext.ux.grid.RowEditor({ - saveText: _('ID_UPDATE') - }); - - var btnAdd = new Ext.Button({ - id: 'btnAdd', - text: _('ID_NEW'), - iconCls: 'button_menu_ext ss_sprite ss_add', - handler: function () { - triggersForm.getForm().reset(); - triggersForm.getForm().items.items[0].focus('',200); - formWindow.show(); - } - }); - - //edit report table Function - var editTriggers = function() { - editor.stopEditing(); - var rowSelected = Ext.getCmp('triggersGrid').getSelectionModel().getSelections(); - if( rowSelected.length == 0 ) { - PMExt.error('', _('ID_NO_SELECTION_WARNING')); - return false; - } - var triggerUID = rowSelected[0].get('TRI_UID'); - editTriggerForm.getForm().load({ - url :'bpmn/proxyExtjs.php?pid='+pro_uid+'&TRI_UID='+triggerUID+'&action=editTriggers', - method: 'GET', - waitMsg:'Loading', - success:function(form, action) { - Ext.getCmp('TRI_WEBBOT').setValue(action.result.data.TRI_WEBBOT); - editTriggerFormWindow.show(); - }, - failure:function(form, action) { - PMExt.notify( _('ID_STATUS') , _('ID_LOAD_FAILED') ); - } - }); - } - - var editProperties = function(){ - editor.stopEditing(); - var rowSelected = Ext.getCmp('triggersGrid').getSelectionModel().getSelections(); - if( rowSelected.length == 0 ) { - PMExt.error('', _('ID_NO_SELECTION_WARNING')); - return false; - } - var triggerUID = rowSelected[0].get('TRI_UID'); - //editPropertiesFormWindow.show(); - editPropertiesForm.form.load({ - url :'bpmn/proxyExtjs.php?pid='+pro_uid+'&TRI_UID='+triggerUID+'&action=editTriggers', - method: 'GET', - waitMsg:'Loading', - success:function(form, action) { - editPropertiesFormWindow.show(); - //Ext.getCmp("TRI_UID").setValue(triggerUID); - }, - failure:function(form, action) { - PMExt.notify( _('ID_STATUS') , _('ID_LOAD_FAILED') ); - } - }); - } - - var removeTriggers = function() { - ids = Array(); - - editor.stopEditing(); - var rowsSelected = Ext.getCmp('triggersGrid').getSelectionModel().getSelections(); - - if( rowsSelected.length == 0 ) { - PMExt.error('', _('ID_NO_SELECTION_WARNING')); - return false; - } - - for(i=0; i"+TRANSLATIONS.ID_DESCRIPTION+": {TRI_DESCRIPTION}

") - }); - - var triggersColumns = new Ext.grid.ColumnModel({ - defaults: { - width: 90, - sortable: true - }, - columns: [ - expander, - { - header: _('ID_TITLE_FIELD'), - dataIndex: 'TRI_TITLE', - width: 280 - } - ] - }); - - var tb = new Ext.Toolbar({ - items: [btnAdd, btnEdit,btnProperties,btnRemove] - }); - - var triggersGrid = new Ext.grid.GridPanel({ - store: triggerStore, - id : 'triggersGrid', - loadMask: true, - loadingText: 'Loading...', - //renderTo: 'cases-grid', - frame: false, - autoHeight:false, - minHeight:400, - height :400, - width: '', - layout: 'fit', - cm: triggersColumns, - stateful : true, - stateId : 'grid', - plugins: expander, - stripeRows: true, - tbar: tb, - bbar: new Ext.PagingToolbar({ - pageSize: 10, - store: triggerStore, - displayInfo: true, - displayMsg: 'Displaying Triggers {0} - {1} of {2}', - emptyMsg: "No Triggers to display" - }), - viewConfig: {forceFit: true} - }); - - //connecting context menu to grid - triggersGrid.addListener('rowcontextmenu', ontriggersContextMenu,this); - - //by default the right click is not selecting the grid row over the mouse - //we need to set this four lines - triggersGrid.on('rowcontextmenu', function (grid, rowIndex, evt) { - var sm = grid.getSelectionModel(); - sm.selectRow(rowIndex, sm.isSelected(rowIndex)); - }, this); - - //prevent default - triggersGrid.on('contextmenu', function (evt) { - evt.preventDefault(); - }, this); - - function ontriggersContextMenu(grid, rowIndex, e) { - e.stopEvent(); - var coords = e.getXY(); - triggersContextMenu.showAt([coords[0], coords[1]]); - } - - var triggersContextMenu = new Ext.menu.Menu({ - id: 'messageContextMenu', - items: [{ - text: _('ID_EDIT'), - iconCls: 'button_menu_ext ss_sprite ss_pencil', - handler: editTriggers - },{ - text: _('ID_PROPERTIES'), - iconCls: 'button_menu_ext ss_sprite ss_application_edit', - handler: editProperties - },{ - text: _('ID_DELETE'), - icon: '/images/delete.png', - handler: removeTriggers - },{ - text: _('ID_UID'), - handler: function(){ - var rowSelected = Ext.getCmp('triggersGrid').getSelectionModel().getSelected(); - workflow.createUIDButton(rowSelected.data.TRI_UID); - } - } - ] - }); - -var triggersForm = new Ext.FormPanel({ - labelWidth : 100, - buttonAlign : 'center', - width : 300, - height : 220, - bodyStyle : 'padding:8px 0 0 8px;', - autoHeight: true, - items: - [{ - xtype: 'textfield', - layout: 'fit', - border:true, - name: 'TRI_TITLE', - fieldLabel: _('ID_TITLE'), - width: 300, - collapsible: false, - allowBlank: false, - labelAlign: 'top' - }, - { - xtype: 'textarea', - border:true, - name: 'TRI_DESCRIPTION', - hidden: false, - fieldLabel: _('ID_DESCRIPTION'), - width: 300, - height: 120 - }], - buttons: [{ - text: _('ID_SAVE'), - //formBind :true, - handler: function(){ - var getForm = triggersForm.getForm().getValues(); - var title = getForm.TRI_TITLE; - var triggerUid = getForm.TRI_UID; - var condition = getForm.TRI_WEBBOT; - var desc = getForm.TRI_DESCRIPTION; - - if(title == '') - PMExt.notify( _('ID_ERROR') , _('ID_TRIGGER_TITLE_REQUIRED') ); - else - { - //First check whether trigger name already exist or not - Ext.Ajax.request({ - url : '../triggers/triggers_Save.php', - method: 'POST', - params: { - functions : 'lookforNameTrigger', - proUid : pro_uid, - NAMETRIGGER : title - }, - success: function(response) { - var result = response.responseText; - if(result) { - //now save trigger - Ext.Ajax.request({ - url : '../triggers/triggers_Save.php', - method: 'POST', - params:{ - //functions : 'lookforNameTrigger', - TRI_TITLE : title, - PRO_UID : pro_uid, - TRI_UID :'', - TRI_PARAM :'', - TRI_TYPE :'SCRIPT', - TRI_DESCRIPTION :desc, - TRI_WEBBOT :condition, - mode :'ext' - }, - success: function(response) { - var result = Ext.util.JSON.decode(response.responseText); - if( result.success ){ - PMExt.notify( _('ID_STATUS') , result.msg); - - //Reloading store after saving triggers - triggerStore.reload(); - formWindow.hide(); - } else { - PMExt.error(_('ID_ERROR'), result.msg); - } - } - }); - } else { - PMExt.error(_('ID_VALIDATION_ERROR'), 'There is a triggers with the same name in this process.'); - } - } - }); - formWindow.hide(); - } - } - },{ - text: _('ID_CANCEL'), - handler: function(){ - // when this button clicked, - formWindow.hide(); - } - }] - }); - - var editTriggerForm = new Ext.FormPanel({ - buttonAlign : 'center', - labelWidth : 2, - layout : 'fit', - width : 570, - height : 350, - items: - [{ - layout :'column', - border :false, - items :[{ - //columnWidth :.6, - layout : 'form', - border : false, - items : [{ -// xtype : 'textarea', - xtype : 'codepress', - language : 'generic', - id : 'TRI_WEBBOT', - width : 420, - height : 310, - name : 'TRI_WEBBOT' - }] - },{ - //columnWidth :.4, - layout : 'form', - border :false, - items : [{ - xtype :'button', - title : ' ', - width : 50, - text : '@@', - name : 'selectorigin', - handler: function (s) { - workflow.variablesAction = 'form'; - workflow.fieldName = 'TRI_WEBBOT' ; - workflow.variable = '@@', - workflow.formSelected = editTriggerForm; - var rowData = PMVariables(); - } - }] - }] - },{ - xtype: 'hidden', - name: 'TRI_UID' - }], - buttons: [{ - text: _('ID_SAVE'), - //formBind :true, - handler: function(){ - var getForm = editTriggerForm.getForm().getValues(); - var triggerUid = getForm.TRI_UID; -// var condition = getForm.TRI_WEBBOT; - var condition = Ext.getCmp('TRI_WEBBOT').getCode(); - var desc = getForm.TRI_DESCRIPTION; - Ext.Ajax.request({ - url : '../triggers/triggers_Save.php', - method: 'POST', - params:{ - PRO_UID : pro_uid, - TRI_UID : triggerUid, - TRI_TYPE : 'SCRIPT', - TRI_WEBBOT : condition, - mode : 'ext' - }, - success: function(response) { - var result = Ext.util.JSON.decode(response.responseText); - if( result.success ){ - PMExt.notify( _('ID_STATUS') , result.msg); - - //Reloading store after saving triggers - triggerStore.reload(); - editTriggerFormWindow.hide(); - } else { - PMExt.error(_('ID_ERROR'), result.msg); - } - } - }); - } - },{ - text: _('ID_CANCEL'), - handler: function(){ - // when this button clicked, - editTriggerFormWindow.hide(); - } - }] - }); - - var editPropertiesForm = new Ext.FormPanel({ - labelWidth : 100, - buttonAlign : 'center', - width : 400, - height : 300, - bodyStyle : 'padding:10px 0 0 10px;', - autoHeight: true, - items: - [{ - xtype: 'fieldset', - title: 'Trigger Information', - border:true, - id: 'trigger', - width: 400, - items:[{ - xtype: 'textfield', - layout: 'fit', - border:true, - name: 'TRI_TITLE', - fieldLabel: _('ID_TITLE'), - width: 250, - allowBlank: false, - labelAlign: 'top' - }, - { - xtype: 'textarea', - border:true, - name: 'TRI_DESCRIPTION', - hidden: false, - fieldLabel: _('ID_DESCRIPTION'), - width: 250, - height: 120 - }] - },{ - xtype: 'hidden', - name: 'TRI_UID' - }], - buttons: [{ - text: _('ID_SAVE'), - //formBind :true, - handler: function(){ - var getForm = editPropertiesForm.getForm().getValues(); - var triggerUid = getForm.TRI_UID; - var title = getForm.TRI_TITLE; - var desc = getForm.TRI_DESCRIPTION; - //First check whether trigger name already exist or not - Ext.Ajax.request({ - url : '../triggers/triggers_Save.php', - method: 'POST', - params: { - functions : 'lookforNameTrigger', - proUid : pro_uid, - NAMETRIGGER : title - }, - success: function(response) { - var result = response.responseText; - if(result) { - //now save trigger - Ext.Ajax.request({ - url : '../triggers/triggers_Save.php', - method: 'POST', - params:{ - TRI_TITLE : title, - PRO_UID : pro_uid, - TRI_UID :triggerUid, - TRI_PARAM :'', - TRI_TYPE :'SCRIPT', - TRI_DESCRIPTION :desc, - mode :'ext' - }, - success: function(response) { - var result = Ext.util.JSON.decode(response.responseText); - if( result.success ){ - PMExt.notify( _('ID_STATUS') , result.msg); - - //Reloading store after saving triggers - triggerStore.reload(); - editPropertiesFormWindow.hide(); - } else { - PMExt.error(_('ID_ERROR'), result.msg); - } - } - }); - } else { - PMExt.error(_('ID_VALIDATION_ERROR'), 'There is a triggers with the same name in this process.'); - } - } - }); - editPropertiesFormWindow.hide(); - } - },{ - text: _('ID_CANCEL'), - handler: function(){ - // when this button clicked, - editPropertiesFormWindow.hide(); - } - }] - }); - - var editTriggerFormWindow = new Ext.Window({ - title: _('ID_EDIT_TRIGGERS'), - autoScroll: true, - collapsible: false, - width: 600, - //autoHeight: true, - height: 400, - layout: 'fit', - plain: true, - buttonAlign: 'center', - items: editTriggerForm - }); - - var editPropertiesFormWindow = new Ext.Window({ - title: _('ID_EDIT_TRIGGERS'), - autoScroll: true, - collapsible: false, - width: 450, - //autoHeight: true, - height: 280, - layout: 'fit', - plain: true, - buttonAlign: 'center', - items: editPropertiesForm - }); - - - var formWindow = new Ext.Window({ - title: _('ID_TRIGGERS'), - autoScroll: true, - collapsible: false, - maximizable: true, - width: 450, - //autoHeight: true, - height: 240, - layout: 'fit', - plain: true, - buttonAlign: 'center', - items: triggersForm - }); - - var gridWindow = new Ext.Window({ - title: _('ID_TRIGGERS'), - autoScroll: true, - collapsible: false, - maximizable: true, - width: 600, - //autoHeight: true, - height: 350, - layout: 'fit', - plain: true, - buttonAlign: 'center', - items: triggersGrid - }); - gridWindow.show(); -} - - -///*** from ProcessMapContext ***/// -var PMVariables = function() { - var varFields = Ext.data.Record.create( [ { - name : 'variable', - type : 'string' - }, { - name : 'type', - type : 'string' - }, { - name : 'label', - type : 'string' - } ]); - var varStore = ''; - varStore = new Ext.data.JsonStore( { - root : 'data', - totalProperty : 'totalCount', - idProperty : 'gridIndex', - remoteSort : true, - fields : varFields, - proxy : new Ext.data.HttpProxy( { - url : 'bpmn/proxyExtjs?pid=' + pro_uid + '&action=getVariables&sFieldName=form[CTO_CONDITION]&sSymbol=@@' - }) - }); - //varStore.load(); - - var varColumns = new Ext.grid.ColumnModel( { - columns : [ new Ext.grid.RowNumberer(), { - id : 'FLD_NAME', - header : _('ID_VARIABLES'), - dataIndex : 'variable', - width : 170, - editable : false, - sortable : true - }, { - id : 'PRO_VARIABLE', - header : _('ID_LABEL'), - dataIndex : 'label', - width : 150, - sortable : true - } ] - }); - - var varForm = new Ext.FormPanel( { - labelWidth : 100, - monitorValid : true, - width : 400, - bodyStyle : 'padding:10px 0 0 10px;', - height : 350, - renderer : function(val) { - return '
@@ Replace the value in quotes
'; - }, - items : { - xtype : 'tabpanel', - activeTab : 0, - defaults : { - autoHeight : true - }, - items : [ { - title : _('ID_ALL_VARIABLES'), - id : 'allVar', - layout : 'form', - listeners : { - activate : function(tabPanel) { - // use {@link Ext.data.HttpProxy#setUrl setUrl} to change the URL for *just* this request. - var link = 'bpmn/proxyExtjs?pid=' + pro_uid + '&action=getVariables&type=' + tabPanel.id + '&sFieldName=form[CTO_CONDITION]&sSymbol=@@'; - varStore.proxy.setUrl(link, true); - varStore.load(); - } - }, - items : [ { - xtype : 'grid', - ds : varStore, - cm : varColumns, - width : 380, - autoHeight : true, - //plugins: [editor], - //loadMask : true, - loadingText : 'Loading...', - border : false, - listeners : { - //rowdblclick: alert("ok"), - rowdblclick : function() { - var objectSelected = workflow.variablesAction; - switch (objectSelected) { - case 'grid': - var getObjectGridRow = workflow.gridObjectRowSelected; - var FieldSelected = workflow.gridField; - //getting selected row of variables - var rowSelected = this.getSelectionModel().getSelected(); - var rowLabel = rowSelected.data.variable; - - //Assigned new object with condition - if (typeof getObjectGridRow.colModel != 'undefined') - getObjectGridRow.colModel.config[3].editor.setValue(rowLabel); - //Assigning / updating Condition for a row - else - getObjectGridRow[0].set(FieldSelected, rowLabel); - - if (FieldSelected == 'CTO_CONDITION') { - Ext.Ajax.request( { - url : '../tracker/tracker_ConditionsSave.php', - method : 'POST', - params : { - PRO_UID : pro_uid, - CTO_UID : getObjectGridRow[0].data.CTO_UID, - CTO_CONDITION : getObjectGridRow[0].data.CTO_CONDITION - }, - success : function(response) { - Ext.MessageBox.alert('Status', 'Objects has been edited successfully '); - } - }) - } else if (FieldSelected == 'STEP_CONDITION') { - Ext.Ajax.request( { - url : '../steps/conditions_Save.php', - method : 'POST', - params : { - PRO_UID : pro_uid, - STEP_UID : getObjectGridRow[0].data.STEP_UID, - STEP_CONDITION : getObjectGridRow[0].data.STEP_CONDITION - }, - success : function(response) { - Ext.MessageBox.alert('Status', 'Objects has been edited successfully '); - } - }) - } else if (FieldSelected == 'ST_CONDITION') { - Ext.Ajax.request( { - url : '../steps/steps_Ajax.php', - method : 'POST', - params : { - action : 'saveTriggerCondition', - PRO_UID : pro_uid, - STEP_UID : getObjectGridRow[0].data.STEP_UID, - ST_CONDITION : getObjectGridRow[0].data.STEP_CONDITION, - TAS_UID : taskId, - TRI_UID : getObjectGridRow[0].data.TRI_UID, - ST_TYPE : getObjectGridRow[0].data.ST_TYPE - - }, - success : function(response) { - Ext.MessageBox.alert('Status', 'Objects has been edited successfully '); - } - }) - } - - window.hide(); - - break; - case 'form': - FormSelected = workflow.formSelected; - rowSelected = this.getSelectionModel().getSelected(); - FieldSelected = workflow.fieldName; - rowLabel = rowSelected.data.variable; - var prevContent = FormSelected.getForm().findField(FieldSelected).getValue(); - var newContent = prevContent + ' ' + rowLabel; - var value = FormSelected.getForm().findField(FieldSelected).setValue(newContent); -// if (FormSelected.getForm().findField(FieldSelected).code){ -// FormSelected.getForm().findField(FieldSelected).code=value; -// } - window.hide(); - break; - - } - - } - } - } ] - }, { - title : _('ID_SYSTEM'), - id : 'system', - layout : 'form', - listeners : { - activate : function(tabPanel) { - // use {@link Ext.data.HttpProxy#setUrl setUrl} to change the URL for *just* this request. - var link = 'bpmn/proxyExtjs?pid=' + pro_uid + '&action=getVariables&type=' + tabPanel.id + '&sFieldName=form[CTO_CONDITION]&sSymbol=@@'; - varStore.proxy.setUrl(link, true); - varStore.load(); - } - }, - items : [ { - xtype : 'grid', - ds : varStore, - cm : varColumns, - width : 380, - autoHeight : true, - //plugins: [editor], - //loadMask : true, - loadingText : 'Loading...', - border : false, - listeners : { - //rowdblclick: alert("ok"), - rowdblclick : function() { - var objectSelected = workflow.variablesAction; - switch (objectSelected) { - case 'grid': - var getObjectGridRow = workflow.gridObjectRowSelected; - var FieldSelected = workflow.gridField; - //getting selected row of variables - var rowSelected = this.getSelectionModel().getSelected(); - var rowLabel = rowSelected.data.variable; - //Assigned new object with condition - if (typeof getObjectGridRow.colModel != 'undefined') - getObjectGridRow.colModel.config[3].editor.setValue(rowLabel); - //Assigning / updating Condition for a row - else - getObjectGridRow[0].set(FieldSelected, rowLabel); - if (CTO_UID != '') { - Ext.Ajax.request( { - url : '../tracker/tracker_ConditionsSave.php', - method : 'POST', - params : { - PRO_UID : pro_uid, - CTO_UID : getObjectGridRow[0].data.CTO_UID, - CTO_CONDITION : getObjectGridRow[0].data.CTO_CONDITION - }, - success : function(response) { - Ext.MessageBox.alert('Status', 'Objects has been edited successfully '); - } - }) - window.hide(); - } - - break; - case 'form': - FormSelected = workflow.formSelected; - rowSelected = this.getSelectionModel().getSelected(); - FieldSelected = workflow.fieldName; - rowLabel = rowSelected.data.variable; - var value = FormSelected.getForm().findField(FieldSelected).setValue(rowLabel); - window.hide(); - break; - - } - - } - } - } ] - }, { - title : _('ID_CASESLIST_APP_PRO_TITLE'), - id : 'process', - layout : 'form', - listeners : { - activate : function(tabPanel) { - // use {@link Ext.data.HttpProxy#setUrl setUrl} to change the URL for *just* this request. - var link = 'bpmn/proxyExtjs?pid=' + pro_uid + '&action=getVariables&type=' + tabPanel.id + '&sFieldName=form[CTO_CONDITION]&sSymbol=@@'; - varStore.proxy.setUrl(link, true); - varStore.load(); - } - }, - items : [ { - xtype : 'grid', - ds : varStore, - cm : varColumns, - width : 380, - autoHeight : true, - //plugins: [editor], - //loadMask : true, - loadingText : 'Loading...', - border : false, - listeners : { - //rowdblclick: alert("ok"), - rowdblclick : function() { - var objectSelected = workflow.variablesAction; - switch (objectSelected) { - case 'grid': - var getObjectGridRow = workflow.gridObjectRowSelected; - var FieldSelected = workflow.gridField; - //getting selected row of variables - var rowSelected = this.getSelectionModel().getSelected(); - var rowLabel = rowSelected.data.variable; - //Assigned new object with condition - if (typeof getObjectGridRow.colModel != 'undefined') - getObjectGridRow.colModel.config[3].editor.setValue(rowLabel); - //Assigning / updating Condition for a row - else - getObjectGridRow[0].set(FieldSelected, rowLabel); - Ext.Ajax.request( { - url : '../tracker/tracker_ConditionsSave.php', - method : 'POST', - params : { - PRO_UID : pro_uid, - CTO_UID : getObjectGridRow[0].data.CTO_UID, - CTO_CONDITION : getObjectGridRow[0].data.CTO_CONDITION - }, - success : function(response) { - Ext.MessageBox.alert('Status', 'Objects has been edited successfully '); - } - }) - window.hide(); - break; - case 'form': - FormSelected = workflow.formSelected; - rowSelected = this.getSelectionModel().getSelected(); - FieldSelected = workflow.fieldName; - rowLabel = rowSelected.data.variable; - var value = FormSelected.getForm().findField(FieldSelected).setValue(rowLabel); - window.hide(); - break; - - } - - } - } - } ] - } ] - } - }); - - var window = new Ext.Window( { - title : _('ID_VARIABLES'), - collapsible : false, - maximizable : false, - scrollable : true, - width : 400, - height : 350, - minWidth : 200, - minHeight : 150, - autoScroll : true, - layout : 'fit', - plain : true, - buttonAlign : 'center', - items : [ varForm ] - }); - window.show(); -} diff --git a/workflow/engine/templates/bpmn/SubProcess.js b/workflow/engine/templates/bpmn/SubProcess.js deleted file mode 100755 index 93afc9afd..000000000 --- a/workflow/engine/templates/bpmn/SubProcess.js +++ /dev/null @@ -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 += '
' + 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.
- * The string is first cleared and new string is painted.

- **/ - 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); -}; \ No newline at end of file diff --git a/workflow/engine/templates/bpmn/TaskContext.js b/workflow/engine/templates/bpmn/TaskContext.js deleted file mode 100755 index b99e5ebb3..000000000 --- a/workflow/engine/templates/bpmn/TaskContext.js +++ /dev/null @@ -1,2585 +0,0 @@ -TaskContext=function(id){ - Workflow.call(this,id); -}; -TaskContext.prototype=new Workflow; -TaskContext.prototype.type="TaskContext"; - - -TaskContext.prototype.editTaskSteps = function(_3252){ - var taskExtObj = new TaskContext(); - var ProcMapObj= new ProcessMapContext(); - var taskId = _3252.scope.workflow.currentSelection.id; - - var stepsFields = Ext.data.Record.create([ - { - name: 'STEP_TITLE', - type: 'string' - }, - { - name: 'STEP_UID', - type: 'string' - }, - { - name: 'STEP_TYPE_OBJ', - type: 'string' - }, - { - name: 'STEP_CONDITION', - type: 'string' - }, - { - name: 'STEP_POSITION', - type: 'string' - }, - { - name: 'STEP_MODE', - type: 'string' - }, - { - name: 'STEP_UID_OBJ', - type: 'string' - } - ]); - - var editor = new Ext.ux.grid.RowEditor({ - saveText: _('ID_UPDATE') - }); - - var btnAdd = new Ext.Button({ - id: 'btnAdd', - text: _('ID_ASSIGN'), - iconCls: 'button_menu_ext ss_sprite ss_add', - handler: function(){ - var User = grid.getStore(); - var e = new stepsFields({ - //STEP_TITLE: User.data.items[0].data.STEP_TITLE, - STEP_UID : '', - STEP_TYPE_OBJ : '', - STEP_CONDITION : '', - STEP_POSITION : '', - STEP_MODE : '', - STEP_UID_OBJ : '' - }); - - if(availableSteps.data.items.length == 0) - PMExt.notify( _('ID_STATUS') , _('ID_STEPS_UNAVAILABLE') ); - else - { - editor.stopEditing(); - taskSteps.insert(0, e); - grid.getView().refresh(); - //grid.getSelectionModel().selectRow(0); - editor.startEditing(0, 0); - } - } - }); - - var btnRemove = new Ext.Button({ - id: 'btnRemove', - text: _('ID_REMOVE'), - iconCls: 'button_menu_ext ss_sprite ss_pencil', - handler: function (s) { - editor.stopEditing(); - var s = grid.getSelectionModel().getSelections(); - for(var i = 0, r; r = s[i]; i++){ - - //First Deleting step from Database using Ajax - var stepUID = r.data.STEP_UID; - var stepPosition = r.data.STEP_POSITION; - - //if STEP_UID is properly defined (i.e. set to valid value) then only delete the row - //else its a BLANK ROW for which Ajax should not be called. - if(r.data.STEP_UID != "") - { - Ext.Ajax.request({ - url : '../steps/steps_Delete.php', - method: 'POST', - params: { - TASK : taskId, - STEP_UID : stepUID, - STEP_POSITION : stepPosition - }, - success: function(response) { - PMExt.notify( _('ID_STATUS') , _('ID_STEP_REMOVED') ); - //Secondly deleting from Grid - taskSteps.remove(r); - //Reloading store after removing steps - taskSteps.reload(); - } - }); - } - else - taskSteps.remove(r); - } - } - }); - - var tb = new Ext.Toolbar({ - items: [btnAdd, btnRemove] - }); - - // create the Data Store of all Steps that are already been assigned to a task - var taskSteps = new Ext.data.JsonStore({ - root : 'data', - totalProperty: 'totalCount', - idProperty : 'gridIndex', - remoteSort : true, - fields : stepsFields, - proxy : new Ext.data.HttpProxy({ - url : 'bpmn/proxyExtjs?tid='+taskId+'&action=getAssignedSteps' - }) - }); - taskSteps.load({params:{start : 0 , limit : 10 }}); - - // create the Data Store of all Steps that are not been assigned to a task i.e available steps - var availableSteps = new Ext.data.JsonStore({ - root : 'data', - url : 'bpmn/proxyExtjs?pid='+pro_uid+'&tid='+taskId+'&action=getAvailableSteps', - totalProperty : 'totalCount', - idProperty : 'gridIndex', - remoteSort : false, - autoLoad : true, - fields : stepsFields - - }); - availableSteps.load(); - - var btnStepsCondition = new Ext.Button({ - id: 'btnCondition', - text: _('ID_CONDITION'), - handler: function (s) { - workflow.taskUID = taskId - workflow.variablesAction = 'grid'; - workflow.variable = '@@', - workflow.gridField = 'STEP_CONDITION'; - var rowSelected = conditionGrid.getSelectionModel().getSelections(); - if(rowSelected == '') - workflow.gridObjectRowSelected = conditionGrid; - else - workflow.gridObjectRowSelected = rowSelected; - - var rowData = ProcMapObj.ExtVariables(); - console.log(rowData); - } - }) - - - var toolbar = new Ext.Toolbar({ - items: [btnStepsCondition] - }); - //availableSteps.load(); - var conditionGrid = new Ext.grid.GridPanel({ - store : taskSteps, - id : 'conditiongrid', - loadMask : true, - loadingText : 'Loading...', - frame : false, - autoHeight : false, - //enableDragDrop : true, - layout : 'form', - tbar : toolbar, - //ddGroup : 'firstGridDDGroup', - clicksToEdit : 1, - minHeight :400, - height :400, - plugins : [editor], - columns : [{ - id: 'STEP_TITLE', - header: _('ID_STEPS'), - dataIndex: 'STEP_TITLE', - width: 280, - editor: new Ext.form.TextField({ - }) - }, - { - id: 'STEP_CONDITION', - header: _('ID_CONDITION'), - dataIndex: 'STEP_CONDITION', - width: 250, - //editable: true, - editor: new Ext.form.TextField({ - editable : true - }) - } - ] - }); - - - - var grid = new Ext.grid.GridPanel({ - store : taskSteps, - id : 'mygrid', - loadMask : true, - loadingText : 'Loading...', - //renderTo : 'cases-grid', - frame : false, - autoHeight : false, - //enableDragDrop : true, - //ddGroup : 'firstGridDDGroup', - clicksToEdit: 1, - minHeight :400, - height :340, - layout : 'form', - plugins : [editor], - columns : [{ - id: 'STEP_TITLE', - header: _('ID_STEPS'), - dataIndex: 'STEP_TITLE', - width: 200, - sortable: true, - editor: new Ext.form.ComboBox({ - xtype : 'combo', - fieldLabel : 'Users_groups', - store : availableSteps, - displayField : 'STEP_TITLE' , - valueField : 'STEP_TITLE', - scope : this, - triggerAction: 'all', - emptyText : 'Select Step', - allowBlank : false, - onSelect: function(record, index){ - var User = grid.getStore(); - - if(typeof _3252.scope.workflow.currentrowIndex == 'undefined') - var selectedrowIndex = '0'; - else - selectedrowIndex = _3252.scope.workflow.currentrowIndex; //getting Index of the row that has been edited - - //User.data.items[0].data.STEP_TITLE= record.data.STEP_TITLE; - User.data.items[selectedrowIndex].data.STEP_UID = record.data.STEP_UID; - User.data.items[selectedrowIndex].data.STEP_TYPE_OBJ =record.data.STEP_TYPE_OBJ; - User.data.items[selectedrowIndex].data.STEP_CONDITION =record.data.STEP_CONDITION; - User.data.items[selectedrowIndex].data.STEP_POSITION =record.data.STEP_POSITION; - User.data.items[selectedrowIndex].data.STEP_UID_OBJ =record.data.STEP_UID_OBJ; - User.data.items[selectedrowIndex].data.STEP_MODE =record.data.STEP_MODE; - - this.setValue(record.data[this.valueField || this.displayField]); - this.collapse(); - } - }) - }, - { - id: 'STEP_MODE', - header: _('STEP_MODE'), - dataIndex: 'STEP_MODE', - width: 100, - sortable: true, - editor: new Ext.form.ComboBox ({ - editable : false, - triggerAction: 'all', - lazyRender:true, - allowBlank : false, - emptyText : 'Select Mode', - mode: 'local', - scope: this, - store: new Ext.data.ArrayStore({ - id: 0, - fields: [ - 'STEP_MODE', - 'STEP_MODE' - ], - data: [['EDIT', 'Edit'], ['VIEW', 'View']] - }), - valueField: 'STEP_MODE', - defaultValue: 'EDIT', - displayField: 'STEP_MODE', - onSelect: function(record, index){ - var User = grid.getStore(); - User.data.items[0].data.STEP_MODE=record.data.STEP_MODE; - this.setValue(record.data[this.valueField || this.displayField]); - this.collapse(); - } - }) - }, - { - sortable: false, - renderer: function() - { - return String.format("
Edit",pro_uid,taskId); - } - } - ], - sm: new Ext.grid.RowSelectionModel({ - singleSelect: true, - listeners: { - rowselect: function(smObj, rowIndex, record) { - _3252.scope.workflow.currentrowIndex = rowIndex; - } - } - }), - stripeRows: true, - viewConfig: {forceFit: true}, - tbar: tb, - bbar: new Ext.PagingToolbar({ - pageSize: 10, - store: taskSteps, - displayInfo: true, - displayMsg: 'Displaying Steps {0} - {1} of {2}', - emptyMsg: "No Steps to display", - items:[] - }) - }); - - editor.on({ - scope: this, - afteredit: function(roweditor, changes, record, rowIndex) { - - var stepUIDObj = record.data.STEP_UID_OBJ; - var stepTypeObj = record.data.STEP_TYPE_OBJ; - var stepMode = record.data.STEP_MODE; - - Ext.Ajax.request({ - url : '../steps/steps_Save.php', - method: 'POST', - params: { - sProcess : pro_uid, - sTask : taskId, - sType : stepTypeObj, - sUID : stepUIDObj, - sMode : stepMode - }, - success: function(response) { - PMExt.notify( _('ID_STATUS') , _('ID_STEP_ASSIGNED') ); - } - }); - //availableSteps.reload(); - //Deleting previously assigned step on updating/replacing with new step. - if(changes != '' && typeof record.json != 'undefined') - { - var stepUID = record.json.STEP_UID; - var stepPosition = record.json.STEP_POSITION; - - Ext.Ajax.request({ - url : '../steps/steps_Delete.php', - method: 'POST', - params: { - TASK : taskId, - STEP_UID : stepUID, - STEP_POSITION : stepPosition - }, - success: function(response) { - //Ext.MessageBox.alert ('Status','Step has been updated successfully.'); - } - }); - } - - } - }); - - - - //Getting triggers data using stepTriggers function - var treeGrid = taskExtObj.stepTriggers(_3252); - treeGrid.render(document.body); - - var taskStepsTabs = new Ext.FormPanel({ - labelWidth: 100, - monitorValid : true, - width : 850, - height : 400, - items: - { - xtype:'tabpanel', - activeTab: 0, - defaults:{ - autoHeight:true - }, - items:[{ - title:_('ID_STEPS'), - layout:'fit', - defaults: { - width: 400 - }, - listeners: { - tabchange: function(tabPanel,newTab){ - taskSteps.reload(); - } - }, - items:[grid] - },{ - title:_('ID_CONDITION'), - layout:'fit', - defaults: { - width: 400 - }, - listeners: { - tabchange: function(tabPanel,newTab){ - taskSteps.reload(); - } - }, - items:[conditionGrid] - },{ - title:_('ID_TRIGGERS'), - layout:'form', - defaults: { - width: 400 - }, - items:[treeGrid] - }] - } - }); - - taskStepsTabs.render(document.body); - _3252.scope.workflow.taskStepsTabs = taskStepsTabs; - - var window = new Ext.Window({ - title: _('ID_STEPS_OF'), - collapsible: false, - maximizable: false, - width: 770, - height: 380, - minWidth: 200, - minHeight: 150, - layout: 'fit', - plain: true, - buttonAlign: 'center', - items: taskStepsTabs - - }); - window.show(); -} - -TaskContext.prototype.editUsers= function() -{ - var taskExtObj = new TaskContext(); - var taskId = workflow.currentSelection.id; - var userFields = Ext.data.Record.create([ - { - name: 'LABEL', - type: 'string' - }, - { - name: 'TU_TYPE', - type: 'string' - }, - { - name: 'TU_RELATION', - type: 'string' - }, - { - name: 'TAS_UID', - type: 'string' - }, - { - name: 'USR_UID', - type: 'string' - } - ]); - var editor = new Ext.ux.grid.RowEditor({ - saveText: _('ID_UPDATE') - }); - - - var btnAdd = new Ext.Button({ - id: 'btnAdd', - text: _('ID_ASSIGN'), - iconCls: 'button_menu_ext ss_sprite ss_add', - handler: function(){ - var User = grid.getStore(); - var e = new userFields({ - TAS_UID : '', - TU_TYPE : '', - USR_UID : '', - TU_RELATION: '' - }); - //storeUsers.reload(); - if(storeUsers.data.items.length == 0) - PMExt.notify( _('ID_STATUS') , _('ID_USERS_UNAVAILABLE') ); - else - { - editor.stopEditing(); - taskUsers.insert(0, e); - grid.getView().refresh(); - editor.startEditing(0, 0); - } - } - }); - - var btnRemove = new Ext.Button({ - id: 'btnRemove', - text: _('ID_REMOVE'), - iconCls: 'application_delete', - handler: function (s) { - editor.stopEditing(); - var s = grid.getSelectionModel().getSelections(); - for(var i = 0, r; r = s[i]; i++){ - - //First Deleting assigned users from Database - var user_TURel = r.data.TU_RELATION; - var userUID = r.data.USR_UID; - var user_TUtype = r.data.TU_TYPE; - var urlparams = '?action=ofToAssign&data={"TAS_UID":"'+taskId+'","TU_RELATION":"'+user_TURel+'","USR_UID":"'+userUID+'","TU_TYPE":"'+user_TUtype+'"}'; - - //if USR_UID is properly defined (i.e. set to valid value) then only delete the row - //else its a BLANK ROW for which Ajax should not be called. - if(r.data.USR_UID != "") - { - Ext.Ajax.request({ - url : 'bpmn/processes_Ajax.php' +urlparams , - success: function(response) { - PMExt.notify( _('ID_STATUS') , _('ID_USERS_REMOVED') ); - //Secondly deleting from Grid - taskUsers.remove(r); - - //Reloading available user store - taskUsers.reload(); - } - }); - } - else - taskUsers.remove(r); - } - } - }); - - var tb = new Ext.Toolbar({ - items: [btnAdd, btnRemove] - }); - - // create the Data Store of users that are already assigned to a task - var taskUsers = new Ext.data.JsonStore({ - root : 'data', - totalProperty: 'totalCount', - idProperty : 'gridIndex', - remoteSort : true, - fields : userFields, - proxy: new Ext.data.HttpProxy({ - url: 'bpmn/proxyExtjs?pid='+pro_uid+'&tid='+taskId+'&action=getAssignedUsersList' - }) - }); - taskUsers.setDefaultSort('LABEL', 'asc'); - - - // create the Data Store of users that are not assigned to a task - var storeUsers = new Ext.data.JsonStore({ - root : 'data', - url : 'bpmn/proxyExtjs?tid='+taskId+'&action=getAvailableUsersList', - totalProperty : 'totalCount', - idProperty : 'gridIndex', - remoteSort : false, //true, - autoLoad : true, - fields : userFields - }); - storeUsers.load(); - - var grid = new Ext.grid.GridPanel({ - store: taskUsers, - id : 'mygrid', - loadMask: true, - loadingText: 'Loading...', - //renderTo: 'cases-grid', - frame: false, - autoHeight:false, - clicksToEdit: 1, - minHeight:400, - height :320, - layout: 'fit', - plugins: [editor], - cm: new Ext.grid.ColumnModel({ - defaults: { - width: 200, - sortable: true - }, - columns: [ - new Ext.grid.RowNumberer(), - { - id: 'LABEL', - header:_('ID_GROUP_USER'), - dataIndex: 'LABEL', - width: 100, - editor: new Ext.form.ComboBox({ - xtype: 'combo', - fieldLabel: 'Users_groups', - hiddenName: 'number', - store : storeUsers, - displayField : 'LABEL' , - valueField : 'LABEL', - name : 'LABEL', - triggerAction: 'all', - emptyText: 'Select User or Group', - allowBlank: false, - onSelect: function(record, index){ - var User = grid.getStore(); - - if(typeof workflow.currentrowIndex == 'undefined') - var selectedrowIndex = '0'; - else - selectedrowIndex = workflow.currentrowIndex; //getting Index of the row that has been edited - - //User.data.items[0].data.LABEL= record.data.LABEL; - User.data.items[selectedrowIndex].data.TAS_UID = record.data.TAS_UID; - User.data.items[selectedrowIndex].data.TU_TYPE = record.data.TU_TYPE; - User.data.items[selectedrowIndex].data.USR_UID = record.data.USR_UID; - User.data.items[selectedrowIndex].data.TU_RELATION = record.data.TU_RELATION; - - this.setValue(record.data[this.valueField || this.displayField]); - this.collapse(); - } - }) - }, - ] - }), - sm: new Ext.grid.RowSelectionModel({ - singleSelect: true, - listeners: { - rowselect: function(smObj, rowIndex, record) { - workflow.currentrowIndex = rowIndex; - } - } - }), - - stripeRows: true, - viewConfig: {forceFit: true}, - bbar: new Ext.PagingToolbar({ - pageSize: 10, - store: taskUsers, - displayInfo: true, - displayMsg: 'Displaying Users {0} - {1} of {2}', - emptyMsg: "No Users to display", - items:[] - }), - tbar: tb - }); - - taskUsers.load({params:{start : 0 , limit : 10 }}); - - editor.on({ - scope: this, - afteredit: function(roweditor, changes, record, rowIndex) { - var taskId = record.data.TAS_UID; - var userId = record.data.USR_UID; - var tu_Type = record.data.TU_TYPE; - var tu_Relation = record.data.TU_RELATION; - var urlparams = '?action=assign&data={"TAS_UID":"'+taskId+'","USR_UID":"'+userId+'","TU_TYPE":"'+tu_Type+'","TU_RELATION":"'+tu_Relation+'"}'; - - Ext.Ajax.request({ - url: 'bpmn/processes_Ajax.php' +urlparams , - success: function (response) { // When saving data success - PMExt.notify( _('ID_STATUS') , _('ID_USER_ASSIGNED') ); - }, - failure: function () { // when saving data failed - PMExt.notify( _('ID_STATUS') , _('ID_USER_SAVE_FAIL') ); - } - }); - - //Updating the user incase if already assigned user has been replaced by other user - if(changes != '' && typeof record.json != 'undefined') - { - var user_TURel = record.json.TU_RELATION; - var userUID = record.json.USR_UID; - var user_TUtype = record.json.TU_TYPE; - urlparams = '?action=ofToAssign&data={"TAS_UID":"'+taskId+'","TU_RELATION":"'+user_TURel+'","USR_UID":"'+userUID+'","TU_TYPE":"'+user_TUtype+'"}'; - Ext.Ajax.request({ - url : 'bpmn/processes_Ajax.php' +urlparams , - success: function(response) { - //Ext.MessageBox.alert ('Status','User has been updated successfully.'); - } - }); - } - storeUsers.reload(); - } - }); - - var panel = new Ext.Panel({ - id: 'panel', - //renderTo: Ext.getBody(), - items: [grid] - }); - - var window = new Ext.Window({ - title: _('ID_USERS_GROUPS'), - collapsible: false, - maximizable: false, - width: 400, - height: 350, - minWidth: 200, - minHeight: 150, - //layout: 'fit', - plain: true, - buttonAlign: 'center', - items: panel - }); - window.show(); -} - - -TaskContext.prototype.editTaskProperties= function() -{ - var ProcMapObj = new ProcessMapContext(); - var taskExtObj = new TaskContext(); - var taskId = workflow.currentSelection.id; - var oPmosExt = new pmosExt(); - - var fieldsToToggle = new Array(); - - var taskPropertiesTabs = new Ext.FormPanel({ - labelWidth : 140, - //border : false, - monitorValid : true, - // store : taskDetails, - //url : 'proxyTaskPropertiesDetails.php', - width : 600, - items: [{ - xtype:'tabpanel', - activeTab: 0, - bodyStyle : 'padding:5px 0 0 5px;', - defaults:{ - labelWidth : 140, - height : 300 - }, - items:[ - { - title:_('ID_DEFINITION'), - layout:'form', - defaults: { - width: 230 - }, - defaultType: 'textfield', - items: [{ - fieldLabel: _('ID_TITLE'), - name: 'TAS_TITLE', - width: 350 - },{ - xtype: 'textarea', - fieldLabel: _('ID_DESCRIPTION'), - name: 'TAS_DESCRIPTION', - allowBlank: true, - width: 350, - height : 150 - },{ - xtype: 'fieldset', - layout:'column', - border : false, - width: 550, - items:[{ - columnWidth:.7, - layout: 'form', - border : false, - items: [{ - xtype: 'textfield', - labelWidth : 130, - fieldLabel: _('ID_VARIABLES_CASE_PRIORITY'), - name: 'TAS_PRIORITY_VARIABLE', - anchor:'100%' - }] - },{ - columnWidth:.2, - layout: 'form', - border:false, - items: [{ - xtype:'button', - title: ' ', - text: '@@', - name: 'selectorigin', - handler: function (s) { - workflow.variablesAction = 'form'; - workflow.fieldName = 'TAS_PRIORITY_VARIABLE' ; - workflow.formSelected = taskPropertiesTabs; - var rowData = ProcMapObj.ExtVariables(); - console.log(rowData); - } - }] - }] - },{ - xtype: 'checkbox', - fieldLabel: _('ID_START_TASK'), - name: 'TAS_START', - checked:workflow.checkStartingTask - }] - },{ - title:_('ID_ASSIGNMENT_RULES'), - layout : 'form', - defaults: { - width: 260 - }, - items: [{ - xtype: 'radiogroup', - //id: 'assignType', - fieldLabel: _('ID_CASES_ASSIGNED_BY'), - itemCls: 'x-check-group-alt', - columns: 1, - items: [{ - boxLabel: _('ID_CYCLIC_ASSIGNMENT'), - //id: 'BALANCED', - name: 'TAS_ASSIGN_TYPE', - inputValue: 'BALANCED', - checked: false -// listeners: { -// 'check':{ -// fn: function(){ -// Ext.getCmp("staticMI").hide(); -// Ext.getCmp("cancelMI").hide(); -// Ext.getCmp("evaluate").hide(); -// } -// } -// } - },{ - boxLabel: _('ID_MANUAL_ASSIGNMENT'), - // id: 'MANUAL', - name: 'TAS_ASSIGN_TYPE', - inputValue: 'MANUAL', - checked:false -// listeners: { -// 'check':{ -// fn: function(){ -// Ext.getCmp("staticMI").hide(); -// Ext.getCmp("cancelMI").hide(); -// Ext.getCmp("evaluate").hide(); -// } -// } -// } - },{ - boxLabel: _('ID_VALUE_BASED'), - //id:'EVALUATE', - name: 'TAS_ASSIGN_TYPE', - inputValue: 'EVALUATE', - checked:false -// listeners: { -// 'check':{ -// fn: function(){ - - -// var fields = workflow.taskPropertiesTabs.items.items[0].items.items[1].items.items; -// var fieldsToToggle = new Array(); -// fieldsToToggle = [fields[1].items.items[0].items.items[0]]; -// oPmosExt.toggleFields(fieldsToToggle,true); -// } -// } -// } - },{ - boxLabel: _('ID_REPORTS_TO'), - //id:'REPORT_TO', - name: 'TAS_ASSIGN_TYPE', - inputValue: 'REPORT_TO', - checked:false -// listeners: { -// 'check':{ -// fn: function(){ -// Ext.getCmp("staticMI").hide(); -// Ext.getCmp("cancelMI").hide(); -// Ext.getCmp("evaluate").hide(); -// } -// } -// } - },{ - boxLabel: _('ID_SELF_SERVICE'), - //id:'SELF_SERVICE', - name: 'TAS_ASSIGN_TYPE', - inputValue: 'SELF_SERVICE', - checked:false -// listeners: { -// 'check': -// {fn: function(){ -// //fieldsToToggle = [fields[0],fields[1],fields[2],fields[3],fields[4],fields[5],fields[6],fields[7],fields[8]] -// Ext.getCmp("staticMI").hide(); -// Ext.getCmp("cancelMI").hide(); -// Ext.getCmp("evaluate").hide(); -// } -// } -// } - },{ - boxLabel: _('ID_STATIC_PARTIAL_JOIN_MULTIPLE_INSTANCES'), - //id:'STATIC_MI', - name: 'TAS_ASSIGN_TYPE', - inputValue: 'STATIC_MI', - checked:false -// listeners: { -// 'check':{ -// fn: function(){ -// Ext.getCmp("staticMI").show(); -// Ext.getCmp("cancelMI").show(); -// Ext.getCmp("evaluate").hide(); -// } -// } -// } - },{ - boxLabel: _('ID_CANCEL_PARTIAL_JOIN_MULTIPLE_INSTANCE'), - //id : 'CANCEL_MI', - name : 'TAS_ASSIGN_TYPE', - inputValue: 'CANCEL_MI', - checked:false -// listeners: { -// 'check':{ -// fn: function(){ -// Ext.getCmp("staticMI").show(); -// Ext.getCmp("cancelMI").show(); -// Ext.getCmp("evaluate").hide(); -// } -// } -// } - }] - - - },{ - xtype: 'fieldset', - layout:'column', - border:false, - width: 550, - hidden: true, - id: 'evaluate', - items:[{ - columnWidth:.8, - layout: 'form', - border:false, - items: [{ - xtype: 'textfield', - fieldLabel: _('ID_VARIABLES_VALUE_ASSIGNMENT'), - name: 'TAS_ASSIGN_VARIABLE', - anchor:'100%' - }] - },{ - columnWidth:.2, - layout: 'form', - border:false, - items: [{ - xtype:'button', - title: ' ', - text: '@@', - name: 'selectorigin' - }] - } - ] - },{ - xtype: 'fieldset', - layout:'column', - border:false, - width: 550, - hidden: true, - id: 'staticMI', - items:[{ - columnWidth:.8, - layout: 'form', - border:false, - items: [{ - xtype: 'textfield', - fieldLabel: _('ID_VARIABLES_NO_INSTANCES'), - name: 'TAS_MI_INSTANCE_VARIABLE', - anchor:'100%' - }] - },{ - columnWidth:.2, - layout: 'form', - border:false, - items: [{ - xtype:'button', - title: ' ', - text: '@@', - name: 'selectorigin' - }] - }] - },{ - xtype: 'fieldset', - layout:'column', - border:false, - width: 550, - hidden: true, - id: 'cancelMI', - items:[{ - columnWidth:.8, - layout: 'form', - border:false, - items: [{ - xtype: 'textfield', - fieldLabel: _('ID_VARIABLES_INSTANCES_TO _COMPLETE'), - name: 'TAS_MI_COMPLETE_VARIABLE', - anchor:'100%' - }] - },{ - columnWidth:.2, - layout: 'form', - border:false, - items: [{ - xtype:'button', - title: ' ', - text: '@@', - name: 'selectorigin' - }] - }] - }] - },{ - title:'Timing Control Rules', - layout:'form', - defaults: { - width: 260 - }, - defaultType: 'textfield', - items: [{ - xtype: 'checkbox', - boxLabel: _('ID_USER_DEFINED_TIMING_CONTROL'), - name: 'TAS_TRANSFER_FLY', - checked: 'TAS_TRANSFER_FLY', - labelWidth: 100, - listeners: { - /**Listeners for hiding all the fields - * under "Timing Control Rules" tabs - * when user clicks on 'Allow user defined timing control' checkbox - **/ - check : function(a,checked,c) { - if(checked == true) - Ext.getCmp("userDefinedTiming").hide(); - else - Ext.getCmp("userDefinedTiming").show(); - } - } - },{ - xtype: 'fieldset', - layout:'form', - border:false, - width: 550, - hidden: false, - id: 'userDefinedTiming', - - items:[{ - xtype: 'textfield', - fieldLabel: _('ID_TASK_DURATION'), - name: 'TAS_DURATION', - width : 100, - allowBlank:false - },{ - width: 100, - xtype: 'combo', - mode: 'local', - triggerAction: 'all', - forceSelection: true, - editable: false, - fieldLabel: _('ID_TIME_UNIT'), - name: 'TAS_TIMEUNIT', - hiddenName: 'TAS_TIMEUNIT', - displayField: 'name', - valueField: 'value', - store: new Ext.data.JsonStore({ - fields : ['name', 'value'], - data : [ - { - name : 'Days', - value: 'Days' - },{ - name : 'Hours', - value: 'Hours' - }] - }) - },{ - width: 120, - xtype: 'combo', - mode: 'local', - //value: '- None -', - triggerAction: 'all', - forceSelection: true, - editable: false, - fieldLabel: _('ID_COUNT_DAYS'), - name: 'TAS_TYPE_DAY', - hiddenName: 'TAS_TYPE_DAY', - displayField: 'name', - //value: 'TAS_TYPE_DAY', - valueField: 'value', - store: new Ext.data.JsonStore({ - fields : ['name', 'value'], - data : [ - { - name : 'Work Days', - value: '1' - }, - - { - name : 'Calendar Days', - value: '2' - }, - ] - }) - },{ - width: 100, - xtype: 'combo', - mode: 'local', - value: 'Default', - forceSelection: true, - triggerAction: 'all', - editable: false, - fieldLabel: _('ID_CALENDAR'), - name: 'TAS_CALENDAR', - hiddenName: 'TAS_CALENDAR', - displayField: 'name', - valueField: 'value', - store: new Ext.data.JsonStore({ - fields : ['name', 'value'], - data : [ - { - name : '- None-', - value: '- None-' - }, - - { - name : 'Default', - value: 'Default' - }, - ] - }) - }] - }] - },{ - title:_('ID_PERMISSION'), - layout:'form', - defaults: { - width: 260 - }, - defaultType: 'textfield', - labelWidth: 200, - items: [{ - xtype: 'checkbox', - //id: 'ADHOC', - fieldLabel: _('ID_ALLOW_ARBITARY_TRANSFER'), - inputValue:'ADHOC', - checked: false, - name: 'TAS_TYPE' - }] - },{ - title:_('ID_CASE_LABELS'), - layout:'form', - defaults: { - width: 600 - }, - defaultType: 'textfield', - labelWidth: 70, - items: [{ - xtype: 'fieldset', - layout:'column', - border:false, - width: 600, - items:[{ - columnWidth:.8, - layout: 'form', - border:false, - items: [{ - xtype: 'textarea', - fieldLabel: _('ID_CASE_TITLE'), - //id: 'caseTitle', - name: 'TAS_DEF_TITLE', - height : 120, - //value: _5625.scope.workflow.taskDetails.TAS_ASSIGN_VARIABLE - anchor:'100%' - }] - },{ - columnWidth:.2, - layout: 'form', - border:false, - items: [{ - xtype:'button', - title: ' ', - text: '@#', - name: 'selectCaseTitle', - handler: function (s) { - workflow.variablesAction = 'form'; - workflow.variable = '@%23', - workflow.fieldName = 'TAS_DEF_TITLE' ; - workflow.formSelected = taskPropertiesTabs; - var rowData = ProcMapObj.ExtVariables(); - console.log(rowData); - } - }] - }] - },{ - xtype: 'fieldset', - layout:'column', - border:false, - width: 600, - items:[{ - columnWidth:.8, - layout: 'form', - border:false, - items: [{ - xtype: 'textarea', - //id: 'caseDescription', - fieldLabel: _('ID_CASE_DESCRIPTION'), - name: 'TAS_DEF_DESCRIPTION', - height : 120, - anchor:'100%' - - }] - },{ - columnWidth:.2, - layout: 'form', - border:false, - items: [{ - xtype:'button', - title: ' ', - text: '@#', - name: 'selectCaseDesc', - handler: function (s) { - workflow.variablesAction = 'form'; - workflow.variable = '@%23', - workflow.fieldName= 'TAS_DEF_DESCRIPTION' ; - workflow.formSelected = taskPropertiesTabs; - var rowData = ProcMapObj.ExtVariables(); - console.log(rowData); - } - }] - }] - }] - },{ - title:_('ID_NOTIFICATION'), - layout:'form', - defaultType: 'textfield', - labelWidth: 170, - items: [{ - xtype: 'checkbox', - boxLabel: _('ID_NOTIFY_USERS_AFTER_ASSIGN'), - labelWidth: 100, - name: 'SEND_EMAIL', - checked: 'TAS_DEF_MESSAGE_CHECKBOX', - listeners: { - /**Listeners for showing "TAS_DEF_MESSAGE" textarea field - * under "Notification" tab - * when user clicks on 'After routing notify the next assigned user(s).' checkbox - **/ - check : function(a,checked,c) { - if(checked == true) - Ext.getCmp("notifyUser").show(); - else - Ext.getCmp("notifyUser").hide(); - } - } - },{ - xtype: 'fieldset', - id: 'notifyUser', - border: false, - defaults: { - width: 400 - }, - labelWidth: 50, - hidden: true, - items :[{ - xtype: 'textarea', - name: 'TAS_DEF_MESSAGE', - width: 400, - height : 180 - }] - }] - } - ] - }] - }); - - workflow.taskPropertiesTabs = taskPropertiesTabs; - - - //Loading Task Details into the form - taskPropertiesTabs.form.load({ - url:'bpmn/proxyExtjs.php?tid='+taskId+'&action=getTaskPropertiesList', - method:'GET', - waitMsg:'Loading', - success:function(form, action) { - alert(action.result.data.TAS_START); - if(action.result.data.TAS_START== true) - workflow.checkStartingTask = 'on'; - else - workflow.checkStartingTask = 'off'; - - //To load the values of the selecte radio button in Assignment Rules - if(action.result.data.TAS_ASSIGN_TYPE=='BALANCED') - form.items.items[4].items[0].checked=true; - - else if(action.result.data.TAS_ASSIGN_TYPE=='MANUAL') - { - form.items.items[4].items[1].checked=true; - //Ext.getCmp(ID).setValue(true); - //taskPropertiesTabs.getForm().findField('TAS_ASSIGN_TYPE').setValue(true); - } - else if(action.result.data.TAS_ASSIGN_TYPE=='EVALUATE') - { - form.items.items[4].items[2].checked=true; - taskPropertiesTabs.getForm().findField('TAS_ASSIGN_VARIABLE').show(); - } - - else if(action.result.data.TAS_ASSIGN_TYPE=='REPORT_TO') - form.items.items[4].items[3].checked=true; - - else if(action.result.data.TAS_ASSIGN_TYPE=='SELF_SERVICE') - {form.items.items[4].items[4].checked=true; - Ext.getCmp("staticMI").hide(); - Ext.getCmp("cancelMI").hide();} - - else if(action.result.data.TAS_ASSIGN_TYPE=='STATIC_MI') - { - form.items.items[4].items[5].checked=true; - Ext.getCmp("staticMI").show(); - Ext.getCmp("cancelMI").show(); - Ext.getCmp("evaluate").hide(); - } - - else if(action.result.data.TAS_ASSIGN_TYPE=='CANCEL_MI') - { - form.items.items[4].items[6].checked=true; - Ext.getCmp("staticMI").show(); - Ext.getCmp("cancelMI").show(); - Ext.getCmp("evaluate").hide(); - } - - if(action.result.data.TAS_TYPE == 'ADHOC') - form.items.items[13].checked=false; - else - form.items.items[13].checked=true; - - - if(action.result.data.TAS_ASSIGN_TYPE == 'EVALUATE') - form.findField('TAS_ASSIGN_VARIABLE').show(); - - - - }, - failure:function(form, action) { - PMExt.notify( _('ID_STATUS') , _('ID_FAILURE') ); - } - }); - - taskPropertiesTabs.render(document.body); - workflow.taskPropertiesTabs = taskPropertiesTabs; - - var window = new Ext.Window({ - title: _('ID_TASK'), - collapsible: false, - maximizable: false, - width: 600, - height: 370, - minWidth: 300, - minHeight: 150, - layout: 'fit', - plain: true, - buttonAlign: 'center', - items: taskPropertiesTabs, - buttons: [{ - text: _('ID_SAVE'), - formBind :true, - handler: function(){ - //var getstore = taskPropertiesTabs.getStore(); - //var getData = getstore.data.items; - taskExtObj.saveTaskProperties(); - //window.hide(); - - } - },{ - text: _('ID_CANCEL'), - handler: function(){ - // when this button clicked, - window.hide(); - } - }] - }); - window.show(); - -} - -TaskContext.prototype.saveTaskProperties= function() -{ - var saveTaskform = workflow.taskPropertiesTabs.getForm().getValues(); - var taskId = workflow.currentSelection.id; - var tas_start = saveTaskform['TAS_START']; - var tas_type = saveTaskform['TAS_TYPE']; - var tas_transfer_fly = saveTaskform['TAS_TRANSFER_FLY']; - var send_email = saveTaskform['SEND_EMAIL']; - saveTaskform['TAS_UID'] = taskId; - alert(tas_start); - - //Checking checkbox fields - if(typeof tas_start != 'undefined' && tas_start != ''){ - if(tas_start == 'on') - saveTaskform['TAS_START'] = 'TRUE'; - } - else - saveTaskform['TAS_START'] = 'FALSE'; - - if(typeof tas_transfer_fly != 'undefined' && tas_transfer_fly != ''){ - if(tas_transfer_fly == 'on') - saveTaskform['TAS_TRANSFER_FLY'] = 'TRUE'; - } - else - saveTaskform['TAS_TRANSFER_FLY'] = 'FALSE'; - - if(typeof send_email != 'undefined' && send_email != ''){ - if(send_email == 'on') - saveTaskform['SEND_EMAIL'] = 'TRUE'; - } - else - saveTaskform['SEND_EMAIL'] = 'FALSE'; - - if(typeof tas_type != 'undefined' && tas_type != ''){ - if(tas_type == 'on') - saveTaskform['TAS_TYPE'] = 'ADHOC'; - } - else - saveTaskform['TAS_TYPE'] = 'NORMAL'; - - var object_data = Ext.util.JSON.encode(saveTaskform); - - Ext.Ajax.request({ - url: '../tasks/tasks_Ajax.php' , - success: function (response) { // When saving data success - PMExt.notify( _('ID_STATUS') , _('ID_TASK_PROPERTIES_SAVE') ); - }, - failure: function () { // when saving data failed - PMExt.notify( _('ID_STATUS') , _('ID_ERROR_TASK_SAVE') ); - }, - params: { - functions:'saveTaskData', - oData:object_data - } - }); -} - -TaskContext.prototype.stepTriggers = function() - { - var taskId = workflow.currentSelection.id; - var ProcMapObj= new ProcessMapContext(); - var triggersFields = Ext.data.Record.create([ - { - name: 'CON_VALUE', - type: 'string' - }, - { - name: 'ST_TYPE', - type: 'string' - }, - { - name: 'STEP_UID', - type: 'string' - }, - { - name: 'TRI_UID', - type: 'string' - }, - { - name: 'ST_POSITION', - type: 'string' - }, - { - name: 'TRI_TITLE', - type: 'string' - }, - { - name: 'ST_CONDITION', - type: 'string' - } - ]); - - var triggerEditor = new Ext.ux.grid.RowEditor({ - saveText: _('ID_UPDATE') - }); - - var root = new Ext.tree.AsyncTreeNode({text: 'treeRoot',id:'0'}); - var tree = new Ext.tree.TreePanel({ - //renderTo : 'cases-grid', - dataUrl : 'get-triggers-tree.php?tid='+taskId, - border : false, - rootVisible : false, - height : 320, - width : 230, - useArrows : false, - autoScroll : true, - animate : true - }); - tree.setRootNode(root); - root.expand(true); - - tree.on('click', function (node){ - if(node.isLeaf()){ - var sStepUID = node.attributes.id; - workflow.selectedStepUID = sStepUID; - - stepsTriggers.on({ - beforeload: { - fn: function (store, options) { - // use {@link Ext.data.HttpProxy#setUrl setUrl} to change the URL for *just* this request. - var link = 'bpmn/proxyExtjs?tid='+taskId+'&stepid='+sStepUID+'&action=getAssignedStepTriggers'; - store.proxy.setUrl(link, true); - } - } - }); - - availableTriggers.on({ - beforeload: { - fn: function (store, options) { - // use {@link Ext.data.HttpProxy#setUrl setUrl} to change the URL for *just* this request. - var link = 'bpmn/proxyExtjs?pid='+pro_uid+'&tid='+taskId+'&stepid='+sStepUID+'&action=getAvailableStepTriggers'; - store.proxy.setUrl(link, true); - } - } - }); - - triggerGrid.store.load(); - availableTriggers.load(); - //availableTriggers.reload(); - triggerGrid.show(); - } - else - triggerGrid.hide(); - }); - - - var addBtn = new Ext.Button({ - id: 'addBtn', - text: _('ID_ADD'), - iconCls: 'button_menu_ext ss_sprite ss_add', - handler: function(){ - //var User = triggerGrid.getStore(); - var e1 = new triggersFields({ - //STEP_TITLE: User.data.items[0].data.STEP_TITLE, - CON_VALUE : '', - ST_TYPE : '', - STEP_UID : '', - TRI_UID : '', - ST_POSITION : '', - ST_CONDITION : '', - TRI_TITLE : '' - }); - - if(availableTriggers.data.items.length == 0) - PMExt.notify( _('ID_STATUS') , _('ID_TRIGGERS_UNAVAILABLE') ); - else - { - triggerEditor.stopEditing(); - stepsTriggers.insert(0, e1); - triggerGrid.getView().refresh(); - //triggerGrid.getSelectionModel().selectRow(0); - triggerEditor.startEditing(0, 0); - } - - } - }); - - var removeBtn = new Ext.Button({ - id: 'removeBtn', - text: _('ID_REMOVE'), - iconCls: 'button_menu_ext ss_sprite ss_delete', - handler: function (s) { - triggerEditor.stopEditing(); - var s = triggerGrid.getSelectionModel().getSelections(); - for(var i = 0, r; r = s[i]; i++){ - - //First Deleting step from Database using Ajax - var stepUID = r.data.STEP_UID; - var sTrigger = r.data.TRI_UID; - var sType = r.data.ST_TYPE; - var iPosition = r.data.ST_POSITION; - var urlparams = '?action=ofToAssignTrigger&sStep=' + stepUID + '&sTrigger=' + sTrigger + '&sType=' + sType + '&iPosition=' + iPosition - - //if STEP_UID is properly defined (i.e. set to valid value) then only delete the row - //else its a BLANK ROW for which Ajax should not be called. - if(r.data.STEP_UID != "") - { - Ext.Ajax.request({ - url : '../steps/steps_Ajax.php' + urlparams, - success: function(response) { - PMExt.notify( _('ID_STATUS') , _('ID_TRIGGER_REMOVE') ); - //Secondly deleting from Grid - stepsTriggers.remove(r); - - availableTriggers.reload(); - } - }); - } - else - stepsTriggers.remove(r); - } - } - }); - - - var btnTriggerCondition = new Ext.Button({ - //id: 'btnCondition', - text: _('ID_CONDITION'), - handler: function (s) { - workflow.variablesAction = 'grid'; - workflow.variable = '@@', - workflow.gridField = 'ST_CONDITION'; - var rowSelected = triggerGrid.getSelectionModel().getSelections(); - if(rowSelected == '') - workflow.gridObjectRowSelected = triggerGrid; - else - workflow.gridObjectRowSelected = rowSelected; - //var rowSelected = Objectsgrid; - //workflow.gridObject = Objectsgrid; - var rowData = ProcMapObj.ExtVariables(); - } - }); - - var toolBar = new Ext.Toolbar({ - items: [addBtn, removeBtn, btnTriggerCondition] - }); - - - // create the Data Store of users that are already assigned to a task - var stepsTriggers = new Ext.data.JsonStore({ - root : 'data', - url : 'bpmn/proxyExtjs?tid='+taskId+'&action=',//+'&stepid='+workflow.selectedStepUID, - totalProperty : 'totalCount', - idProperty : 'gridIndex', - remoteSort : true, - fields : triggersFields - }); - //taskUsers.setDefaultSort('LABEL', 'asc'); - stepsTriggers.load({params:{start : 0 , limit : 5 }}); - - var availableTriggers = new Ext.data.JsonStore({ - root : 'data', - url : 'bpmn/proxyExtjs?pid='+pro_uid+'&tid='+taskId+'&action=',//+'&stepid='+workflow.selectedStepUID, - totalProperty : 'totalCount', - idProperty : 'gridIndex', - remoteSort : false, //true, - autoLoad : true, - fields : triggersFields - }); - - //availableTriggers.load(); - - var triggerGrid = new Ext.grid.GridPanel({ - store: stepsTriggers, - id : 'triggerGrid', - //cm: cm, - loadMask: true, - loadingText: 'Loading...', - //renderTo: 'cases-grid', - frame: false, - autoHeight:false, - hidden :true, - clicksToEdit: 1, - width : 450, - minHeight:400, - height :320, - layout: 'fit', - plugins: [triggerEditor], - columns: [ - new Ext.grid.RowNumberer(), - { - id: 'blank', - hidden : true, - //width:0, - editable: true, - editor: new Ext.form.TextField({ - allowBlank: true - }) - }, - { - id: 'CON_VALUE', - header: _('ID_TRIGGERS'), - dataIndex: 'CON_VALUE', - //width: 200, - sortable: true, - editor: new Ext.form.ComboBox({ - id : 'available', - xtype : 'combo', - fieldLabel : 'Users_groups', - hiddenName : 'number', - store : availableTriggers, - displayField : 'CON_VALUE', - valueField : 'CON_VALUE', - name : 'CON_VALUE', - scope : this, - triggerAction: 'all', - emptyText : 'Select Triggers', - allowBlank : false, - onSelect : function(record, index){ - var triggerStore = triggerGrid.getStore(); - - if(typeof workflow.currentRowTrigger == 'undefined') - var selectedrowIndex = '0'; - else - selectedrowIndex = workflow.currentRowTrigger; //getting Index of the row that has been edited - - //User.data.items[0].data.CON_VALUE = record.data.CON_VALUE; - triggerStore.data.items[selectedrowIndex].data.ST_TYPE = record.data.ST_TYPE; - triggerStore.data.items[selectedrowIndex].data.STEP_UID = record.data.STEP_UID; - triggerStore.data.items[selectedrowIndex].data.TRI_UID = record.data.TRI_UID; - triggerStore.data.items[selectedrowIndex].data.ST_POSITION = record.data.ST_POSITION; - triggerStore.data.items[selectedrowIndex].data.TRI_TITLE = record.data.TRI_TITLE; - - workflow.currentrowIndex = '0'; - this.setValue(record.data[this.valueField || this.displayField]); - this.collapse(); - } - }) - }, - { - //id: 'STEP_TITLE', - header: _('ID_CONDITION'), - dataIndex: 'ST_CONDITION', - //width: 200, - editable: true, - editor: new Ext.form.TextField({ - allowBlank: true - }) - } - - ], - sm: new Ext.grid.RowSelectionModel({ - singleSelect: true, - listeners: { - rowselect: function(smObj, rowIndex, record) { - workflow.currentRowTrigger = rowIndex; - } - } - }), - stripeRows: true, - viewConfig: {forceFit: true}, - bbar: new Ext.PagingToolbar({ - pageSize: 5, - store: stepsTriggers, - displayInfo: true, - displayMsg: 'Displaying Step Tiggers {0} - {1} of {2}', - emptyMsg: "No Step Tiggers to display", - items:[] - }), - tbar: toolBar - }); - - triggerEditor.on({ - scope: this, - afteredit: function(roweditor, changes, record, rowIndex) { - - var stepUID = record.data.STEP_UID; - var triUID = record.data.TRI_UID; - var sType = record.data.ST_TYPE; - var sCondition = record.data.ST_CONDITION; - //var urlparams = '?action=assignTrigger&data={"STEP_UID":"'+stepUID+'","TRI_UID":"'+triUID+'","ST_TYPE":"'+sType+'","ST_CONDITION":""}'; - Ext.Ajax.request({ - url : '../steps/steps_Ajax.php', - method: 'POST', - params:{ - action : 'assignTrigger', - STEP_UID : stepUID, - TRI_UID : triUID, - ST_TYPE : sType, - ST_CONDITION : sCondition - }, - success: function(response) { - PMExt.notify( _('ID_STATUS') , _('ID_TRIGGER_ASSIGN') ); - tree.getLoader().dataUrl = 'get-triggers-tree.php?tid='+taskId; - tree.getLoader().load(tree.root); - } - }); - - //Deleting previously assigned trigger on updating/replacing with new trigger. - if(changes != '' && typeof record.json != 'undefined' ) - { - stepUID = record.json.STEP_UID; - var sTrigger = record.json.TRI_UID; - sType = record.json.ST_TYPE; - var iPosition = record.json.ST_POSITION; - var condition = record.json.ST_CONDITION; - - var urlparams = '?action=ofToAssignTrigger&sStep=' + stepUID + '&sTrigger=' + sTrigger + '&sType=' + sType + '&iPosition=' + iPosition - - Ext.Ajax.request({ - url : '../steps/steps_Ajax.php' + urlparams, - success: function(response) { - //Ext.MessageBox.alert ('Status','Trigger has been updated successfully.'); - } - }); - } - availableTriggers.reload(); - } - }); - - var treeGrid = new Ext.FormPanel({ - frame: false, - monitorValid : true, - labelAlign: 'left', - width: 750, - height: 500, - layout: 'column', - items: [{ - columnWidth: 0.4, - layout: 'fit', - items: [tree] - },{ - columnWidth: 0.6, - xtype: 'fieldset', - //labelWidth: 120, - title:_('ID_ASSIGN_TRIGGERS'), - //defaults: {width: 140, border:false}, - autoHeight: true, - border: false, - items: [triggerGrid] - }] - }); - - return treeGrid; -} - -TaskContext.prototype.editUsersAdHoc= function() -{ - var taskExtObj = new TaskContext(); - var taskId = workflow.currentSelection.id; - var userFields = Ext.data.Record.create([ - { - name: 'LABEL', - type: 'string' - },{ - name: 'TU_TYPE', - type: 'string' - },{ - name: 'TU_RELATION', - type: 'string' - },{ - name: 'TAS_UID', - type: 'string' - },{ - name: 'USR_UID', - type: 'string' - } - ]); - var editor = new Ext.ux.grid.RowEditor({ - saveText: _('ID_UPDATE') - }); - var taskUsers = new Ext.data.JsonStore({ - root : 'data', - totalProperty: 'totalCount', - idProperty : 'gridIndex', - remoteSort : true, - fields : userFields, - proxy: new Ext.data.HttpProxy({ - url: 'bpmn/proxyExtjs?pid='+pro_uid+'&tid='+taskId+'&action=assignedUsers' - }) - }); - //taskUsers.setDefaultSort('LABEL', 'asc'); - taskUsers.load({params:{start : 0 , limit : 10 }}); - - // create the Data Store of users that are not assigned to a task - var storeUsers = new Ext.data.JsonStore({ - root : 'data', - url : 'bpmn/proxyExtjs?tid='+taskId+'&action=availableUsers', - totalProperty : 'totalCount', - idProperty : 'gridIndex', - remoteSort : false, //true, - autoLoad : true, - fields : userFields - }); - - - var btnAdd = new Ext.Button({ - id: 'btnAdd', - text: _('ID_ASSIGN'), - iconCls: 'button_menu_ext ss_sprite ss_add', - handler: function(){ - var User = grid.getStore(); - var e = new userFields({ - //LABEL: 'Select User or Group', - //LABEL: User.data.items[0].data.LABEL, - TAS_UID: '', - TU_TYPE: '', - USR_UID: '', - TU_RELATION: '' - }); - - //storeUsers.reload(); - if(storeUsers.data.items.length == 0) - PMExt.notify( _('ID_STATUS') , _('ID_USERS_UNAVAILABLE') ); - else - { - editor.stopEditing(); - taskUsers.insert(0, e); - grid.getView().refresh(); - //grid.getSelectionModel().selectRow(0); - editor.startEditing(0, 0); - - } - - } - - }); - - var btnRemove = new Ext.Button({ - id: 'btnRemove', - text: _('ID_REMOVE'), - iconCls: 'button_menu_ext ss_sprite ss_delete', - handler: function (s) { - editor.stopEditing(); - var s = grid.getSelectionModel().getSelections(); - for(var i = 0, r; r = s[i]; i++){ - - //First Deleting assigned users from Database - var user_TURel = r.data.TU_RELATION; - var userUID = r.data.USR_UID; - var user_TUtype = r.data.TU_TYPE; - var urlparams = '?action=ofToAssign&data={"TAS_UID":"'+taskId+'","TU_RELATION":"'+user_TURel+'","USR_UID":"'+userUID+'","TU_TYPE":"'+user_TUtype+'"}'; - - //if USR_UID is properly defined (i.e. set to valid value) then only delete the row - //else its a BLANK ROW for which Ajax should not be called. - if(r.data.USR_UID != "") - { - Ext.Ajax.request({ - url : 'bpmn/processes_Ajax.php' +urlparams , - /*method: 'POST', - params: { - functions : 'ofToAssign', - TAS_UID : taskId, - TU_RELATION : user_TURel, - USR_UID : userUID, - TU_TYPE : user_TUtype - - },*/ - success: function(response) { - PMExt.notify( _('ID_STATUS') , _('ID_USERS_REMOVED') ); - //Secondly deleting from Grid - taskUsers.remove(r); - //Reloading available user store - taskUsers.reload(); - } - }); - } - else - taskUsers.remove(r); - } - } - }); - - var tb = new Ext.Toolbar({ - items: [btnAdd, btnRemove] - }); - - // create the Data Store of users that are already assigned to a task - var grid = new Ext.grid.GridPanel({ - store: taskUsers, - id : 'mygrid', - //cm: cm, - loadMask: true, - loadingText: 'Loading...', - //renderTo: 'cases-grid', - frame: false, - autoHeight:false, - clicksToEdit: 1, - minHeight:400, - height :330, - layout: 'fit', - plugins: [editor], - columns: [ - new Ext.grid.RowNumberer(), - { - id: 'LABEL', - header: _('ID_GROUP_USER'), - dataIndex: 'LABEL', - width: 100, - sortable: true, - editor: new Ext.form.ComboBox({ - xtype: 'combo', - fieldLabel: 'Users_groups', - hiddenName: 'number', - store : storeUsers, - displayField : 'LABEL', - valueField : 'LABEL', - name : 'LABEL', - triggerAction: 'all', - emptyText: 'Select User or Group', - allowBlank: false, - onSelect: function(record, index){ - var User = grid.getStore(); - - if(typeof workflow.currentrowIndex == 'undefined') - var selectedrowIndex = '0'; - else - selectedrowIndex = workflow.currentrowIndex; //getting Index of the row that has been edited - - //User.data.items[0].data.LABEL= record.data.LABEL; - User.data.items[selectedrowIndex].data.TAS_UID = record.data.TAS_UID; - User.data.items[selectedrowIndex].data.TU_TYPE = record.data.TU_TYPE; - User.data.items[selectedrowIndex].data.USR_UID = record.data.USR_UID; - User.data.items[selectedrowIndex].data.TU_RELATION = record.data.TU_RELATION; - - this.setValue(record.data[this.valueField || this.displayField]); - this.collapse(); - } - }) - } - ], - sm: new Ext.grid.RowSelectionModel({ - singleSelect: true, - listeners: { - rowselect: function(smObj, rowIndex, record) { - workflow.currentrowIndex = rowIndex; - } - } - }), - stripeRows: true, - viewConfig: {forceFit: true}, - bbar: new Ext.PagingToolbar({ - pageSize: 10, - store: taskUsers, - displayInfo: true, - displayMsg: 'Displaying Users {0} - {1} of {2}', - emptyMsg: "No Users to display", - items:[] - }), - tbar: tb - }); - - storeUsers.load(); - - editor.on({ - scope: this, - afteredit: function(roweditor, changes, record, rowIndex) { - - var taskId = record.data.TAS_UID; - var userId = record.data.USR_UID; - var tu_Type = record.data.TU_TYPE; - var tu_Relation = record.data.TU_RELATION; - ///var urlparams = '?action=assign&data={"TAS_UID":"'+taskId+'","USR_UID":"'+userId+'","TU_TYPE":"'+tu_Type+'","TU_RELATION":"'+tu_Relation+'"}'; - - Ext.Ajax.request({ - url: '../users/users_Ajax.php', - METHOD:'post', - success: function (response) { // When saving data success - PMExt.notify( _('ID_STATUS') , _('ID_USER_ASSIGNED') ); - }, - params:{ - functions : 'assign', - TAS_UID : taskId, - USR_UID : userId, - TU_TYPE : tu_Type, - TU_RELATION:tu_Relation - - }, - failure: function () { // when saving data failed - PMExt.notify( _('ID_STATUS') , _('ID_USER_SAVE_FAIL') ); - } - }); - - //Updating the user incase if already assigned user has been replaced by other user - if(changes != '' && typeof record.json != 'undefined') - { - var user_TURel = record.json.TU_RELATION; - var userUID = record.json.USR_UID; - var user_TUtype = record.json.TU_TYPE; - //urlparams = '?action=ofToAssign&data={"TAS_UID":"'+taskId+'","TU_RELATION":"'+user_TURel+'","USR_UID":"'+userUID+'","TU_TYPE":"'+user_TUtype+'"}'; - Ext.Ajax.request({ - url : '../users/users_Ajax.php', - method: 'POST', - success: function(response) { - PMExt.notify( _('ID_STATUS') , _('ID_USER_ASSIGNED') ); - //Ext.MessageBox.alert ('Status','User has been updated successfully.'); - }, - params:{ - functions : 'ofToAssign', - TAS_UID : taskId, - USR_UID : userId, - TU_TYPE : tu_Type, - TU_RELATION:tu_Relation - - } - }); - } - //storeUsers.reload(); - } - }); - - var panel = new Ext.Panel({ - id: 'panel', - //renderTo: Ext.getBody(), - items: [grid] - }); - - var window = new Ext.Window({ - title: _('ID_USER_GROUPS_ADHOC'), - collapsible: false, - maximizable: false, - width: 400, - height: 360, - minWidth: 200, - minHeight: 150, - layout: 'fit', - plain: true, - buttonAlign: 'center', - items: panel - }); - window.show(); -} - -/** - * ExtJs Form of SubProcess Properties - * @Param Shape Object - * @Author Safan Maredia - */ -TaskContext.prototype.editSubProcessProperties= function(_3525) -{ - var taskId = workflow.currentSelection.id; - //Variables Out Grid - var subProcessFields = Ext.data.Record.create([ - {name: 'SP_UID',type: 'string'}, - {name: 'TAS_UID',type: 'string'}, - {name: 'PRO_PARENT',type: 'string'}, - {name: 'PRO_UID',type: 'string'}, - {name: 'PRO_TITLE',type: 'string'}, - {name: 'TAS_PARENT',type: 'string'}, - {name: 'SP_SYNCHRONOUS',type: 'string'}, - {name: 'SPROCESS_NAME',type: 'string'}, - {name: 'TASKS',type: 'string'}, - {name: 'TAS_TITLE',type: 'string'}, - {name: 'CON_VALUE',type: 'string'}, - {name: 'VAR_OUT1',type: 'string'}, - {name: 'VAR_OUT2',type: 'string'}, - {name: 'VAR_IN1',type: 'string'}, - {name: 'VAR_IN2',type: 'string'} - ]); - - var editorOut = new Ext.ux.grid.RowEditor({ - saveText: _('ID_UPDATE') - }); - var editorIn = new Ext.ux.grid.RowEditor({ - saveText: _('ID_UPDATE') - }); - - //Variable out grid configuration starts here - var btnAddOut = new Ext.Button({ - id: 'btnAddOut', - text: _('ID_ASSIGN_VARIABLES_OUT'), - iconCls: 'button_menu_ext ss_sprite ss_add', - handler: function(){ - var storeData = variableOutGrid.getStore(); - //STEP_TITLE: storeData.data.items[0].data.STEP_TITLE, - var e = new subProcessFields({ - SP_UID : '', - PRO_PARENT : '', - SP_SYNCHRONOUS : '', - TAS_PARENT : '', - TASKS : '', - VAR_OUT1 : '', - VAR_OUT2 : '' - }); - - editorOut.stopEditing(); - variablesOutStore.insert(0, e); - variableOutGrid.getView().refresh(); - //grid.getSelectionModel().selectRow(0); - editorOut.startEditing(0, 0); - } - }); - - var btnRemoveOut = new Ext.Button({ - id: 'btnRemoveOut', - text: _('ID_REMOVE_VARIABLES_OUT'), - iconCls: 'button_menu_ext ss_sprite ss_delete', - handler: function (s) { - editorOut.stopEditing(); - var s = variableOutGrid.getSelectionModel().getSelections(); - for(var i = 0, r; r = s[i]; i++){ - variablesOutStore.remove(r); - } - } - }); - - var tbOut = new Ext.Toolbar({ - items: [btnAddOut, btnRemoveOut] - }); - - - //Variable out grid configuration starts here - var btnAddIn = new Ext.Button({ - id: 'btnAddIn', - text: 'ID_ASSIGN_VARIABLES_IN', - iconCls: 'button_menu_ext ss_sprite ss_add', - handler: function(){ - var e = new subProcessFields({ - SP_UID : '', - PRO_PARENT : '', - SP_SYNCHRONOUS : '', - TAS_PARENT : '', - VAR_IN1 : '', - VAR_IN2 : '' - }); - - editorIn.stopEditing(); - variablesInStore.insert(0, e); - variableInGrid.getView().refresh(); - editorIn.startEditing(0, 0); - } - }); - - var btnRemoveIn = new Ext.Button({ - id: 'btnRemoveIn', - text: 'ID_REMOVE_VARIABLES_IN', - iconCls: 'button_menu_ext ss_sprite ss_delete', - handler: function (s) { - editorIn.stopEditing(); - var s = variableInGrid.getSelectionModel().getSelections(); - for(var i = 0, r; r = s[i]; i++){ - - - //Secondly deleting from Grid - variablesInStore.remove(r); - } - } - }); - - var tbIn = new Ext.Toolbar({ - items: [btnAddIn, btnRemoveIn] - }); - - // create the Data Store of all Variables Out - var variablesOutStore = new Ext.data.JsonStore({ - root : 'data', - totalProperty: 'totalCount', - idProperty : 'gridIndex', - remoteSort : true, - fields : subProcessFields, - proxy : new Ext.data.HttpProxy({ - url : 'bpmn/proxyExtjs?pid='+pro_uid+'&action=getSubProcessProperties&tid='+taskId+'&type=0' //type=0 specifies Variables Out (Asynchronous) - }) - }); - variablesOutStore.load(); - - // create the Data Store of all Variables In - var variablesInStore = new Ext.data.JsonStore({ - root : 'data', - totalProperty: 'totalCount', - idProperty : 'gridIndex', - remoteSort : true, - fields : subProcessFields, - proxy : new Ext.data.HttpProxy({ - url : 'bpmn/proxyExtjs?pid='+pro_uid+'&action=getSubProcessProperties&tid='+taskId+'&type=1' //type=1 specifies Variables In (Synchronous) - }) - }); - //taskUsers.setDefaultSort('LABEL', 'asc'); - variablesInStore.load(); - - var processListStore = new Ext.data.JsonStore({ - root : 'data', - totalProperty: 'totalCount', - idProperty : 'gridIndex', - remoteSort : true, - fields : subProcessFields, - proxy : new Ext.data.HttpProxy({ - url : '../processes/processesList' - }) - }); - processListStore.load(); - - var variableOutGrid = new Ext.grid.GridPanel({ - store : variablesOutStore, - id : 'mygrid', - loadMask : true, - loadingText : 'Loading...', - //renderTo : 'cases-grid', - frame : false, - autoHeight : true, - autoScroll : true, - clicksToEdit: 1, - layout : 'form', - plugins : [editorOut], - columns : [{ - id : 'VAR_OUT1', - name : 'VAR_OUT1', - header : _('ID_ORIGIN'), - dataIndex: 'VAR_OUT1', - width : 200, - sortable : true, - editor : new Ext.form.TextField({ - allowBlank: true - }) - }, - { - sortable: false, - renderer: function() - { - return ''; - } - }, - { - id : 'VAR_OUT2', - name : 'VAR_OUT2', - header : _('ID_TARGET'), - dataIndex : 'VAR_OUT2', - width : 200, - sortable : true, - editor : new Ext.form.TextField({ - allowBlank: true - }) - }, - { - sortable: false, - renderer: function() - { - return ''; - } - } - ], - viewConfig: {forceFit: true}, - stripeRows: true, - tbar: tbOut - }); - - var variableInGrid = new Ext.grid.GridPanel({ - store : variablesInStore, - id : 'mygrid1', - loadMask : true, - loadingText : 'Loading...', - //renderTo : 'cases-grid', - frame : false, - autoHeight : true, - autoScroll : true, - clicksToEdit: 1, - layout : 'form', - plugins : [editorIn], - columns : [{ - id : 'VAR_IN1', - name : 'VAR_IN1', - header : _('ID_ORIGIN'), - dataIndex: 'VAR_IN1', - width : 200, - sortable : true, - editor : new Ext.form.TextField({ - allowBlank: true - }) - }, - { - sortable: false, - renderer: function() - { - return ''; - } - }, - { - id : 'VAR_IN2', - name : 'VAR_IN2', - header : _('ID_TARGET'), - dataIndex : 'VAR_IN2', - width : 200, - sortable : true, - editor : new Ext.form.TextField({ - allowBlank: true - }) - }, - { - sortable: false, - renderer: function() - { - return ''; - } - } - ], - viewConfig: {forceFit: true}, - stripeRows: true, - tbar: tbIn - }); - - var subProcessProperties = new Ext.FormPanel({ - labelWidth : 110, // label settings here cascade unless overridden - //frame:true, - width: 500, - bodyStyle: 'padding:5px 0 0 5px;', - autoScroll: true, - items: [ - { - xtype:'fieldset', - title: _('ID_SUBPROCESS'), - collapsible: false, - autoHeight:true, - //width: 600, - defaultType: 'textfield', - items:[ - { - id: 'subProcessName', - xtype: 'textfield', - width: 350, - fieldLabel: _('ID_SUBPROCESS_NAME'), - name : 'SPROCESS_NAME', - allowBlank: false - }, - { - width: 300, - xtype: 'combo', - mode: 'local', - triggerAction: 'all', - forceSelection: true, - editable: false, - fieldLabel: _('ID_PROCESS'), - name: 'PRO_TITLE', - emptyText : 'Select Process', - displayField: 'PRO_TITLE', - valueField: 'PRO_TITLE', - store: processListStore, - onSelect: function(record, index){ - //processListStore.data.items[0].data.PRO_UID = record.data.PRO_UID; - Ext.getCmp("SEL_PROCESS").setValue(record.data.PRO_UID); - this.setValue(record.data[this.valueField || this.displayField]); - this.collapse(); - } - },{ - xtype :'hidden', - name :'SEL_PROCESS', - id :'SEL_PROCESS' - }, - { - width: 150, - id : 'spType', - xtype: 'combo', - mode: 'local', - triggerAction: 'all', - forceSelection: true, - editable: false, - fieldLabel: _('ID_TYPE'), - name: 'SP_SYNCHRONOUS', - hiddenName: 'SP_SYNCHRONOUS', - displayField: 'name', - valueField: 'value', - emptyText : 'Select Type', - store: new Ext.data.JsonStore({ - fields : ['name', 'value'], - data : [ - {name : 'Asynchronous', value: '0'}, - {name : 'Synchronous', value: '1'}, - ] - }), - onSelect: function(record, index){ - if(record.data.name == 'Synchronous') - Ext.getCmp("variablein").show(); - else - Ext.getCmp("variablein").hide(); - - this.setValue(record.data[this.valueField || this.displayField]); - this.collapse(); - } - }] - }, - { - id :'variableout', - name :'VAR_OUT1', - xtype:'fieldset', - title: _('ID_VARIABLES_OUT'), - collapsible: false, - labelAlign: 'top', - items:[variableOutGrid] - }, - { - id :'variablein', - name :'VAR_IN1', - xtype:'fieldset', - title: _('ID_VARIABLES_IN'), - //hidden: true, - collapsible: false, - labelAlign: 'top', - items:[variableInGrid] - }] - }); - - //Loading Task Details into the form - subProcessProperties.form.load({ - url:'bpmn/proxyExtjs?pid='+pro_uid+'&action=getSubProcessProperties&tid='+taskId+'&type=2', - method:'GET', - waitMsg:'Loading....', - success:function(form, action) { - var response = action.response.responseText; - var aData = Ext.util.JSON.decode(response); - spUID = aData.data[0].SP_UID; - proUID = aData.data[0].PRO_UID; - proParent = aData.data[0].PRO_PARENT; - spSync = aData.data[0].SP_SYNCHRONOUS; - tasParent = aData.data[0].TAS_PARENT; - tasks = aData.data[0].TASKS; - var processName = aData.data[0].SPROCESS_NAME; - if(action.result.data[0].SP_SYNCHRONOUS == 0) - { - Ext.getCmp("variablein").hide(); - form.findField('SP_SYNCHRONOUS').setValue('Asynchronous'); - } - else - { - Ext.getCmp("variablein").show(); - form.findField('SP_SYNCHRONOUS').setValue('Synchronous'); - } - form.findField('PRO_TITLE').setValue(action.result.data[0].PRO_TITLE); - form.findField('SPROCESS_NAME').setValue(processName); - }, - failure:function(form, action) { - PMExt.notify( _('ID_STATUS') , _('ID_LOAD_FAILED') ); - } - }); - - //subProcessProperties.render(document.body); - - var window = new Ext.Window({ - title: _('ID_PROPERTIES'), - collapsible: false, - maximizable: false, - width: 800, - height: 400, - layout: 'fit', - plain: true, - buttonAlign: 'center', - items: subProcessProperties, - buttons: [{ - text: _('ID_SAVE'), - handler: function(){ - var getForm = subProcessProperties.getForm().getValues(); - - //Getting data from Grid (Variables In and Out) - var storeOutData = variableOutGrid.getStore(); - var storeInData = variableInGrid.getStore(); - var storeOutLength = storeOutData.data.items.length; - var storeInLength = storeInData.data.items.length; - var varOut1 = new Array(); - var varOut2 = new Array(); - for(var i=0;i 200 || this.getHeight() > 100) && this.limitFlag == false) { - this.originalWidth = 200; - this.originalHeight = 100; - this.width = 200; - this.height = 100; - } - if ((this.getWidth() < 165 || this.getHeight() < 40) && this.limitFlag == false) { - this.originalWidth = 165; - this.originalHeight = 40; - this.width = 165; - this.height = 40; - } - } - else { - this.width = this.originalWidth * workflow.zoomfactor; - this.height = this.originalHeight * workflow.zoomfactor; - } - //For Zooming - - //Set the Task Limitation - /*if ((this.getWidth() >= 200 || this.getHeight() >= 100 ) && this.limitFlag != true) { - this.originalWidth = 200; - this.originalHeight = 100; - } - else if ((this.getWidth() <= 165 || this.getHeight() <= 40) && this.limitFlag != true) { - this.originalWidth = 165; - this.originalHeight = 40; - }*/ - - - - var x = new Array(6, this.getWidth() - 3, this.getWidth(), this.getWidth(), this.getWidth() - 3, 6, 3, 3, 6); - var y = new Array(3, 3, 6, this.getHeight() - 3, this.getHeight(), this.getHeight(), this.getHeight() - 3, 6, 3); - this.stroke = 2; - this.graphics.setStroke(this.stroke); - this.graphics.setColor("#c0c0c0"); - this.graphics.fillPolygon(x, y); - for (var i = 0; i < x.length; i++) { - x[i] = x[i] - 3; - y[i] = y[i] - 3; - } - this.graphics.setColor("#DBDFF6"); - this.graphics.fillPolygon(x, y); - - this.graphics.setColor("#5164b5"); //Blue Color - this.graphics.drawPolygon(x, y); - this.graphics.paint(); - this.x_text = this.workflow.getAbsoluteX(); //Get x co-ordinate from figure - this.y_text = this.workflow.getAbsoluteY(); //Get x co-ordinate from figure - - /* Created New Object of jsGraphics to draw String. - * New object is created to implement changing of Text functionality - */ - this.bpmnText = new jsGraphics(this.id); - //erik: overridden the drawStringRect method - this.bpmnText.drawStringRect = function(txt, x, y, width, height, halign, cls) - { - var classBk = typeof(cls) != 'undefined' ? 'class="'+cls+'" ' : ''; - this.htm += '
'+ - '' +txt + '<\/span>'+ - '<\/div>'; - }; - - var zoomRate = workflow.zoomfactor; - var len = this.getWidth() / 18; - if (len >= 6) { - this.padleft = 0.05 * this.getWidth(); - this.padtop = 0.13 * this.getHeight() -1; - this.rectWidth = this.getWidth() - 2 * this.padleft; - } - else { - this.padleft = 2; //0.06 * this.getWidth(); - this.padtop = 2; //0.09 * this.getHeight() -3; - this.rectWidth = this.getWidth() - 2 * this.padleft; - } - - this.rectheight = this.getHeight() - this.padtop -3; - if ( this.rectheight < 7 ) this.rectheight = 7; - - - if(typeof this.taskName == 'undefined') - this.taskName = ''; - - //if (typeof this.fontSize == 'undefined' || this.fontSize == '') - this.fontSize = 11; - var fontSize = zoomRate * this.fontSize; - - this.graphics.setFont('verdana', + fontSize+'px', Font.PLAIN); - - this.graphics.drawStringRect(this.taskName, this.padleft, this.padtop, this.rectWidth, this.rectheight, 'center', 'x-task'); - this.graphics.paint(); - //***** Drawing Timer Boundary event starts here - this.boundaryTimer = new jsGraphics(this.id); - - var x_cir1=5; - var y_cir1=45; - this.x3 = x[3]; - this.y4 = y[4]; - this.y5 = y[5]; - - var xbt = 13*zoomRate; //x-base boundaryTimer - var ybt = this.y4 - 13*zoomRate; //y-base boundaryTimer - var dbt = 30*zoomRate; //diameter boundaryTimer - var ycbt = ybt + 11*zoomRate; //y-center boundaryTimer - this.graphics.setColor("#c0c0c0"); - this.graphics.fillEllipse(xbt+2, ybt+2, dbt, dbt); - this.graphics.setStroke(this.stroke-1); - this.graphics.setColor( "#f9faf2" ); - this.graphics.fillEllipse(xbt, ybt, dbt, dbt); - this.graphics.setColor("#adae5e"); - this.graphics.drawEllipse(xbt,ybt, dbt, dbt); - - var x_cir2=8; - var y_cir2=48; - //this.boundaryTimer.setColor( "#f9faf2" ); - //this.boundaryTimer.fillEllipse(xbt, ybt-9*zoomRate,(30-6)*zoomRate,(30-6)*zoomRate); - this.graphics.setColor("#adae5e"); - this.graphics.drawEllipse(xbt+(3*zoomRate), ybt+3*zoomRate,(24.4)*zoomRate,(24.4)*zoomRate); - - this.graphics.setColor("#adae5e"); - this.graphics.drawLine(dbt*0.45 +xbt, dbt*0.45+this.y5-10*zoomRate, dbt/1.6+xbt, dbt/2 +this.y5-10*zoomRate); //horizontal line - this.graphics.drawLine(dbt*0.45 +xbt, dbt*0.45+this.y5-10*zoomRate, dbt/2.2+xbt, dbt/3.7+this.y5-10*zoomRate); //vertical line - - this.graphics.setStroke(this.stroke-1); - this.graphics.drawLine(xbt +24*zoomRate,ycbt -3*zoomRate, xbt+20*zoomRate, ycbt ); //10th min line - this.graphics.drawLine(xbt +21*zoomRate,ycbt +4*zoomRate, xbt+25*zoomRate, ycbt +4*zoomRate); //15th min line - this.graphics.drawLine(xbt +24*zoomRate,ycbt +11*zoomRate, xbt+19*zoomRate, ycbt +9*zoomRate); //25th min line - this.graphics.drawLine(xbt +15*zoomRate,ycbt +11*zoomRate, xbt+15*zoomRate, ycbt+14*zoomRate); //30th min line - this.graphics.drawLine(xbt +8 *zoomRate,ycbt +11*zoomRate, xbt+12*zoomRate, ycbt +8*zoomRate); //40th min line - this.graphics.drawLine(xbt +5 *zoomRate,ycbt +4*zoomRate, xbt+8 *zoomRate, ycbt +4*zoomRate); //45th min line - this.graphics.drawLine(xbt +8 *zoomRate,ycbt -4*zoomRate, xbt+11*zoomRate, ycbt -1*zoomRate); //50th min line - this.graphics.drawLine(xbt+15 *zoomRate,ycbt -7*zoomRate, xbt+15*zoomRate, ycbt -4*zoomRate); //60th min line - - if(this.boundaryEvent == true) { - this.graphics.paint(); - } - //****************Drawing Timer Boundary event ends here **************** - - //this.bpmnText.paint(); - - //Code Added to Dynamically shift Ports on resizing of shapes - if (this.input1 != null) { - this.input1.setPosition(0, this.height / 2 -1); - } - if (this.output1 != null) { - this.output1.setPosition(this.width / 2, this.height -3); - } - if (this.input2 != null) { - this.input2.setPosition(this.width / 2, 0); - } - if (this.output2 != null) { - this.output2.setPosition(this.width-3, this.height / 2-1); - } - -}; - - -Figure.prototype.onDragend=function() { - if(typeof workflow.currentSelection != 'undefined' && workflow.currentSelection != null){ - var currObj = workflow.currentSelection; - currObj.orgXPos = eval(currObj.getX()/workflow.zoomfactor); - currObj.orgYPos = eval(currObj.getY()/workflow.zoomfactor); - //setPosition(); - if(typeof currObj.id != 'undefined' && currObj.id.length == 32){ - switch (currObj.type) { - case 'bpmnTask': - case 'bpmnSubProcess': - currObj.actiontype = 'saveTaskPosition'; - currObj.workflow.savePosition(currObj); - break; - case 'bpmnAnnotation': - currObj.actiontype = 'saveTextPosition'; - currObj.workflow.savePosition(currObj); - break; - default: - if(currObj.type.match(/Gateway/)){ - currObj.actiontype = 'saveGatewayPosition'; - currObj.workflow.savePosition(currObj); - } - else if(currObj.type.match(/Event/)) { - currObj.actiontype = 'saveEventPosition'; - currObj.workflow.savePosition(currObj); - } - } - } - workflow.setBoundary(currObj); - } - - if(this.getWorkflow().getEnableSmoothFigureHandling()==true) { - var _3dfe=this; - var _3dff=function(){ - if(_3dfe.alpha<1){ - _3dfe.setAlpha(Math.min(1,_3dfe.alpha+0.05)); - } - else { - window.clearInterval(_3dfe.timer); - _3dfe.timer=-1; - } - }; - if(_3dfe.timer>0){ - window.clearInterval(_3dfe.timer); - } - _3dfe.timer=window.setInterval(_3dff,20); - } - else{ - this.setAlpha(1); - } - this.command.setPosition(this.x,this.y); - this.workflow.commandStack.execute(this.command); - this.command=null; - this.isMoving=false; - this.workflow.hideSnapToHelperLines(); - this.fireMoveEvent(); - }; - - Figure.prototype.onKeyDown=function(_3e0e,ctrl){ - if(_3e0e==46&&this.isDeleteable()==true){ - workflow.getDeleteCriteria(); - //this.workflow.commandStack.execute(new CommandDelete(this)); - } - if(ctrl){ - this.workflow.onKeyDown(_3e0e,ctrl); - } -}; - -bpmnTask.prototype.setWorkflow = function (_40c5) { - VectorFigure.prototype.setWorkflow.call(this, _40c5); - if (_40c5 != null) { - /*Adding Port to the Task After dragging Task on the Canvas - *Ports will be invisibe After Drag and Drop, But It will be created - */ - var TaskPortName = ['output1', 'output2', 'input1', 'input2']; - var TaskPortType = ['OutputPort', 'OutputPort', 'InputPort', 'InputPort']; - var TaskPositionX = [this.width / 2, this.width, 0, this.width / 2]; - var TaskPositionY = [this.height-1, this.height / 2, this.height / 2, 0+1]; - - 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 - var oPort = eval('this.addPort(this.' + TaskPortName[i] + ',' + TaskPositionX[i] + ', ' + TaskPositionY[i] + ')'); //Setting Position of the port - var test = oPort; - } - } -}; - -InputPort.prototype.onDrop = function (port) { - if (port.getMaxFanOut && port.getMaxFanOut() <= port.getFanOut()) { - return; - } - if (this.parentNode.id == port.parentNode.id) { - } - else { - var _4070 = new CommandConnect(this.parentNode.workflow, port, this); - if (_4070.source.type == _4070.target.type) { - return; - } - - if(this.workflow.currentSelection.type.match(/Annotation/)) //Setting connection to Dotted for Annotation - _4070.setConnection(new DottedConnection()); - else - _4070.setConnection(new DecoratedConnection()); - - this.parentNode.workflow.getCommandStack().execute(_4070); - - //Saving Start Event - var preObj = new Array(); - var bpmnType = this.workflow.currentSelection.type; - - //Routing from end event to task - if(bpmnType.match(/End/) && bpmnType.match(/Event/) && port.parentNode.type.match(/Task/)) { - preObj = this.workflow.currentSelection; //end event - var newObj = port.parentNode; //task - newObj.conn = _4070.connection; - newObj.reverse = 1; //setting reverse parameter if user is routing from down to up - this.workflow.saveRoute(preObj,newObj); - } - //Routing from task to start event - else if(bpmnType.match(/Task/) && port.parentNode.type.match(/Event/)) { - preObj = this.workflow.currentSelection; //task - newObj = port.parentNode; //start event - var tas_uid = preObj.id; - this.workflow.saveEvents(newObj,tas_uid); - } - //Routing from task to task - else if(bpmnType.match(/Task/) && port.parentNode.type.match(/Task/)){ - preObj = workflow.currentSelection; - newObj = port.parentNode; - newObj.conn = _4070.connection; - newObj.sPortType =port.properties.name; - preObj.sPortType =this.properties.name; - workflow.saveRoute(newObj,preObj); - } - //Routing from task to gateway - else if(bpmnType.match(/Task/) && port.parentNode.type.match(/Gateway/)){ - var shape = new Array(); - shape.type = ''; - preObj = workflow.currentSelection; - newObj = port.parentNode; - workflow.saveRoute(newObj,shape); - } - //Routing from gateway to task - else if(bpmnType.match(/Gateway/) && (port.parentNode.type.match(/Gateway/) || port.parentNode.type.match(/Task/))){ - preObj = this.workflow.currentSelection; - newObj = port.parentNode; - this.workflow.saveRoute(preObj,newObj); - } - //Routing from task to Intermediate event - else if(port.parentNode.type.match(/Inter/) && port.parentNode.type.match(/Event/) && bpmnType.match(/Task/)){ - workflow.saveEvents(port.parentNode); - } - else if(port.parentNode.type.match(/Task/) && bpmnType.match(/Inter/) && bpmnType.match(/Event/)){ - workflow.saveEvents(workflow.currentSelection); - } - else if(bpmnType.match(/Annotation/)) { //Routing from task to Annotation - newObj = port.parentNode; - preObj = this.workflow.currentSelection; - newObj.actiontype = 'updateText'; - preObj.actiontype = 'updateText'; - this.workflow.saveShape(preObj); - } - } -}; - -OutputPort.prototype.onDrop = function (port) { - if (this.getMaxFanOut() <= this.getFanOut()) { - return; - } - - var connect = true; - var conn = port.workflow.checkConnectionsExist(port, 'targetPort', 'OutputPort'); - if (conn == 0) //If no connection Exist then Allow connect - connect = true; - else - if (conn < 2) //If One connection exist then Do not Allow to connect - connect = false; - - if (this.parentNode.id == port.parentNode.id || connect == false) { - } - else { - var _4070 = new CommandConnect(this.parentNode.workflow, this, port); - if (_4070.source.type == _4070.target.type) { - return; - } - - if(port.parentNode.type.match(/Annotation/)) //Setting connection to Dotted for Annotation - _4070.setConnection(new DottedConnection()); - else - _4070.setConnection(new DecoratedConnection()); - - this.parentNode.workflow.getCommandStack().execute(_4070); - - //Saving Start Event - var preObj = new Array(); - var bpmnType = this.workflow.currentSelection.type; - if(bpmnType.match(/Event/) && port.parentNode.type.match(/Task/)){ - var tas_uid = port.parentNode.id; - this.workflow.saveEvents(this.workflow.currentSelection,tas_uid); - } - else if(bpmnType.match(/Task/) && port.parentNode.type.match(/End/) && port.parentNode.type.match(/Event/)){ - preObj = this.workflow.currentSelection; - var newObj = port.parentNode; - newObj.conn = _4070.connection; - this.workflow.saveRoute(preObj,newObj); - } - else if(port.parentNode.type.match(/Task/) && bpmnType.match(/Inter/) && bpmnType.match(/Event/)){ - this.workflow.saveEvents(workflow.currentSelection); - } - else if(port.parentNode.type.match(/Event/) && port.parentNode.type.match(/Inter/) && bpmnType.match(/Task/)){ - this.workflow.saveEvents(port.parentNode); - } - else if(bpmnType.match(/Task/) && port.parentNode.type.match(/Task/)){ - preObj = this.workflow.currentSelection; - newObj = port.parentNode; - newObj.conn = _4070.connection; - newObj.sPortType =port.properties.name; - preObj.sPortType =this.properties.name; - this.workflow.saveRoute(preObj,newObj); - } - else if(bpmnType.match(/Gateway/) && (port.parentNode.type.match(/Task/) || port.parentNode.type.match(/Gateway/))){ //Routing from gateway to task - var shape = new Array(); - shape.type = ''; - preObj = this.workflow.currentSelection; - this.workflow.saveRoute(preObj,shape); - } - else if(bpmnType.match(/Task/) && port.parentNode.type.match(/Gateway/)){ //Routing from task to gateway - newObj = port.parentNode; - preObj = this.workflow.currentSelection; - this.workflow.saveRoute(newObj,preObj); - } - else if(port.parentNode.type.match(/Annotation/)){ //Routing from task to Annotation - newObj = port.parentNode; - preObj = this.workflow.currentSelection; - newObj.actiontype = 'updateText'; - this.workflow.saveShape(newObj); - } - } -}; - -LineEndResizeHandle.prototype.onDrop=function(_3f3e){ - var line=this.workflow.currentSelection; - line.isMoving=false; - if(line instanceof Connection){ - this.command.setNewPorts(line.getSource(),_3f3e); - - //If Input Port /Output Port is connected to respective ports, then should not connected - if(this.command.newSourcePort.type == this.command.newTargetPort.type) - return; - else { - this.command.newTargetPort.parentNode.conn = this.command.con; - this.command.newTargetPort.parentNode.sPortType = this.command.newTargetPort.properties.name; - this.command.newSourcePort.parentNode.sPortType = this.command.newSourcePort.properties.name; - this.workflow.saveRoute(this.command.newSourcePort.parentNode,this.command.newTargetPort.parentNode); - this.getWorkflow().getCommandStack().execute(this.command); - } - } - this.command=null; -}; - -LineStartResizeHandle.prototype.onDrop=function(_410d){ - var line=this.workflow.currentSelection; - line.isMoving=false; - if(line instanceof Connection){ - this.command.setNewPorts(_410d,line.getTarget()); - - //If Input Port /Output Port is connected to respective ports, then should not connected - if(this.command.newSourcePort.type == this.command.newTargetPort.type) - return; - else{ - this.command.newTargetPort.parentNode.conn = this.command.con; - this.command.newTargetPort.parentNode.sPortType = this.command.newTargetPort.properties.name; - this.command.newSourcePort.parentNode.sPortType = this.command.newSourcePort.properties.name; - this.command.newTargetPort.parentNode.conn = this.command.con; - this.workflow.saveRoute(this.command.newSourcePort.parentNode,this.command.newTargetPort.parentNode); - this.getWorkflow().getCommandStack().execute(this.command); - } - } - this.command=null; -}; - -ResizeHandle.prototype.onDragend=function(){ - if(this.commandMove==null){ - return; - } - var currentSelection = workflow.currentSelection; - if(typeof currentSelection.id != 'undefined' && currentSelection.id.length == 32){ - if(currentSelection.type.match(/Task/)) { - currentSelection.actiontype = 'saveTaskCordinates'; - workflow.savePosition(currentSelection); - } - else if(currentSelection.type.match(/Annotation/)){ - currentSelection.actiontype = 'saveAnnotationCordinates'; - workflow.savePosition(currentSelection); - } - } -} - -VectorFigure.prototype.addChild=function(_4078){ - _4078.setParent(this); - //_4078.setZOrder(this.getZOrder()+1); - //_4078.setParent(this); - //_4078.parent.addChild(_4078); - //this.children[_4078.id]=_4078; - //this.scrollarea.appendChild(_4078.getHTMLElement()); -}; - -////// Decorators to add an arrow to the flow line. To show the direction of flow ////////////// -DecoratedConnection = function () { - Connection.call(this); - this.setTargetDecorator(new ArrowConnectionDecorator()); - this.setRouter(new ManhattanConnectionRouter()); -}; -DecoratedConnection.prototype = new Connection(); -DecoratedConnection.prototype.type = "DecoratedConnection"; -DecoratedConnection.prototype.getContextMenu = function () { - if (this.id != null) { - this.workflow.contextClicked = true; - this.workflow.connectionContextMenu(this); - } -}; - - -//dotted connection and its router -DottedConnectionRouter=function(_354a){ -if(!_354a){ -this.cheapRouter=new ManhattanConnectionRouter(); -}else{ -this.cheapRouter=null; -} -this.iteration=4; -}; -DottedConnectionRouter.prototype=new ConnectionRouter; -DottedConnectionRouter.prototype.type="DottedConnectionRouter"; -DottedConnectionRouter.prototype.drawBezier=function(_354b,_354c,t,iter){ - var n=_354b.length-1; - var q=new Array(); - var _3551=n+1; - for(var i=0;i<_3551;i++){ - q[i]=new Array(); - q[i][0]=_354b[i]; - } - for(var j=1;j<=n;j++){ - for(var i=0;i<=(n-j);i++){ - q[i][j]=new Point((1-t)*q[i][j-1].x+t*q[i+1][j-1].x,(1-t)*q[i][j-1].y+t*q[i+1][j-1].y); - } - } - var c1=new Array(); - var c2=new Array(); - for(var i=0;i=0){ - this.drawBezier(c1,_354c,t,--iter); - this.drawBezier(c2,_354c,t,--iter); - } - else{ - for(var i=0;i0)&&((yDiff*yDiff)0)&&(toDir==DOWN))||((yDiff<0)&&(toDir==UP))){ - point=new Point(toPt.x,_355e.y); - }else{ - if(_355f==toDir){ - var pos=Math.min(_355e.x,toPt.x)-_3564; - point=new Point(pos,_355e.y); - }else{ - point=new Point(_355e.x-(xDiff/2),_355e.y); - } - } - } - if(yDiff>0){ - dir=UP; - }else{ - dir=DOWN; - } - } - } - else{ - if(_355f==RIGHT){ - if((xDiff<0)&&((yDiff*yDiff)0){ - point=new Point(_355e.x+_3564,_355e.y); - }else{ - if(((yDiff>0)&&(toDir==DOWN))||((yDiff<0)&&(toDir==UP))){ - point=new Point(toPt.x,_355e.y); - }else{ - if(_355f==toDir){ - var pos=Math.max(_355e.x,toPt.x)+_3564; - point=new Point(pos,_355e.y); - }else{ - point=new Point(_355e.x-(xDiff/2),_355e.y); - } - } - } - if(yDiff>0){ - dir=UP; - }else{ - dir=DOWN; - } - } - }else{ - if(_355f==DOWN){ - if(((xDiff*xDiff)0){ - point=new Point(_355e.x,_355e.y+_3564); - } - else { - if(((xDiff>0)&&(toDir==RIGHT))||((xDiff<0)&&(toDir==LEFT))){ - point=new Point(_355e.x,toPt.y); - } - else{ - if(_355f==toDir){ - var pos=Math.max(_355e.y,toPt.y)+_3564; - point=new Point(_355e.x,pos); - } - else{ - point=new Point(_355e.x,_355e.y-(yDiff/2)); - } - } - } - if(xDiff>0){ - dir=LEFT; - } - else{ - dir=RIGHT; - } - } - } - else { - if(_355f==UP){ - if(((xDiff*xDiff)0)&&(toDir==DOWN)){ - point=toPt; - dir=toDir; - } - else{ - if(yDiff<0){ - point=new Point(_355e.x,_355e.y-_3564); - } - else{ - if(((xDiff>0)&&(toDir==RIGHT))||((xDiff<0)&&(toDir==LEFT))){ - point=new Point(_355e.x,toPt.y); - } - else{ - if(_355f==toDir){ - var pos=Math.min(_355e.y,toPt.y)-_3564; - point=new Point(_355e.x,pos); - } - else{ - point=new Point(_355e.x,_355e.y-(yDiff/2)); - } - } - } - if(xDiff>0){ - dir=LEFT; - } - else{ - dir=RIGHT; - } - } - } - } - } - } - this._route(_355c,conn,point,dir,toPt,toDir); - _355c.push(_355e); -}; - -DottedConnection = function () { - Connection.call(this); - this.setColor(new Color(0,0,80)); - this.setRouter(new DottedConnectionRouter()); - this.setRouter(new FanConnectionRouter()); -}; -DottedConnection.prototype = new Connection(); -DottedConnection.prototype.type = "DottedConnection"; -DottedConnection.prototype.addPoint=function(p){ - p=new Point(parseInt(p.x),parseInt(p.y)); - var bgColor = new Color(255,255,255); - var fgColor = new Color(0,0,128); - if(this.oldPoint!=null){ - //this.graphics.setColor(new Color(250,250,250)); - this.graphics.setColor(bgColor.getHTMLStyle()); - this.graphics.setStroke( 2); - this.graphics.drawLine(this.oldPoint.x,this.oldPoint.y,p.x,p.y); - this.graphics.setColor(fgColor.getHTMLStyle()); - this.graphics.setStroke( Stroke.DOTTED ); - this.graphics.drawLine(this.oldPoint.x,this.oldPoint.y,p.x,p.y); - //this.graphics.drawLine(p.x,p.y,p.x,p.y); - var line=new Object(); - line.start=this.oldPoint; - line.end=p; - this.lineSegments.add(line); - } - this.oldPoint=new Object(); - this.oldPoint.x=p.x; - this.oldPoint.y=p.y; -}; -DottedConnection.prototype.getContextMenu = function () { - if (this.id != null) { - this.workflow.contextClicked = true; - this.workflow.connectionContextMenu(this); - } -}; - -////////--------------------------------------------------------------------------------------------/////// -FlowMenu = function (_39f9) { - this.actionAdd = new ButtonAdd(this); - this.actionTask = new ButtonTask(this); - this.actionInterEvent = new ButtonInterEvent(this); - this.actionEndEvent = new ButtonEndEvent(this); - this.actionGateway = new ButtonGateway(this); - this.actionFront = new ButtonMoveFront(this); - this.actionBack = new ButtonMoveBack(this); - this.actionDelete = new ButtonDelete(this); - this.actionAnnotation = new ButtonAnnotation(this); - ToolPalette.call(this); - this.setDimension(20, 80); - this.setBackgroundColor(new Color(220, 255, 255)); - this.currentFigure = null; - this.myworkflow = _39f9; - this.added = false; - this.setDeleteable(false); - this.setCanDrag(false); - this.setResizeable(false); - this.setSelectable(false); - var zOrder = this.getZOrder(); - this.setZOrder(4000); - this.setBackgroundColor(null); - this.setColor(null); - this.scrollarea.style.borderBottom = "0px"; - this.actionAdd.setPosition(0, 0); - this.actionInterEvent.setPosition(20, 0); - this.actionGateway.setPosition(20, 20); - this.actionFront.setPosition(0, 18); - this.actionBack.setPosition(0, 36); - this.actionDelete.setPosition(0, 54); -}; - -ToolPalette.prototype.removechild = function (_4079) { - if (_4079 != null) { - var parentNode = this.html; - if (parentNode != null) { - if (typeof parentNode.children != 'undefined') { - var len = parentNode.children[0].children.length; - for (var i = 0; i < len; i++) { - var childNode = parentNode.children[0].children[i]; - if (childNode == _4079.html) { - parentNode.children[0].removeChild(childNode); - } - } - } - } - } -}; -FlowMenu.prototype = new ToolPalette; -FlowMenu.prototype.setAlpha = function (_39fa) { - Figure.prototype.setAlpha.call(this, _39fa); -}; -FlowMenu.prototype.hasTitleBar = function () { - return false; -}; -FlowMenu.prototype.setFigure = function (_3087) { -} - -FlowMenu.prototype.onSelectionChanged = function (_39fb) { - var newWorkflow = ''; - //If Right Clicked on the figure, Disabling Flow menu - if (_39fb != null) { - newWorkflow = _39fb.workflow; - } - else if (this.workflow != null) { - newWorkflow = this.workflow; - } - else { - newWorkflow = this.myworkflow; - } - var contextClicked = newWorkflow.contextClicked; - //Check wheather the figure selected is same as previous figure. - //If figure is different ,then remove the port from the previous selected figure. - if (newWorkflow.currentSelection != null && typeof newWorkflow.preSelectedFigure != 'undefined') { - if (newWorkflow.currentSelection.id != newWorkflow.preSelectedFigure.id) { - newWorkflow.disablePorts(newWorkflow.preSelectedFigure); - } - } - if (_39fb == this.currentFigure && contextClicked == true) { - return; - } - if (this.added == true) { - this.myworkflow.removeFigure(this); - this.added = false; - } - if (_39fb != null && this.added == false) { - if (this.myworkflow.getEnableSmoothFigureHandling() == true) { - this.setAlpha(0.01); - } - this.myworkflow.addFigure(this, 100, 100); - this.added = true; - } - if (this.currentFigure != null) { - this.currentFigure.detachMoveListener(this); - } - this.currentFigure = _39fb; - if (this.currentFigure != null) { - this.currentFigure.attachMoveListener(this); - this.onOtherFigureMoved(this.currentFigure); - } -}; - -FlowMenu.prototype.setWorkflow = function (_39fc) { - Figure.prototype.setWorkflow.call(this, _39fc); -}; - -FlowMenu.prototype.onOtherFigureMoved = function (_39fd) { - if (_39fd != null) { - //Get the workflow object of the selected Figure object, so that we can compare with the new selected figure to remove ports - _39fd.workflow.preSelectedFigure = _39fd.workflow.currentSelection; - var countConn = 0; - //workflow.setBoundary(workflow.currentSelection); - - //Preventing Task from drawing outside canvas Code Ends here - if (_39fd.type == 'DecoratedConnection' || _39fd.type == 'DottedConnection' || _39fd.workflow.contextClicked == true) { - this.removechild(this.actionAdd); - this.removechild(this.actionInterEvent); - this.removechild(this.actionGateway); - this.removechild(this.actionAnnotation); - this.removechild(this.actionTask); - this.removechild(this.actionEndEvent); - this.removechild(this.actionBack); - this.removechild(this.actionDelete); - this.removechild(this.actionFront); - _39fd.workflow.hideResizeHandles(); - } - else { - var pos = _39fd.getPosition(); - this.setPosition(pos.x + _39fd.getWidth() + 7, pos.y - 16); - if (_39fd.workflow != null) { - var bpmnShape = _39fd.workflow.currentSelection.type; - this.addChild(this.actionFront); - this.addChild(this.actionBack); - this.addChild(this.actionDelete); - var ports = ''; - //Disable Resize for All Events and Gateway - if (bpmnShape.match(/Event/) || bpmnShape.match(/Gateway/) || bpmnShape.match(/bpmnDataobject/) || bpmnShape.match(/bpmnSubProcess/)) { - _39fd.workflow.hideResizeHandles(); - } - if (bpmnShape.match(/Task/) || bpmnShape.match(/SubProcess/)) { - this.addChild(this.actionAdd); - this.addChild(this.actionInterEvent); - this.addChild(this.actionEndEvent); - this.addChild(this.actionGateway); - this.addChild(this.actionAnnotation); - this.actionAnnotation.setPosition(20, 60); - this.actionEndEvent.setPosition(20, 40) - this.removechild(this.actionTask); - ports = ['output1', 'input1', 'output2', 'input2']; - //ports = ['output1', 'output2']; - _39fd.workflow.enablePorts(_39fd, ports); - } - else if (bpmnShape.match(/Start/)) { - this.addChild(this.actionAdd); - this.addChild(this.actionAnnotation); - this.actionAnnotation.setPosition(20, 40); - this.addChild(this.actionInterEvent); - this.actionInterEvent.setPosition(20, 20) - this.addChild(this.actionGateway); - this.actionGateway.setPosition(20, 0) - this.removechild(this.actionEndEvent); - ports = ['output1', 'output2']; - _39fd.workflow.enablePorts(_39fd, ports); - } - else if (bpmnShape.match(/Inter/)) { - this.addChild(this.actionAdd); - this.addChild(this.actionAnnotation); - this.actionAnnotation.setPosition(20, 60); - this.addChild(this.actionInterEvent); - this.actionInterEvent.setPosition(20, 20) - this.addChild(this.actionGateway); - this.actionGateway.setPosition(20, 0); - this.addChild(this.actionEndEvent); - this.actionEndEvent.setPosition(20, 40); - ports = ['output1', 'input1', 'output2', 'input2']; - _39fd.workflow.enablePorts(_39fd, ports); - } - else if (bpmnShape.match(/End/)) { - this.removechild(this.actionInterEvent); - this.removechild(this.actionEndEvent); - this.removechild(this.actionAnnotation); - this.removechild(this.actionTask); - this.removechild(this.actionGateway); - this.removechild(this.actionAdd); - ports = ['input1', 'input2']; - _39fd.workflow.enablePorts(_39fd, ports); - } - else if (bpmnShape.match(/Gateway/)) { - this.addChild(this.actionAdd); - this.addChild(this.actionAnnotation); - this.actionAnnotation.setPosition(20, 60); - this.addChild(this.actionInterEvent); - this.actionInterEvent.setPosition(20, 20) - this.addChild(this.actionGateway); - this.actionGateway.setPosition(20, 0); - this.addChild(this.actionEndEvent); - this.actionEndEvent.setPosition(20, 40); - ports = ['output1', 'input1', 'output2', 'input2','output3']; - _39fd.workflow.enablePorts(_39fd, ports); - } - else if (bpmnShape.match(/Annotation/) || bpmnShape.match(/Dataobject/)) { - this.removechild(this.actionAdd); - this.removechild(this.actionAnnotation); - this.removechild(this.actionInterEvent); - this.removechild(this.actionGateway); - this.removechild(this.actionEndEvent); - this.removechild(this.actionAnnotation); - this.removechild(this.actionEndEvent); - if (bpmnShape.match(/Annotation/)) { - ports = ['input1']; - _39fd.workflow.enablePorts(_39fd, ports); - } - } - else if (bpmnShape.match(/Pool/)) { - this.removechild(this.actionAdd); - this.removechild(this.actionInterEvent); - this.removechild(this.actionGateway); - this.removechild(this.actionEndEvent); - this.removechild(this.actionAnnotation); - this.removechild(this.actionEndEvent); - this.removechild(this.actionFront); - this.removechild(this.actionBack); - this.removechild(this.actionDelete); - } - } - } - } -}; - -bpmnTask.prototype.addShapes = function (oStore) { - var xOffset = workflow.currentSelection.getX(); //Get x co-ordinate from figure - var y = workflow.currentSelection.getY(); //Get y co-ordinate from figure - //var xOffset = parseFloat(x + _3896.workflow.currentSelection.width); //Get x-offset co-ordinate from figure - var yOffset = parseFloat(y + workflow.currentSelection.height + 25); //Get y-offset co-ordinate from figure - var shape = workflow.currentSelection.type; - var count; - if (oStore.newShapeName == 'bpmnTask' && shape.match(/Event/)) { - xOffset = workflow.currentSelection.getX() - 67; //Setting new offset value when currentselection is not Task i.e deriving task from events - } - else if (oStore.newShapeName == 'bpmnTask' && shape.match(/Gateway/)) { - xOffset = workflow.currentSelection.getX() - 62; //Setting new offset value when currentselection is not Task i.e deriving task from gateways - } - else if (oStore.newShapeName.match(/Gateway/) && shape.match(/Gateway/)) { - xOffset = workflow.currentSelection.getX(); //Setting new offset value when currentselection is not Task i.e deriving task from gateways - } - else if (oStore.newShapeName.match(/Event/)) { - xOffset = workflow.currentSelection.getX() + 67; //Setting new offset value when newShape is not Task i.e aligning events - } - else if (oStore.newShapeName.match(/Gateway/)) { - xOffset = workflow.currentSelection.getX() + 62; - } - else if (oStore.newShapeName.match(/Annotation/) ) { - xOffset = workflow.currentSelection.getX() + 250; - yOffset = workflow.currentSelection.getY() - 10.5; - } - - workflow.subProcessName = 'Sub Process'; - workflow.annotationName = 'Annotation'; - var newShape = eval("new " + oStore.newShapeName + "(workflow)"); - workflow.addFigure(newShape, xOffset, yOffset); - //Assigning values to newShape Object for Saving Task automatically (Async Ajax Call) - newShape.x = xOffset; - newShape.y = yOffset; - - if(shape.match(/Annotation/) || oStore.newShapeName.match(/Annotation/)) - var conn = new DottedConnection(); - else - conn = new DecoratedConnection(); - - if (newShape.type.match(/Gateway/)) { - conn.setTarget(newShape.getPort("input2")); - conn.setSource(workflow.currentSelection.getPort("output1")); - workflow.addFigure(conn); - newShape.actiontype = 'addGateway'; - workflow.saveShape(newShape); - } - else if (newShape.type.match(/Start/)) { - conn.setTarget(newShape.getPort("output1")); - conn.setSource(workflow.currentSelection.getPort("input2")); - workflow.addFigure(conn); - } - else if (newShape.type.match(/Event/)) { - conn.setTarget(newShape.getPort("input2")); - conn.setSource(workflow.currentSelection.getPort("output1")); - workflow.addFigure(conn); - newShape.conn = conn; - newShape.actiontype = 'addEvent'; - workflow.saveShape(newShape); - } - else if (newShape.type.match(/Task/)) { - conn.setTarget(newShape.getPort("input2")); - conn.setSource(workflow.currentSelection.getPort("output1")); - workflow.addFigure(conn); - } - else if (newShape.type.match(/Annotation/)) { - conn.setTarget(newShape.getPort("input1")); - conn.setSource(workflow.currentSelection.getPort("output2")); - workflow.addFigure(conn); - newShape.actiontype = 'addText'; - newShape.conn = conn; - workflow.saveShape(newShape); //Saving Task automatically (Async Ajax Call) - } - /*if (oStore.newShapeName.match(/Event/) && oStore.newShapeName.match(/End/)) { - newShape.conn = conn; - workflow.saveRoute(workflow.currentSelection,newShape); - }*/ - if (oStore.newShapeName == 'bpmnTask') { - newShape.actiontype = 'addTask'; - newShape.conn = conn; - workflow.saveShape(newShape); //Saving Task automatically (Async Ajax Call) - } -} - -ButtonInterEvent = function (_30a8) { - Button.call(this, _30a8, 16, 16); -}; -ButtonInterEvent.prototype = new Button; -ButtonInterEvent.prototype.type = "/images/ext/gray/shapes/interevent"; -ButtonInterEvent.prototype.execute = function () { - var count = 0; - this.palette.newShapeName = 'bpmnEventEmptyInter'; - bpmnTask.prototype.addShapes(this.palette); -}; - -ButtonEndEvent = function (_30a8) { - Button.call(this, _30a8, 16, 16); -}; -ButtonEndEvent.prototype = new Button; -ButtonEndEvent.prototype.type = "/images/ext/gray/shapes/endevent"; -ButtonEndEvent.prototype.execute = function () { - var count = 0; - this.palette.newShapeName = 'bpmnEventEmptyEnd'; - bpmnTask.prototype.addShapes(this.palette); -}; - -ButtonGateway = function (_30a8) { - Button.call(this, _30a8, 16, 16); -}; -ButtonGateway.prototype = new Button; -ButtonGateway.prototype.type = "/images/ext/gray/shapes/gateway-small"; -ButtonGateway.prototype.execute = function () { - this.palette.newShapeName = 'bpmnGatewayExclusiveData'; - workflow.preSelectedObj = workflow.currentSelection; - bpmnTask.prototype.addShapes(this.palette); -}; - -ButtonAnnotation = function (_30a8) { - Button.call(this, _30a8, 16, 16); -}; -ButtonAnnotation.prototype = new Button; -ButtonAnnotation.prototype.type = "/images/ext/gray/shapes/annotation"; -ButtonAnnotation.prototype.execute = function () { - var count = 0; - this.palette.newShapeName = 'bpmnAnnotation'; - this.palette.workflow.preSelectedObj = this.palette.workflow.currentSelection; - bpmnTask.prototype.addShapes(this.palette); -}; - -ButtonTask = function (_30a8) { - Button.call(this, _30a8, 16, 16); -}; -ButtonTask.prototype = new Button; -ButtonTask.prototype.type = "/images/ext/gray/shapes/Task"; -ButtonTask.prototype.execute = function () { - this.palette.newShapeName = 'bpmnTask'; - bpmnTask.prototype.addShapes(this.palette); -}; - - -ButtonAdd = function (_30a8) { - Button.call(this, _30a8, 16, 16); -}; -ButtonAdd.prototype = new Button; -ButtonAdd.prototype.type = "/images/ext/gray/shapes/btn-add"; -ButtonAdd.prototype.execute = function () { - this.palette.newShapeName = 'bpmnTask'; - this.palette.workflow.preSelectedObj = this.palette.workflow.currentSelection; - bpmnTask.prototype.addShapes(this.palette); -}; - -ButtonDelete = function (_30a9) { - Button.call(this, _30a9, 16, 16); -}; -ButtonDelete.prototype = new Button; -ButtonDelete.prototype.type = "/images/ext/gray/shapes/btn-del"; -ButtonDelete.prototype.execute = function () { - workflow.hideResizeHandles(); - workflow.getDeleteCriteria(); -}; -ButtonMoveFront = function (_3e22) { - Button.call(this, _3e22, 16, 16); -}; -ButtonMoveFront.prototype = new Button; -ButtonMoveFront.prototype.type = "/images/ext/gray/shapes/btn-movefrnt"; -ButtonMoveFront.prototype.execute = function () { - this.palette.workflow.moveFront(this.palette.workflow.getCurrentSelection()); - ToolGeneric.prototype.execute.call(this); -}; -ButtonMoveBack = function (_4091) { - Button.call(this, _4091, 16, 16); -}; -ButtonMoveBack.prototype = new Button; -ButtonMoveBack.prototype.type = "/images/ext/gray/shapes/btn-movebk"; -ButtonMoveBack.prototype.execute = function () { - this.palette.workflow.moveBack(this.palette.workflow.getCurrentSelection()); - ToolGeneric.prototype.execute.call(this); -}; - -bpmnTaskDialog = function (_2e5e) { - this.figure = _2e5e; - var title = 'Task Detail'; - Dialog.call(this, title); - this.setDimension(400, 150); //Set the width and height of the Dialog box -} - -bpmnTaskDialog.prototype = new Dialog(this); -bpmnTaskDialog.prototype.createHTMLElement = function () { - var item = Dialog.prototype.createHTMLElement.call(this); - var inputDiv = document.createElement("form"); - inputDiv.style.position = "absolute"; - inputDiv.style.left = "10px"; - inputDiv.style.top = "30px"; - inputDiv.style.width = "375px"; - inputDiv.style.font = "normal 10px verdana"; - item.appendChild(inputDiv); - this.label = document.createTextNode("Task Name"); - inputDiv.appendChild(this.label); - this.input = document.createElement("textarea"); - this.input.size = '1'; - this.input.style.border = "1px solid gray"; - this.input.style.font = "normal 10px verdana"; - //this.input.type = "text"; - this.input.cols = "50"; - this.input.rows = "3"; - this.input.maxLength = "100"; - var value = bpmnTask.prototype.trim(workflow.currentSelection.taskName); - if (value) this.input.value = value; - else this.input.value = ""; - this.input.style.width = "100%"; - inputDiv.appendChild(this.input); - this.input.focus(); - return item; -}; - -//Double Click Event for opening the dialog Box -bpmnTask.prototype.onDoubleClick = function () { - var _409d = new bpmnTaskDialog(this); - workflow.showDialog(_409d, this.workflow.currentSelection.x, this.workflow.currentSelection.y); -}; - -/** - * erik: Setting task target to Drop user & group assignment - */ -bpmnTask.prototype.onMouseEnter = function () { - if( this.type == 'bpmnTask' ) { - _targetTask = {id: this.id, name: this.taskName}; - } -}; - -bpmnTask.prototype.trim = function (str) { - if (str != null) - return str.replace(/^\s+|\s+$/g, ''); - else - return null; -}; - -/** - * This method will be called if the user pressed the OK button in buttonbar of the dialog.
- * The string is first cleared and new string is painted.

- **/ -bpmnTaskDialog.prototype.onOk = function () { - this.figure.bpmnText.clear(); - //len = Math.ceil(this.input.value.length/16); - var len = this.workflow.currentSelection.width / 18; - if (len >= 6) { - // len = 1.5; - var padleft = 0.12 * this.workflow.currentSelection.width; - var padtop = 0.32 * this.workflow.currentSelection.height - 3; - this.figure.rectWidth = this.workflow.currentSelection.width - 2 * padleft; - } - else { - padleft = 0.1 * this.workflow.currentSelection.width; - padtop = 0.09 * this.workflow.currentSelection.height - 3; - this.figure.rectWidth = this.workflow.currentSelection.width - 2 * padleft; - } - - var rectheight = this.workflow.currentSelection.height - 2*padtop; - this.figure.bpmnText.setFont('verdana', +this.figure.fontSize+'px', Font.PLAIN); - this.figure.bpmnText.drawStringRect(this.input.value, padleft, padtop, this.figure.rectWidth, rectheight, 'center'); - this.figure.bpmnText.paint(); - this.workflow.currentSelection.taskName = this.input.value; //Set Updated Text value - //Saving task name (whenever updated) onAsynch AJAX call - this.figure.actiontype = 'updateTaskName'; - this.workflow.saveShape(this.figure); - if (this.figure.rectWidth < 80) tempW = 110; - else tempW = this.figure.rectWidth + 35; - this.workflow.removeFigure(this); -}; - -bpmnTask.prototype.getContextMenu = function () { - this.workflow.handleContextMenu(this); -}; diff --git a/workflow/engine/templates/bpmn/bpmnZoom.js b/workflow/engine/templates/bpmn/bpmnZoom.js deleted file mode 100755 index 4e627974b..000000000 --- a/workflow/engine/templates/bpmn/bpmnZoom.js +++ /dev/null @@ -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 ) -minSize = 1; - -// Minimum size allowed for STYLE attribute (like in ) -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 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; - diff --git a/workflow/engine/templates/bpmn/designer.html b/workflow/engine/templates/bpmn/designer.html deleted file mode 100755 index bf830ac66..000000000 --- a/workflow/engine/templates/bpmn/designer.html +++ /dev/null @@ -1,12 +0,0 @@ -
-
-
-
-
-
-
-
-
-
-
-
diff --git a/workflow/engine/templates/bpmn/designer.js b/workflow/engine/templates/bpmn/designer.js deleted file mode 100755 index 87bb991b6..000000000 --- a/workflow/engine/templates/bpmn/designer.js +++ /dev/null @@ -1,926 +0,0 @@ -/** - * BPMN Designer v1.1 - * @date Feb 2th, 2011 - * @author Erik A. O. - */ - -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: ' ', - 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: ' ', - 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(''+_('ID_PROCESSMAP_TITLE')+': ' + 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"+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 - */ - -var toolbarPanel; -var actorsPanel; -var northPanelItems; -var eastPanelTree; -var ActiveProperty; -var comboCategory; -var comboCalendar; -var comboPMVariables; -var propertiesGrid; -var propertyStore; -var usersTaskStore; -var usersTaskGrid; -var usersTaskGridContextMenu; -var usersTaskAdHocStore; -var usersTaskAdHocGrid; -var usersTaskAdHocGridContextMenu; -var mainMenu; -var tbar1; - -var usersPanelStart = 0; -var usersPanelLimit = 1000; -var usersStore; -var usersGrid; -var groupsStore; -var groupsGrid; -var adHocUsersStore; -var adHocUsersGrid; -var adHocGroupsStore; -var adHocGroupsGrid; - -var usersActorsWin; -var groupsActorsWin; -var adhocUsersActorsWin; -var adHocGroupsActorsWin; - -var _onDropActors; -var _targetTask; - -Ext.onReady(function(){ - divScroll = document.body; - -toolbarPanel = { - title: ' ', - border: true, - xtype:'buttongroup', - defaultType: 'button', - cls: 'btn-panel-pmtoolbar', - columns: 1, - defaults: { - scale: 'small' - }, - - items : [{ - iconCls: 'button_small_ext ss_sprite ss_bpmn_task-18x18', - id:"x-shapes-task", - text: ' ', - width: 22 - },{ - iconCls: 'button_small_ext ss_sprite ss_bpmn_startevent-18x18', - id:"x-shapes-startEvent", - text: ' ', - width: 22 - },{ - iconCls: 'button_small_ext ss_sprite ss_bpmn_interevent-18x18', - id:"x-shapes-interEvent", - text: ' ', - width: 22 - },{ - iconCls: 'button_small_ext ss_sprite ss_bpmn_endevent-18x18', - id:"x-shapes-endEvent", - text: ' ', - width: 22 - },{ - iconCls: 'ss_sprite ss_bpmn_gateway-18x18', - id:"x-shapes-gateways", - text: ' ', - width: 22 - },{ - iconCls: 'ss_sprite ss_bpmn_annotation-18x18', - id:"x-shapes-annotation", - text: ' ', - width: 22 - } - ] -}; - - -actorsPanel = { - title: ' ',//_('ID_ACTORS'), - border: true, - xtype:'buttongroup', - defaultType: 'button', - cls: 'btn-panel-pmtoolbar', - columns: 1, - defaults: { - scale: 'small' - }, - items : [ - { - iconCls: 'ICON_USERS', - id:"x-pm-users", - text: ' ', - width: 22, - handler: function(){ - usersActorsWin.show(); - } - },{ - iconCls: 'ICON_GROUPS', - id:"x-pm-groups", - text: ' ', - width: 22, - handler: function(){ - groupsActorsWin.show(); - } - },{ - iconCls: 'ss_sprite ss_user_suit', - id:"x-pm-users-adhoc", - text: ' ', - width: 22, - handler: function(){ - adHocUsersActorsWin.show(); - } - },{ - iconCls: 'ss_sprite ss_group_suit', - id:"x-pm-groups-adhoc", - text: ' ', - width: 22, - handler: function(){ - adHocGroupsActorsWin.show(); - } - } - ] -}; - - -northPanelItems = [ -/* - { - text: 'Save', - cls: 'x-btn-text-icon', - iconCls: 'button_menu_ext ss_sprite ss_disk', - handler: function() { - saveProcess(); - } - }, { - text:'Save as', - iconCls: 'button_menu_ext ss_sprite ss_disk_multiple' - }, { - xtype: 'tbseparator' - }, -*/{ - //xtype: 'tbsplit', - text:'Edit', - //iconCls: '', - menu: new Ext.menu.Menu({ - items: [ - { - text: _('ID_SWITCH_EDITOR'), - iconCls: 'ss_sprite ss_arrow_switch', - handler: function() { - if(typeof pro_uid !== 'undefined') { - location.href = 'processes/processes_Map?PRO_UID=' +pro_uid+ '&rand=' +Math.random() - } - } - }, { - text: _('ID_SNAP_GEOMETRY'), - checked: false, // when checked has a boolean value, it is assumed to be a CheckItem - checkHandler: function(item, checked){ - workflow.setSnapToGeometry(checked); - } - } - ] - }) - }, - { - //xtype: 'tbsplit', - //iconCls: 'button_menu_ext ss_sprite ss_application', - text: 'Process', - menu: new Ext.menu.Menu({ - items: [{ - text : 'Dynaform', - iconCls: 'button_menu_ext ss_sprite ss_application_form', - handler : function() { - processObj.addDynaform(); - } - }, { - text: 'Input Document', - iconCls: 'button_menu_ext ss_sprite ss_page_white_put', - handler : function() { - processObj.addInputDoc(); - } - }, { - text: 'Output Document', - iconCls: 'button_menu_ext ss_sprite ss_page_white_get', - - handler : function() { - processObj.addOutputDoc(); - } - }, { - text: 'Trigger', - iconCls: 'button_menu_ext ss_sprite ss_cog', - handler : function() { - processObj.addTriggers(); - } - }, { - text: 'Report Table', - iconCls: 'button_menu_ext ss_sprite ss_table', - handler : function() { - processObj.addReportTable(); - } - }, { - text: 'Database Connection', - iconCls: 'button_menu_ext ss_sprite ss_database_connect', - handler : function() { - processObj.dbConnection(); - } - } - - ] - }) - - }, - '-', - { - text:'Undo', - iconCls: 'button_menu_ext ss_sprite ss_arrow_undo', - handler: function() { - workflow.getCommandStack().undo(); - } - }, { - text:'Redo', - iconCls: 'button_menu_ext ss_sprite ss_arrow_redo', - handler: function() { - workflow.getCommandStack().redo(); - } - },{ - //xtype: 'tbsplit', - text:'Zoom', - iconCls: 'button_menu_ext ss_sprite ss_zoom', - menu: new Ext.menu.Menu({ - items: [{ - text : '25%', - handler: function() { - Ext.getCmp('designerTab')._setDesignerTitle(pro_title + ' (25%)'); - workflow.zoom('25'); - } - },{ - text : '50%', - handler: function() { - Ext.getCmp('designerTab')._setDesignerTitle(pro_title + ' (50%)'); - workflow.zoom('50'); - } - },{ - text : '75%', - handler: function() { - Ext.getCmp('designerTab')._setDesignerTitle(pro_title + ' (75%)'); - workflow.zoom('75'); - } - },{ - text : '100%', - handler: function() { - Ext.getCmp('designerTab')._setDesignerTitle(pro_title + ' (100%)'); - workflow.zoom('100'); - } - },{ - text : '125%', - handler: function() { - Ext.getCmp('designerTab')._setDesignerTitle(pro_title + ' (125%)'); - workflow.zoom('125'); - } - },{ - text : '150%', - handler: function() { - Ext.getCmp('designerTab')._setDesignerTitle(pro_title + ' (150%)'); - workflow.zoom('150'); - } - },{ - text : '200%', - handler: function() { - Ext.getCmp('designerTab')._setDesignerTitle(pro_title + ' (200%)'); - workflow.zoom('200'); - } - } - ] - }) - } /*,{ - xtype: 'tbseparator' - }, { - text: _('ID_ACTORS'), - iconCls: 'ICON_USERS', - handler: function(){ - usersPanel.show() - } - - }, { - xtype: 'tbfill' - }, { - text: _('ID_SWITCH_EDITOR'), - iconCls: 'button_menu_ext ss_sprite ss_pencil', - handler: function() { - if(typeof pro_uid !== 'undefined') { - location.href = 'processes/processes_Map?PRO_UID=' +pro_uid+ '&rand=' +Math.random() - } - } - }*/ -] - - - -eastPanelTree = new Ext.tree.TreePanel({ - id: 'eastPanelTree', - useArrows: false, - autoScroll: true, - animate: true, - rootVisible : false, - border: true, - height: PMExt.getBrowser().screen.height * 0.3, - region: 'north', - split : true, - collapseMode:'mini', - loader : new Ext.tree.TreeLoader({ - preloadChildren : true, - dataUrl : 'processProxy/getProcessDetail', - baseParams : { - PRO_UID: pro_uid - } - }), - root: { - nodeType : 'async', - draggable : false, - id : 'root', - expanded : true - } -}); - -// tree east panel selection change -eastPanelTree.getSelectionModel().on('selectionchange', function(tree, node){ - if( node.attributes.type == 'task') { - _TAS_UID = node.attributes.id; - - Ext.getCmp('usersPanelTabs').getTabEl('usersTaskGrid').style.display = ''; - Ext.getCmp('usersPanelTabs').getTabEl('usersTaskAdHocGrid').style.display = ''; - Ext.getCmp('usersTaskGrid').store.reload({params: {tas_uid: _TAS_UID, tu_type: 1}}); - Ext.getCmp('usersTaskAdHocGrid').store.reload({params: {tas_uid: _TAS_UID, tu_type: 2}}); - } else { - Ext.getCmp('usersPanelTabs').setActiveTab(0); - Ext.getCmp('usersPanelTabs').getTabEl('usersTaskGrid').style.display = 'none'; - Ext.getCmp('usersPanelTabs').getTabEl('usersTaskAdHocGrid').style.display = 'none'; - } - propertyStore.reload({params: { - action : 'getProperties', - UID : node.attributes.id, - type : node.attributes.type - }}); - Ext.getCmp('eastPanelCenter').setTitle(node.attributes.typeLabel+': '+node.attributes.text); - //propertiesGrid.store.sort('name','DESC'); - propertiesGrid.setSource(propertyStore.reader.jsonData.prop); - -}) - -ActiveProperty = new Ext.form.Checkbox({ - name : 'active', - fieldLabel : 'Active', - checked : true, - inputValue : '1' -}); - -comboCategory = new Ext.form.ComboBox({ - fieldLabel : 'Category', - name : 'category', - allowBlank : true, - store : new Ext.data.Store( { - //autoLoad: true, //autoload the data - proxy : new Ext.data.HttpProxy( { - url : 'processProxy/getCategoriesList', - method : 'POST' - }), - baseParams : { - action : 'getCategoriesList' - }, - reader : new Ext.data.JsonReader( { - //root : 'rows', - fields : [ - {name : 'CATEGORY_UID'}, - {name : 'CATEGORY_NAME'} - ] - }) - }), - valueField : 'CATEGORY_NAME', - displayField : 'CATEGORY_NAME', - typeAhead : true, - //mode : 'local', - triggerAction : 'all', - editable: true, - forceSelection: true, - selectOnFocus : true -}); - -comboCalendar = new Ext.form.ComboBox({ - fieldLabel : 'Calendar', - name : 'calendar', - allowBlank : true, - store : new Ext.data.Store( { - //autoLoad: true, //autoload the data - proxy : new Ext.data.HttpProxy({ url: 'processProxy/getCaledarList'}), - //baseParams : {action: 'getCaledarList'}, - reader : new Ext.data.JsonReader( { - root : 'rows', - fields : [ - {name : 'CALENDAR_UID'}, - {name : 'CALENDAR_NAME'} - ] - }) - }), - valueField : 'CALENDAR_NAME', - displayField : 'CALENDAR_NAME', - typeAhead : true, - //mode : 'local', - triggerAction : 'all', - editable: true, - forceSelection: true -}); - -var comboPMVariables = new Ext.form.ComboBox({ - fieldLabel : 'Calendar', - name : 'calendar', - allowBlank : true, - store : new Ext.data.Store( { - //autoLoad: false, //autoload the data - proxy : new Ext.data.HttpProxy({ url: 'processProxy/getPMVariables'}), - baseParams : {PRO_UID: pro_uid}, - reader : new Ext.data.JsonReader( { - root : 'rows', - fields : [ - {name : 'sName'}, - {name : 'sName'} - ] - }) - }), - valueField : 'sName', - displayField : 'sName', - typeAhead : true, - //mode : 'local', - triggerAction: 'all', - editable: true, - forceSelection: true -}); - -propertiesGrid = new Ext.grid.PropertyGrid({ - id: 'propGrid', - title: 'Properties', - loadMask : {msg:"Loading..."}, - autoHeight: true, - viewConfig : { - forceFit: true, - scrollOffset: 2 // the grid will never have scrollbars - }, - customEditors: { - //'Debug' : new Ext.grid.GridEditor(ActiveProperty), - 'Category' : new Ext.grid.GridEditor(comboCategory), - 'Calendar' : new Ext.grid.GridEditor(comboCalendar), - 'Variable for case priority' : new Ext.grid.GridEditor(comboPMVariables) - } -}); - -propertiesGrid.on('afteredit', function afterEdit(r) { - var node = Ext.getCmp('eastPanelTree').getSelectionModel().getSelectedNode(); - var UID; - var type; - - if( node ) { - UID = node.attributes.id; - type = node.attributes.type; - } else { - UID = pro_uid; - type = 'process'; - } - Ext.Ajax.request({ - url: 'processProxy/saveProperties', - params: { - UID: UID, - type: type, - property: r.record.data.name, - value: r.value - }, - success: function(response) { - if( type == 'process' && r.record.data.name == 'Title') { - pro_title = r.value; - - Ext.getCmp('designerTab')._setDesignerTitle(pro_title); - Ext.getCmp('eastPanelTree').getNodeById(UID).setText(pro_title); - } else if( type == 'task' && r.record.data.name == 'Title') { - Ext.getCmp('eastPanelTree').getNodeById(UID).setText(r.value); - //here we need to find and update the task title into task figure on designer - //if the current selection is the same node editing the title property - - if( workflow.currentSelection.id == UID ) { - workflow.currentSelection.taskName = r.value; - } - } - }, - failure: function(){ - //Ext.Msg.alert ('Failure'); - } - }); - - //r.record.commit(); -}, this ); - - -propertyStore = new Ext.data.JsonStore({ - id: 'propertyStore', - autoLoad: true, //autoload the data - url: 'processProxy/getProperties', - root: 'prop', - fields: ['title', 'description'], - store: new Ext.grid.PropertyStore({ - sortable: false, - defaultSortable: false - }), - listeners: { - load: { - fn: function(store, records, options){ - //propertiesGrid.store.sort('name','DESC'); - propertiesGrid.setSource(store.reader.jsonData.prop); - } - } - }, - baseParams: { - UID : pro_uid, - type : 'process' - } -}); - - -usersTaskStore = new Ext.data.GroupingStore( { - autoLoad: false, - url: 'processProxy/getActorsTask', - reader : new Ext.data.JsonReader({ - totalProperty: 'totalCount', - root: 'data', - fields : [ - {name : 'USR_UID'}, - {name : 'USR_USERNAME'}, - {name : 'USR_FIRSTNAME'}, - {name : 'USR_LASTNAME'}, - {name : 'NAME'}, - {name : 'TU_RELATION'} - ] - }), - baseParams: {tas_uid: '', tu_type: ''}, - groupField: 'TU_RELATION' - }); - - usersTaskGrid = new Ext.grid.GridPanel({ - id : 'usersTaskGrid', - title : _('ID_ACTORS'), - height : 180, - stateful : true, - stateId : 'usersTaskGrid', - sortable:false, - view: new Ext.grid.GroupingView({ - forceFit:true, - groupTextTpl: '{[values.rs.length]} {[values.rs[0].data["TU_RELATION"] == 1 ? "Users" : "Groups"]}' - }), - cm : new Ext.grid.ColumnModel({ - defaults: { - width: 300, - sortable: true - }, - columns : [ - {id:'USR_UID', dataIndex: 'USR_UID', hidden:true, hideable:false}, - {header: 'Assigned', id:'TU_RELATION', dataIndex: 'TU_RELATION', hidden:true, hideable:false}, - {header: 'User', dataIndex: 'USER', width: 249, renderer:function(v,p,r){ - if( r.data.TU_RELATION == '1' ) - return _FNF(r.data.USR_USERNAME, r.data.USR_FIRSTNAME, r.data.USR_LASTNAME); - else - return r.data.NAME; - }} - ] - }), - store: usersTaskStore, - listeners: { - render: function(){ - this.loadMask = new Ext.LoadMask(this.body, {msg:_('ID_LOADING')}); - } - }/*, - tbar:[ - '->', { - text: _('ID_REMOVE'), - iconCls: 'button_menu_ext ss_sprite ss_delete', - handler: removeUsersTask - } - ]*/, - bbar: [new Ext.PagingToolbar({ - pageSize : 10, - store : usersTaskStore, - displayInfo: true, - displayMsg : '{2} Users', - emptyMsg : '' - })] - }); - - //connecting context menu to grid - usersTaskGrid.addListener('rowcontextmenu', function(grid, rowIndex, e){ - e.stopEvent(); - var coords = e.getXY(); - usersTaskGridContextMenu.showAt([coords[0], coords[1]]); - }); - - //by default the right click is not selecting the grid row over the mouse - usersTaskGrid.on('rowcontextmenu', function (grid, rowIndex, evt) { - var sm = grid.getSelectionModel(); - sm.selectRow(rowIndex, sm.isSelected(rowIndex)); - }); - - //prevent default - usersTaskGrid.on('contextmenu', function (evt) { - evt.preventDefault(); - }); - - usersTaskGridContextMenu = new Ext.menu.Menu({ - id: 'messageContextMenu', - items: [{ - text: _('ID_REMOVE'), - iconCls: 'button_menu_ext ss_sprite ss_delete', - handler: removeUsersTask - } - ] - }); - - //AD HOC - usersTaskAdHocStore = new Ext.data.GroupingStore( { - autoLoad: false, - url: 'processProxy/getActorsTask', - reader : new Ext.data.JsonReader({ - totalProperty: 'totalCount', - root: 'data', - fields : [ - {name : 'USR_UID'}, - {name : 'USR_USERNAME'}, - {name : 'USR_FIRSTNAME'}, - {name : 'USR_LASTNAME'}, - {name : 'NAME'}, - {name : 'TU_RELATION'} - ] - }), - baseParams: {tas_uid: '', tu_type: ''}, - groupField: 'TU_RELATION' - }); - - usersTaskAdHocGrid = new Ext.grid.GridPanel({ - id : 'usersTaskAdHocGrid', - title : _('ID_AD_HOC_ACTORS'), - height : 180, - stateful : true, - stateId : 'usersTaskAdHocGrid', - sortable:false, - view: new Ext.grid.GroupingView({ - forceFit:true, - groupTextTpl: '{[values.rs.length]} {[values.rs[0].data["TU_RELATION"] == 1 ? "Users" : "Groups"]}' - }), - cm : new Ext.grid.ColumnModel({ - defaults: { - width: 300, - sortable: true - }, - columns : [ - {id:'USR_UID', dataIndex: 'USR_UID', hidden:true, hideable:false}, - {header: 'Assigned', id:'TU_RELATION', dataIndex: 'TU_RELATION', hidden:true, hideable:false}, - {header: 'User', dataIndex: 'USER', width: 249, renderer:function(v,p,r){ - if( r.data.TU_RELATION == '1' ) - return _FNF(r.data.USR_USERNAME, r.data.USR_FIRSTNAME, r.data.USR_LASTNAME); - else - return r.data.NAME; - }} - ] - }), - store: usersTaskAdHocStore, - listeners: { - render: function(){ - this.loadMask = new Ext.LoadMask(this.body, {msg:_('ID_LOADING')}); - } - }/*, - tbar:[ - '->', { - text: _('ID_REMOVE'), - iconCls: 'button_menu_ext ss_sprite ss_delete', - handler: removeUsersTask - } - ]*/, - bbar: [new Ext.PagingToolbar({ - pageSize : 10, - store : usersTaskStore, - displayInfo: true, - displayMsg : '{2} Users', - emptyMsg : '' - })] - }); - - - //connecting context menu to grid - usersTaskAdHocGrid.addListener('rowcontextmenu', function(grid, rowIndex, e) { - e.stopEvent(); - var coords = e.getXY(); - usersTaskAdHocGridContextMenu.showAt([coords[0], coords[1]]); - },this); - - //by default the right click is not selecting the grid row over the mouse - //we need to set this four lines - usersTaskAdHocGrid.on('rowcontextmenu', function (grid, rowIndex, evt) { - var sm = grid.getSelectionModel(); - sm.selectRow(rowIndex, sm.isSelected(rowIndex)); - }, this); - - //prevent default - usersTaskGrid.on('contextmenu', function (evt) { - evt.preventDefault(); - }, this); - - usersTaskAdHocGridContextMenu = new Ext.menu.Menu({ - id: 'messagAdHocGrideContextMenu', - items: [{ - text: _('ID_REMOVE'), - iconCls: 'button_menu_ext ss_sprite ss_delete', - handler: removeUsersAdHocTask - } - ] - }); - - /*** for actors ***/ - usersStore = new Ext.data.Store({ - autoLoad: false, - proxy : new Ext.data.HttpProxy({ - url: 'processProxy/getUsers?start='+usersPanelStart+'&limit='+usersPanelLimit - }), - reader : new Ext.data.JsonReader( { - totalProperty: 'totalCount', - root: 'data', - fields : [ - {name : 'USR_UID'}, - {name : 'USER'}, - {name : 'USR_USERNAME'}, - {name : 'USR_FIRSTNAME'}, - {name : 'USR_LASTNAME'} - ] - }), - listeners: { - load: function(){ - usersActorsWin.setTitle(_('ID_USERS_ACTORS') + ' (' +usersStore.reader.jsonData.totalCount+ ')'); - } - } - }); - - usersGrid = new Ext.grid.GridPanel({ - id : 'usersGrid', - height : 180, - ddGroup : 'task-assignment', - enableDragDrop : true, - width: 150, - cm : new Ext.grid.ColumnModel({ - defaults: { - width: 200, - sortable: true - }, - columns : [ - {header: 'USR_UID', id:'USR_UID', dataIndex: 'USR_UID', hidden:true, hideable:false}, - {header: 'User', dataIndex: 'USER', width: 249, renderer:function(v,p,r){ - return _FNF(r.data.USR_USERNAME, r.data.USR_FIRSTNAME, r.data.USR_LASTNAME); - }} - ] - }), - store: usersStore, - loadMask: {msg:_('ID_LOADING')}, - tbar : [ - new Ext.form.TextField ({ - id : 'usersSearchTxt', - ctCls :'pm_search_text_field', - allowBlank : true, - width : 170, - emptyText : _('ID_ENTER_SEARCH_TERM'), - listeners : { - specialkey: function(f,e){ - if (e.getKey() == e.ENTER) - usersSearch(); - } - } - }), { - text :'X', - ctCls :'pm_search_x_button', - handler : function(){ - usersStore.setBaseParam( 'search', ''); - usersStore.load({params:{start : 0 , limit : usersPanelLimit}}); - Ext.getCmp('usersSearchTxt').setValue(''); - } - }, { - text :TRANSLATIONS.ID_SEARCH, - handler : usersSearch - } - ] - /*, - bbar: [new Ext.PagingToolbar({ - pageSize : usersPanelLimit, - store : usersStore, - displayInfo: true, - displayMsg : '{2} Users', - emptyMsg : '' - })]*/ - }); - - adHocUsersStore = new Ext.data.Store({ - autoLoad: false, - proxy : new Ext.data.HttpProxy({ - url: 'processProxy/getUsers?start='+usersPanelStart+'&limit='+usersPanelLimit - }), - reader : new Ext.data.JsonReader( { - totalProperty: 'totalCount', - root: 'data', - fields : [ - {name : 'USR_UID'}, - {name : 'USER'}, - {name : 'USR_USERNAME'}, - {name : 'USR_FIRSTNAME'}, - {name : 'USR_LASTNAME'} - ] - }), - listeners: { - load: function(){ - adHocUsersActorsWin.setTitle(_('ID_ADHOC_USERS_ACTORS') + ' (' +adHocUsersStore.reader.jsonData.totalCount+ ')'); - } - } - }); - - adHocUsersGrid = new Ext.grid.GridPanel({ - id : 'adHocUsersGrid', - height : 180, - ddGroup : 'task-assignment', - enableDragDrop : true, - width: 150, - cm : new Ext.grid.ColumnModel({ - defaults: { - width: 200, - sortable: true - }, - columns : [ - {header: 'USR_UID', id:'USR_UID', dataIndex: 'USR_UID', hidden:true, hideable:false}, - {header: 'User', dataIndex: 'USER', width: 249, renderer:function(v,p,r){ - return _FNF(r.data.USR_USERNAME, r.data.USR_FIRSTNAME, r.data.USR_LASTNAME); - }} - ] - }), - store: adHocUsersStore, - loadMask: {msg:_('ID_LOADING')}, - tbar : [ - new Ext.form.TextField ({ - id : 'adHocUsersSearchTxt', - ctCls :'pm_search_text_field', - allowBlank : true, - width : 170, - emptyText : _('ID_ENTER_SEARCH_TERM'), - listeners : { - specialkey: function(f,e){ - if (e.getKey() == e.ENTER) - adHocUsersSearch(); - } - } - }), { - text :'X', - ctCls :'pm_search_x_button', - handler : function(){ - adHocUsersStore.setBaseParam( 'search', ''); - adHocUsersStore.load({params:{start : 0 , limit : usersPanelLimit}}); - Ext.getCmp('adHocUsersSearchTxt').setValue(''); - } - }, { - text :TRANSLATIONS.ID_SEARCH, - handler : adHocUsersSearch - } - ] - /*, - bbar: [new Ext.PagingToolbar({ - pageSize : usersPanelLimit, - store : usersStore, - displayInfo: true, - displayMsg : '{2} Users', - emptyMsg : '' - })]*/ - }); - - groupsStore = new Ext.data.Store( { - autoLoad: false, - proxy : new Ext.data.HttpProxy({ - url: 'processProxy/getGroups?start='+usersPanelStart+'&limit='+usersPanelLimit - }), - reader : new Ext.data.JsonReader( { - totalProperty: 'totalCount', - root: 'data', - fields : [ - {name : 'GRP_UID'}, - {name : 'CON_VALUE'} - ] - }), - listeners: { - load: function(){ - groupsActorsWin.setTitle(_('ID_GROUPS_ACTORS') + ' (' +groupsStore.reader.jsonData.totalCount+ ')'); - } - } - }); - - groupsGrid = new Ext.grid.GridPanel({ - id : 'groupsGrid', - ddGroup : 'task-assignment', - height : 180, - width : 150, - enableDragDrop : true, - cm : new Ext.grid.ColumnModel({ - defaults : { - width : 250, - sortable : true - }, - columns: [ - {id:'GRP_UID', dataIndex: 'GRP_UID', hidden:true, hideable:false}, - {header: 'Group', dataIndex: 'CON_VALUE', width: 249} - ] - }), - store : groupsStore, - loadMask: {msg:_('ID_LOADING')}, - tbar : [ - new Ext.form.TextField ({ - id : 'groupsSearchTxt', - ctCls :'pm_search_text_field', - allowBlank : true, - width : 170, - emptyText : _('ID_ENTER_SEARCH_TERM'), - listeners : { - specialkey: function(f,e){ - if (e.getKey() == e.ENTER) - groupsSearch(); - } - } - }), { - text :'X', - ctCls :'pm_search_x_button', - handler : function(){ - groupsStore.setBaseParam( 'search', ''); - groupsStore.load({params:{start : 0 , limit : usersPanelLimit}}); - Ext.getCmp('groupsSearchTxt').setValue(''); - } - }, { - text :TRANSLATIONS.ID_SEARCH, - handler : groupsSearch - } - ]/*, - bbar: [new Ext.PagingToolbar({ - pageSize : usersPanelLimit, - store : groupsStore, - displayInfo: true, - displayMsg : '{2} Groups', - emptyMsg : 'No records found' - })]*/ - }); - - adHocGroupsStore = new Ext.data.Store( { - autoLoad: false, - proxy : new Ext.data.HttpProxy({ - url: 'processProxy/getGroups?start='+usersPanelStart+'&limit='+usersPanelLimit - }), - reader : new Ext.data.JsonReader( { - totalProperty: 'totalCount', - root: 'data', - fields : [ - {name : 'GRP_UID'}, - {name : 'CON_VALUE'} - ] - }), - listeners: { - load: function(){ - adHocGroupsActorsWin.setTitle(_('ID_ADHOC_GROUPS_ACTORS') + ' (' +adHocGroupsStore.reader.jsonData.totalCount+ ')'); - } - } - }); - - adHocGroupsGrid = new Ext.grid.GridPanel({ - id : 'adHocGroupsGrid', - ddGroup : 'task-assignment', - height : 180, - width : 150, - enableDragDrop : true, - cm : new Ext.grid.ColumnModel({ - defaults : { - width : 250, - sortable : true - }, - columns: [ - {id:'GRP_UID', dataIndex: 'GRP_UID', hidden:true, hideable:false}, - {header: 'Group', dataIndex: 'CON_VALUE', width: 249} - ] - }), - store : adHocGroupsStore, - loadMask: {msg:_('ID_LOADING')}, - tbar : [ - new Ext.form.TextField ({ - id : 'adHocGroupsSearchTxt', - ctCls :'pm_search_text_field', - allowBlank : true, - width : 170, - emptyText : _('ID_ENTER_SEARCH_TERM'), - listeners : { - specialkey: function(f,e){ - if (e.getKey() == e.ENTER) - adHocGroupsSearch(); - } - } - }), { - text :'X', - ctCls :'pm_search_x_button', - handler : function(){ - adHocGroupsStore.setBaseParam( 'search', ''); - adHocGroupsStore.load({params:{start : 0 , limit : usersPanelLimit}}); - Ext.getCmp('adHocGroupsSearchTxt').setValue(''); - } - }, { - text :TRANSLATIONS.ID_SEARCH, - handler : adHocGroupsSearch - } - ]/*, - bbar: [new Ext.PagingToolbar({ - pageSize : usersPanelLimit, - store : groupsStore, - displayInfo: true, - displayMsg : '{2} Groups', - emptyMsg : 'No records found' - })]*/ - }); - - _onDropActors = function(ddSource, e, data) { - - var records = ddSource.dragData.selections; - var uids = Array(); - _TAS_UID = _targetTask.id; - - if( data.grid.id == 'usersGrid' || data.grid.id == 'groupsGrid') { - _TU_TYPE = 1; - } else { //some groups grid items were dropped - _TU_TYPE = 2; - } - - Ext.each(records, function(gridRow){ - if( data.grid.id == 'usersGrid' || data.grid.id == 'adHocUsersGrid') {//some users grid items were dropped - _RELATION = 1; - uids.push(gridRow.data.USR_UID); - } else { //some groups grid items were dropped - _RELATION = 2; - uids.push(gridRow.data.GRP_UID); - } - }); - - uids = uids.join(','); - - - Ext.getCmp('eastPanelCenter').setTitle(_('ID_TASK')+': '+_targetTask.name); - - Ext.Ajax.request({ - url: 'processProxy/assignActorsTask', - success: function(response){ - var result = Ext.util.JSON.decode(response.responseText); - if( result.success ) { - PMExt.notify(_('ID_RESPONSABILITIES_ASSIGNMENT'), result.msg); - - Ext.getCmp('eastPanel').show(); - Ext.getCmp('usersPanelTabs').getTabEl('usersTaskGrid').style.display = ''; - Ext.getCmp('usersPanelTabs').getTabEl('usersTaskAdHocGrid').style.display = ''; - Ext.getCmp('eastPanelTree').getNodeById(_TAS_UID).select(); - if( _TU_TYPE == 1 ) { - Ext.getCmp('usersPanelTabs').setActiveTab(1); - Ext.getCmp('usersTaskGrid').store.reload({params:{tas_uid: _TAS_UID, tu_type: 1}}); - } else { - Ext.getCmp('usersPanelTabs').setActiveTab(2); - Ext.getCmp('usersTaskAdHocGrid').store.reload({params:{tas_uid: _TAS_UID, tu_type: 2}}); - } - - } else { - PMExt.error(_('ID_ERROR'), result.msg); - } - }, - failure: function(){}, - params: { - TAS_UID : _TAS_UID, - TU_TYPE : _TU_TYPE, - TU_RELATION : _RELATION, - UIDS : uids - } - }); - } - - - //last - usersActorsWin = new Ext.Window({ - layout:'fit', - padding: '0 10 0 0', - iconCls: 'ICON_USERS', - width:260, x:45, y:55, - height:PMExt.getBrowser().screen.height/2 - 20, - closeAction:'hide', - plain: true, - plugins: [ new Ext.ux.WindowCascade() ], - offset: 50, - items: [usersGrid], - listeners:{ - beforerender:function(){ - usersGrid.store.load(); - } - } - }); - - adHocUsersActorsWin = new Ext.Window({ - layout:'fit', - padding: '0 10 0 0', - iconCls: 'ss_sprite ss_user_suit', - width:260, - height:PMExt.getBrowser().screen.height/2 - 20, - closeAction:'hide', - plain: true, - plugins: [ new Ext.ux.WindowCascade() ], - offset: 50, - items: [adHocUsersGrid], - listeners:{ - beforerender:function(){ - adHocUsersGrid.store.load(); - } - } - }); - - groupsActorsWin = new Ext.Window({ - layout:'fit', - padding: '0 10 0 0', - iconCls: 'ICON_GROUPS', - width:260, - height:PMExt.getBrowser().screen.height/2 - 20, - closeAction:'hide', - plain: true, - plugins: [ new Ext.ux.WindowCascade() ], - offset: 50, - items: [groupsGrid], - listeners:{ - beforerender:function(){ - groupsGrid.store.load(); - } - } - }); - - adHocGroupsActorsWin = new Ext.Window({ - layout:'fit', - padding: '0 10 0 0', - iconCls: 'ss_sprite ss_group_suit', - width:260, - height:PMExt.getBrowser().screen.height/2 - 20, - closeAction:'hide', - plain: true, - plugins: [ new Ext.ux.WindowCascade() ], - offset: 50, - items: [adHocGroupsGrid], - listeners:{ - beforerender:function(){ - adHocGroupsGrid.store.load(); - } - } - }); - -}); -//end onReady - - -function removeUsersTask(){ - - var usr_uid = Array(); - var tu_relation = Array(); - var rowsSelected = Ext.getCmp('usersTaskGrid').getSelectionModel().getSelections(); - - if( rowsSelected.length == 0 ) { - PMExt.error('', _('ID_NO_SELECTION_WARNING')); - return false; - } - - for(i=0; i