1、UsergetMyItem.setAttribute(selectfirst_name,last_nameItem MyResult = MyItem.apply();for (int i=0; iMyResult.getItemCount(); i+) msgBox.AppendText(n + i + + MyResult.getItemByIndex(i).getProperty(first_namena) + last_name) ); /Document实例的添加注:必填项属性必须设置,属性名一般为小写,若为大写将不可识别, 属性的空格用_代替,若属性值为系统已有的内置属性,则必须与
2、系统内置属性值相等,区分大小写Example:Innovator innovator = new Innovator(connection);Item item = innovator.newItem(Documentadditem.setProperty(item_number0002Example1classification/Document/Softwareauthoring_toolOthereffective_date2010-01-21item = item.apply();/修改多语言字段itemtype为对象类名称,lang为多语言字段缩写,name为字段名string la
3、ng=zh;Item resultitem = innovator.newItem(itemtype, editresultitem.setAttribute(id, id);resultitem.setProperty(name, value, lang);resultitem = resultitem.apply();/提升版本方法1:resultitem.promote(activePlease review方法2: q.setAttribute(actionPromoteItemtypeId, thisItem.getProperty(itemtype); q.setID(thisIt
4、em.getID(); q.setProperty(state,toState); r = q.apply();/Innovator RelationShip的添加添加RelationShip时,relationshipType需指定一个联系的对象(item)添加关系时应特别注意,向文档中添加文件时的关系添加,如向Part中添加BOM的关系操作不同,不同对象的关系添加方式不同此例子为向文档中添加已存在的文件First /获取关联文件Item file = innovator.newItem(Filefile.setProperty(keyed_name,id,filename8FA86396E
5、DDA493481BF0A3AA6F15D44file = file.apply(); /Document File表存储了文档和文件的关系Item docfile = innovator.newItem(Document Filedocfile.setProperty(source_id, item.getID();docfile.setPropertyAttribute(keyed_name, item.getProperty(docfile.getPropertyAttribute(typerelated_id, file.getID();, file.getProperty(Typei
6、tem.addRelationship(docfile);item.apply();判断当前窗体对象是否被锁定:if (!document.thisItem.isNew() & document.thisItem.getAttribute() != & document.thisItem.isLocked() != 1 ) return top.aras.newError(请先锁定窗体!方法简化:为Document添加File关系为: Item relationship=innovator.newItem( relationship.setRelatedItem(file); item.add
7、Relationship(relationship); item.apply();/C# 连接excelstring strconn = Provider=Microsoft.Jet.OLEDB.4.0;Data Source=0;Extended Properties=Excel 8.0;HDR=Yes;IMEX=1; /连接字符串中的空格不可去掉 string command = string.Format(select * from 0$, sheetname);/$不可去掉 using (OleDbConnection oleconnection = new OleDbConnecti
8、on(string.Format(strconn, filepath) oleconnection.Open(); DataTable st = oleconnection.GetOleDbSchemaTable(OleDbSchemaGuid.Tables, null); OleDbDataAdapter oleadapter = new OleDbDataAdapter(command, oleconnection); DataSet ds = new DataSet(); oleadapter.Fill(ds); return ds;/小知识点activity表的message为显示在I
9、nbasket中的介绍(introduction)/关于Item.apply()方法的说明当Item.apply()提交的数据与数据库中数据产生冲突时,会自动不予提交/上传文件 path文件路径 Item item = innovator.newItem( int index=path.LastIndexOf( string filename=path.subString(index+1); item.setProperty(filename, filename); item.attachPhysicalFile(path); item = item.apply();提升生命周期状态:acti
10、onitem=innovator.newItem(Action Itemactionitem.setAttribute(where,string.Format(id=0,actid);actionitem.promote(Please review.actionitem=actionitem.apply();AML关系查找示例: 1RelationshipsMy BOMrelated_id2/related_id/Relationships/javascript操作页面元素var results=document.thisItem;/获取页面元素var element=results.getI
11、temsByXpath(/Itemtype=TPK_Millstonedocument.thisItem.isLocked()=1表示页面元素被锁定document.thisItem.isNew() 判断页面对象是否为新建对象document.thisItem.getAttribute( 判断当前的操作是否为add/获取属性的子属性 string newitem = resulitem.getPropertyAttribute(current_state/赋予权限,applySQL只有当前用户为Administrator或super user身份时可用,Aras PLM也具有applySQL的
12、权限,一般在系统内部使用其他身份若要使用applySQL需要先赋予权限Aras.Server.Security.Identity plmIdentity = Aras.Server.Security.Identity.GetByName(Aras PLMbool PermissionWasSet = Aras.Server.Security.Permissions.GrantIdentity(plmIdentity);if (PermissionWasSet) Aras.Server.Security.Permissions.RevokeIdentity(plmIdentity);/ 工作流实
13、例间的关系,当工作流实例根据模板建立后,基本与模板没有关系,(a.source_type=itemtype.id a.source_id=item.id)Workflow(a)-1:1-Workflow Process(b)-1:N-Workflow Process Activity(c)-1:1-Activity(d)-1:N-Activity Assignment(e)a.related_id=b.id, c.source_id=b.id c.source_id=b.id, c.related_id=d.id e.source_id=d.id,e.related_id=identity.i
14、dWorkflow Process Path:source_id(源activity),related_id(关联activity)当为工作流添加权限时,它会自动从activity处获得权限。如果是动态添加activity则必须在Activity添加后再为添加path,这样权限会自动添加。手工设置权限将无效(applySQL除外)。更新缓存 在页面中填写值完毕后通过此方法更新缓存中的值,否则依然为原数据 handleItemChange(字段id,字段值);打开某个对象的方法:function showorkflowprocess() var itemNd = top.aras.getItem
15、ById(对象类名称对象类id, 0); var myLock =false; top.aras.uiShowItemEx(itemNd, top.aras.getPreferenceItemProperty(Core_GlobalLayout, null, core_view_mode), top.aras.getVariable(TearOff) = true隐藏Pr页签中的Files页签:top.hideIssueTabs=function() if(!parent.relationships|!parent.relationships.relTabbarReady|parent.rel
16、ationships.relTabbar.GetTabOrder(|)=) setTimeout(top.hideIssueTabs(),30); return; var tabbar=parent.relationships.relTabbar; var tabID=tabbar.getTabId(Files/得到Files的tabId if(tabID!=undifined)tabbar.SetTabVisible(tabID,false); /将Visible设置为false;快速获取数据库连接字符串的方法:建一个后缀名为udl的文件/项目模板的存储Project Template的存储
17、:project_template.wbs_id=wbs_element.idproject_template.wbs_id=sub_wbs.source_idsub_wbs.related_id=wbs_element.idwbs_element和Activity2的对应关系为WBS_Activity2打开workflow签核页需要传递的参数:1 var params=new Object(); params.aras=top.aras; params.activity=top.aras.getItemById(activity,activityId,1); params.wflName=w
18、flName; /workflow process的名称 params.wflId=workflowProcessID; /workflow process的id params.assignmentId=assignmentId;/activity assignment的id params.itemId=itemId; /item的id showModalDialogWithDelay(InBasket-VoteDialog.html, params, resizable:1; scroll: dialogHeight:400px; dialogWidth:700px; status: hel
19、p:0, true);打开Project签核页需要传递的参数:var params=new Array();params0=window;params1=activityID; /activity2的IDshowModalDialog(././Solutions/Project/scripts/ActivityCompletionWorksheet/ACWDialog.htmldialogHeight: 320px;0; resizable:1javascript获取对象类关系:top.aras.getItemRelationShips(Project,projectid,Project Te
20、amInbasket中workflow activities的数据来自Activity 和Activity Assignment.Inbasket中Project Activities的数据来自Activity2 和Activity2 Assignment. 当前状态(Pending-Active-Complate)由Activity2.state字段标识。 activity2的date_start_sched,date_due_sched分别表示计划开始时间和计划结束时间。9.2版本下notification_control在中文模式下报错:修改arasInnovatorInnovatorC
21、lientjavascriptuser_notifications.js中 if (!notification_control) throw new Error(1, ArgumentException: notification_control cant be undefined这不是最好的办法,只是暂时不报错/获取网格中的选中对象mainTreeApplet=parent.tree.treeApplet;var selectedRowId = mainTreeApplet.getSelectedId();熟悉STAThreadjavascript操作gridApplet:gridApple
22、t.cells(relationshipID,列数).GetValue()获取某行某列的值).setEditType(1)将单元格设置为编辑状态javascirpt禁用元素:disabled=true ,设置元素为只读:readOnly=true(注意大小写)Javascript 获取时间日期的各种格式var myDate = new Date();myDate.getYear(); /获取当前年份(2位)myDate.getFullYear(); /获取完整的年份(4位,1970-?myDate.getMonth(); /获取当前月份(0-11,0代表1月)myDate.getDate(); /获取当前日(1-31)myDate.getDay(); /获取当前星期X(0-6,0代表星期天)myDate.getTime(); /获取当前时间(从1970.1.1开始的毫秒数)myDate.getHours(); /获取当前小时数(0-23)myDate.getMi
copyright@ 2008-2022 冰豆网网站版权所有
经营许可证编号:鄂ICP备2022015515号-1