// ReSharper disable once UnusedMethodReturnValue.Global public static bool CreateCallAction(EA.Repository rep, EA.Element action, EA.Method method) { // add ClassifierGUID to target action string updateStr = @"update t_object set classifier_GUID = '" + method.MethodGUID + "' where ea_guid = '" + action.ElementGUID + "' "; rep.Execute(updateStr); // set CallOperation string callOperationProperty = "@PROP=@NAME=kind@ENDNAME;@TYPE=ActionKind@ENDTYPE;@VALU=CallOperation@ENDVALU;@PRMT=@ENDPRMT;@ENDPROP;"; Guid g = Guid.NewGuid(); string xrefid = "{" + g + "}"; string insertIntoTXref = @"insert into t_xref (XrefID, Name, Type, Visibility, Namespace, Requirement, [Constraint], Behavior, Partition, Description, Client, Supplier, Link) VALUES('" + xrefid + "', 'CustomProperties', 'element property','Public', '','','', '',0, '" + callOperationProperty + "', '" + action.ElementGUID + "', null,'')"; rep.Execute(insertIntoTXref); // Link Call Operation to operation g = Guid.NewGuid(); xrefid = "{" + g + "}"; insertIntoTXref = @"insert into t_xref (XrefID, Name, Type, Visibility, Namespace, Requirement, [Constraint], Behavior, Partition, Description, Client, Supplier, Link) VALUES('" + xrefid + "', 'MOFProps', 'element property','Public', '','','', 'target',0, ' null ', '" + method.MethodGUID + "', null,'')"; //rep.Execute(insertIntoT_xref); return true; }
public static bool SetDiagramObjectLabel(EA.Repository rep, int objectId, int diagramId, int instanceId, string s) { string updateStr = @"update t_diagramObjects set ObjectStyle = '" + s + "' " + " where Object_ID = " + objectId + " AND "+ " Diagram_ID = " + diagramId + " AND " + " Instance_ID = " + instanceId ; rep.Execute(updateStr); return true; }
public static bool SetElementHasAttchaedLink(EA.Repository rep, EA.Element el, EA.Element elNote) { string updateStr = @"update t_object set pdata1 = 'Element Note', pdata2 = '" + el.ElementID + "', pdata4='Yes' " + " where object_ID = " + elNote.ElementID ; rep.Execute(updateStr); return true; }
public static bool SetBehaviorForOperation(EA.Repository rep, Method op, EA.Element act) { string updateStr = @"update t_operation set behaviour = '" + act.ElementGUID + "' " + " where operationID = " + op.MethodID; rep.Execute(updateStr); return true; }
public static bool SetConnectorGuard(EA.Repository rep, int connectorId, string connectorGuard) { string updateStr = @"update t_connector set pdata2 = '" + connectorGuard + "' " + " where Connector_Id = " + connectorId; rep.Execute(updateStr); return true; }
public static bool SetVcFlags (EA.Repository rep, EA.Package pkg, string flags) { string updateStr = @"update t_package set packageflags = '" + flags +"' " + " where package_ID = " + pkg.PackageID; rep.Execute(updateStr); return true; }
public static bool SetActivityCompositeDiagram(EA.Repository rep, EA.Element el, string s) { string updateStr = @"update t_object set pdata1 = '"+ s +"', ntype = 8 " + " where object_ID = " + el.ElementID; rep.Execute(updateStr); return true; }
public static bool SetElementPdata1(EA.Repository rep, EA.Element el, string s) { string updateStr = @"update t_object set pdata1 = '" + s + "' " + " where object_ID = " + el.ElementID; rep.Execute(updateStr); return true; }
public static bool SetFrameLinksToDiagram(EA.Repository rep, EA.Element frm, EA.Diagram dia) { string updateStr = @"update t_object set pdata1 = "+ dia.DiagramID + " where object_ID = " + frm.ElementID; rep.Execute(updateStr); return true; }
// set "ShowBeh=1; in operation field StyleEx public static bool SetShowBehaviorInDiagram(EA.Repository rep, Method m) { string updateStr = @"update t_operation set StyleEx = 'ShowBeh=1;'" + " where operationID = " + m.MethodID; rep.Execute(updateStr); return true; }
public static void AddSequenceNumber (EA.Repository rep, EA.Diagram dia) { string updateStr = @"update t_DiagramObjects set sequence = sequence + 1 "+ " where diagram_id = " + dia.DiagramID; rep.Execute(updateStr); }
public static bool SetXmlPath(EA.Repository rep, string guid, string path) { string updateStr = @"update t_package set XMLPath = '" + path + "' where ea_guid = '" + guid + "' "; rep.Execute(updateStr); return true; }
public static void SetSequenceNumber(EA.Repository rep, EA.Diagram dia, EA.DiagramObject obj, string sequence ) { if (obj != null) { string updateStr = @"update t_DiagramObjects set sequence = " + sequence + " where diagram_id = " + dia.DiagramID + " AND instance_id = " + obj.InstanceID; rep.Execute(updateStr); } }