GetRelatedTerms委托
的GetRelatedTerms委托检索所有目标项id与当前业务项来源与关系类型相匹配给定的(合作)的作用。假定业务项是一个资产,不要使用与其他业务项目委托类型。
字段名 | 强制性的 | 描述 |
---|---|---|
termId | N | ID的术语是参与的关系。如果不提供,将使用当前的业务项目。确保它是一个资产。不要使用与其他业务项目委托类型。 |
方向 | N | 方向关系这个词,设置对源和假目标。错误的默认情况下——如果不是集。 |
relationTypeId | Y | ID类型的关系。 |
resultVariableName | N | 变量的名称,结果将被设置。如果没有提供,结果将被设置在变量命名输出。 |
委托是弃用。取代你的服务任务与一个脚本包含这个委托任务,例如:
< scriptTask id = " scripttask1 " name = "得到相关术语" scriptFormat =“groovy”activiti: autoStoreVariables =“false”> <脚本> < ![CDATA[进口com.collib新万博移动客户端ra.dgc.core.api.model.meta.type.RelationType;进口com.colli新万博移动客户端bra.dgc.core.api.dto.meta.relationtype.FindRelationTypesRequest;进口com.colli新万博移动客户端bra.dgc.core.api.model.instance.Relation;进口com.colli新万博移动客户端bra.dgc.core.api.dto.instance.relation.FindRelationsRequest;进口com.colli新万博移动客户端bra.dgc.core.api.model.reference.NamedResourceReference;进口com.colli新万博移动客户端bra.dgc.workflow.api.exception.WorkflowException;List < RelationType relationTypes = relationTypeApi.findRelationTypes (FindRelationTypesRequest.builder () .role(“集团”).build ()) .getResults()如果(relationTypes.isEmpty()){抛出新的WorkflowException(“没有关系类型提供角色组”);}< UUID >列表relatedAssetIds = new ArrayList < > ();(RelationType RelationType: relationTypes){列表> <关系关系= relationApi.findRelations (FindRelationsRequest.builder () .sourceId (item.id) .relationTypeId (relationType.getId ()) .build ()) .getResults ();(关系关系:关系){relatedAssetIds.add (relation.getTarget () .getId ()); } } execution.setVariable("relations", relatedAssetIds); ]]>