Archive for December, 2009

Activate all workflows

1. in simulator create new script with method Service_PreInvoke
2. in methods create new one ActAll
3. in simulator run new script with method ActAll by button Run

function Service_PreInvokeMethod (MethodName, Inputs, Outputs) {
 if (MethodName=="ActAll")
 {
  var sErr=""
  var bo=TheApplication().GetBusObject("Front Office Workflow");
  var bc=bo.GetBusComp("Repository Workflow Process Read Only");
  var sId;
  bc.ClearToQuery();
  bc.SetViewMode(AllView);
  bc.ActivateField("Status");
  bc.SetSearchExpr("[Status] = LookupValue ('WFR_DSGN_STAT_CD','COMPLETED')");
  bc.ExecuteQuery(ForwardOnly);
  var irec=bc.FirstRecord();
  while (irec) {
   sId=bc.GetFieldValue("Id");
   try {
    bc.InvokeMethod("Activate");
   }
   catch (e) {
    sErr+="|Id: " + sId + " >> " + e.toString();
   }
   irec=bc.NextRecord();

  }
  Outputs.SetProperty("SErrors", sErr);
  return (CancelOperation);

 }

 return (ContinueOperation);
}

Unlock Repository objects

VIEW

UPDATE siebel.s_view bc SET bc.obj_locked_flg = 'N', bc.obj_locked_date = NULL, bc.obj_locked_by = null, bc.obj_locked_lang = null

WHERE bc.row_id = '1-A4LQ-DX3R';

commit;

TABLE

UPDATE siebel.s_table tab SET tab.obj_locked_flg = 'N', tab.obj_locked_date = null, tab.obj_locked_by = null, tab.obj_locked_lang = null

WHERE tab.name = 'CX_RD_MATRIX'

and tab.row_id = '1NQ-5HY';

commit;

BUSCOMP

UPDATE siebel.s_buscomp bc SET bc.obj_locked_flg = 'N', bc.obj_locked_date = NULL, bc.obj_locked_by = null, bc.obj_locked_lang = null

WHERE bc.row_id = '1-A4LQ-DX3R';

commit;

BUSSERVICE

UPDATE siebel.s_service serv SET serv.obj_locked_flg = 'N', serv.obj_locked_date = NULL, serv.obj_locked_by = null, serv.obj_locked_lang = null

WHERE serv.row_id = '8B-DVG';commit;

APPLET

UPDATE siebel.s_applet appl SET appl.obj_locked_flg = 'N', appl.obj_locked_date = NULL, appl.obj_locked_by = null, appl.obj_locked_lang = null

WHERE appl.row_id = '1-O3D-C3';

commit;

PROJECT

UPDATE siebel.s_project  AS proj SET proj.locked_flg = 'N', proj.locked_date = NULL

WHERE proj.name = 'IOM Order Management';

COMMIT

Select views by applet name

select ' OR "' || w.name || '"' from siebel.S_VIEW_WTMPL_IT wti,
	   	 	  siebel.S_VIEW_WEB_TMPL wt,
			  siebel.S_VIEW w
	   where
	   		 wti.applet_name in ('IOM Account Entry Applet', 'IOM Account Entry Applet RO', 'IOM Account Entry Applet ZIU')
	   		 and wti.VIEW_WEB_TMPL_ID = wt.row_id
	   		 and wt.view_id = w.row_id
			 and w.repository_id = '1-1N4Y-1'
	   group by w.name
	   order by w.name

Summary of modified LOVs

SELECT   lov.created, usr_crt.login created_login, lov.last_upd,
         usr_upd.login updated_login, lov.TYPE, lov.NAME, lov.val,
         lov.sub_type, lov.par_row_id, par_lov.TYPE par_lov_type,
         par_lov.NAME par_lov_name
    FROM siebel.s_lst_of_val lov,
         siebel.s_lst_of_val par_lov,
         siebel.s_user usr_crt,
         siebel.s_user usr_upd
   WHERE lov.created_by = usr_crt.row_id
     AND lov.last_upd_by = usr_upd.row_id
     AND par_lov.row_id(+) = lov.par_row_id
ORDER BY lov.last_upd DESC

Summary of deployed workflows

SELECT   wdd.created, usr_crt.login created_login, wdd.last_upd,
         usr_upd.login updated_login, wdd.NAME, wdd.VERSION,
         wdd.deploy_status_cd
    FROM siebel.s_wfa_dploy_def wdd,
         siebel.s_user usr_crt,
         siebel.s_user usr_upd
   WHERE wdd.created_by = usr_crt.row_id AND wdd.last_upd_by = usr_upd.row_id
ORDER BY wdd.last_upd DESC

While cycle

		var boActSet		= TheApplication().GetBusObject("ABO Bulk Request");
		var bcActSet		= boActSet.GetBusComp("ABO Bulk Request Action Set");

		var IsRecord;

		with (bcActSet)
		{
			ClearToQuery();
			ActivateField("Due Date");
			SetSearchSpec("Bulk Request Id", '12345');
			ExecuteQuery(ForwardOnly);

			IsRecord = FirstRecord();
			while(IsRecord)
			{
				SetFieldValue("Due Date", 'xx');
				WriteRecord();

				IsRecord = NextRecord();
			}
		}

Tip

uc se a budes chytrejsi

LookupValues

escript
  var sStatusCompleted = TheApplication().InvokeMethod("LookupValue", "FS_ORDER_STATUS", "Completed");
searchspec
  [Order Type] <> LookupValue ("FS_ORDER_TYPE", "Bulk Request Template Order")
Field predefault value
  Expr: 'LookupValue("LS_MED_AE_TYPE", "Product Problem Device")'

workflow condition
(ABO Bulk Request Action Set All Must Match (Ignore Case)('[&Action Set Type] = LookupValue('ABO_BR_ACTSET_TYPE','MNP Port In') OR [&Action Set Type] = LookupValue('ABO_BR_ACTSET_TYPE','MNP Port In - PacId per Order')'))

SQL
select * from siebel.s_lst_of_val
	   where type = 'ABO_BR_SUBMIT_STATUS'