update system_events set service_code='prv_default_ejb',comp_type='EJB',comp_name= 'WorkOrderRouteAlt' where obj_name = 'worder_route_alt' and event_code='pre_validate';
update system_events set service_code='poic_default_ejb',comp_type='EJB',comp_name= 'WorkOrderRouteAlt' where obj_name = 'worder_route_alt' and event_code='post_item_change';

update tarodev.system_events set comp_name='WorkOrderRouteAltConf', comp_type='EJB',service_code ='worder_route_amd' 
where obj_name='worder_route_alt' and event_code='pre_confirm';

insert into system_event_services(SERVICE_CODE,SERVICE_DESCR,SERVICE_URI,SERVICE_PROVIDER,METHOD_NAME,RETURN_VALUE,RETURN_TYPE,CHG_DATE,CHG_USER,CHG_TERM)
values ('worder_route_amd','Work order route amd. confirmation','http://localhost:8080/axis/services/ActionHandlerService','Base Information','confirm','String',
'S',sysdate,'Base','Base');

	
insert into system_service_args(SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE)
values ('worder_route_amd',1,'COMPONENT_TYPE','I','Component Type','S',sysdate,'Base','Base','EJB');

insert into system_service_args(SERVICE_CODE,LINE_NO,ARG_NAME,ARG_MODE,DESCR,ARG_TYPE,CHG_DATE,CHG_USER,CHG_TERM,ARG_VALUE)
values ('worder_route_amd',2,'COMPONENT_NAME','I','Component name','S',sysdate,'Base','Base','WorkOrderRouteAltConf');


insert into system_service_args(SERVICE_CODE,LINE_NO,ARG_NAME,ARG_TYPE,CHG_DATE,CHG_USER,CHG_TERM)
values ('worder_route_amd',3,'<tran_id>','B.String',sysdate,'Base','Base');


insert into system_service_args(SERVICE_CODE,LINE_NO,ARG_NAME ,DESCR,ARG_TYPE,CHG_DATE, CHG_USER,CHG_TERM)                                       
values ('worder_route_amd',4,'XTRA_PARAMS','params','S',sysdate,'Base','Base');

insert into system_service_args(SERVICE_CODE,LINE_NO,ARG_NAME ,DESCR,ARG_TYPE,CHG_DATE, CHG_USER,CHG_TERM)                                           
values ('worder_route_amd',5,'FORCED_FLAG','flag','S',sysdate,'Base','Base');


alter table worder_route_alt add remarks varchar2(100); 
alter table worder_route_alt add operation_parent number (5); 
alter table worder_route_alt add emp_code__aprv char (10);

Insert into obj_itemchange (OBJ_NAME,FORM_NO,FIELD_NAME,MANDATORY) values ('worder_route_alt','1','item_code',null);

Insert into obj_itemchange (OBJ_NAME,FORM_NO,FIELD_NAME,MANDATORY) values ('worder_route_alt','1','proc_code',null);

Insert into obj_itemchange (OBJ_NAME,FORM_NO,FIELD_NAME,MANDATORY) values ('worder_route_alt','1','operation_parent',null);

insert into messages
(msg_no,msg_str,msg_descr,msg_type,chg_date,chg_user,chg_term) 
values 
('VTOPRNN','Empty operation','Operation can not be blank.Please enter operation','E',sysdate,'BASE','BASE');
Insert into messages 
(MSG_NO,MSG_STR,MSG_DESCR,MSG_TYPE,MSG_OPT,MSG_TIME,ALARM,ERR_SOURCE,CHG_DATE,CHG_USER,CHG_TERM,OVERRIDE_INPUT,MAIL_OPTION) 
values ('VTALCONF','Transaction Already Confirmed','Selected transaction Already confirmed','E','Y',null,null,null,null,null,null,null,null);

Insert into messages (MSG_NO,MSG_STR,MSG_DESCR,MSG_TYPE,MSG_OPT,MSG_TIME,ALARM,ERR_SOURCE,CHG_DATE,CHG_USER,CHG_TERM,OVERRIDE_INPUT,MAIL_OPTION) 
values ('VTNCONFT','Not confirmed','Selected transaction not confirmed','E',null,null,null,null,sysdate,'BASE','BASE',null,null);

insert into messages
(msg_no,msg_str,msg_descr,msg_type,chg_date,chg_user,chg_term) 
values 
('VTCONFS','Confirmed successfully','Selected transaction confirmed successfully','P',sysdate,'BASE','BASE');

insert into messages
(msg_no,msg_str,msg_descr,msg_type,chg_date,chg_user,chg_term) 
values 
('VTOPRFDB','Operation not confirmed','Parent operation not confirmed in workorder feedback','E',sysdate,'BASE','BASE');

insert into messages
(msg_no,msg_str,msg_descr,msg_type,chg_date,chg_user,chg_term) 
values 
('VTWOSRAM','Invalid user operation','Only work order with status Release are allowed to amend','E',sysdate,'BASE','BASE');


