0%

RelationshipUtil_Enovia

Class RelationshipUtil

com.matrixone.apps.common.util.RelationshipUtil
public class RelationshipUtil extends java.lang.Object

The RelationshipUtil class provides tools to float objects.

Method Summary

access Method Name Description
static void connected(matrix.db.Context context, java.lang.Object objectId,java.lang.String relPattern, java.lang.String typePattern, java.lang.String expandDir, java.util.Map policyStateMap) Floats the specified relationships to this object.
static void connected(matrix.db.Context context, java.lang.Object objectId, java.lang.String relPattern, java.lang.String typePattern, java.lang.String expandDir, java.lang.String floatExpression) Floats the specified relationships to this object.

Method Detail

connected

1
2
3
4
5
6
7
public static void connected(matrix.db.Context context,
java.lang.Object objectId,
java.lang.String relPattern,
java.lang.String typePattern,
java.lang.String expandDir,
java.util.Map policyStateMap)
throws java.lang.Exception

Floats the specified relationships to this object. The objects connected to the previous revision of the given object and that meet the specified criteria are disconnected from the previous revision and connected to the given object. To meet the specified criteria, the objects must be connected to the previous revision of the given object through the relationship and type patterns, in the specified direction, and must be editable. To be editable, the object’s state must be one of the states listed in the policy-state map, or the object must not be in it’s last state.

Example:

1
2
3
4
5
6
7
BusinessObject mc = new BusinessObject("Microcomputer", "Q Prom",
"A", "Manufacturing");
HashMap sTargetState = new HashMap();
sTargetState.put("Production", "Active");
sTargetState.put("Documentation", "Finished");
HashMap returnedMsg = RelationshipUtil.connected(context, mc,
"", "", sTargetState, 0, "from", true);

Parameters:

  1. context - The matrix context object.
  2. objectId - The object to float relationships to.
  3. relPattern - The relationships to expand.
  4. expandDir - The direction to expand. This can be “from” or “to”. Anything else will expand in both directions.
  5. policyStateMap - A map from policy names to a list of the editable states in that policy.
    Throws:
    java.lang.Exception - if float failed.

connected

1
2
3
4
5
6
7
public static void connected(matrix.db.Context context,
java.lang.Object objectId,
java.lang.String relPattern,
java.lang.String typePattern,
java.lang.String expandDir,
java.lang.String floatExpression)
throws java.lang.Exception