0

whenever I try to run this code, I'm getting below error.

ERROR c.c.d.r.v.w.WorkflowInstanceResource - Error in rest api call 'public javax.ws.rs.core.Response com.collibra.dgc.rest.v2_0.workflow.WorkflowInstanceResource.startWorkflowInstances(com.collibra.dgc.core.api.dto.workflow.StartWorkflowInstancesRequest)'. 
com.collibra.common.api.exception.ApiCollibraException: com.collibra.common.exception.CollibraException: workflowNotStarted.
Caused by: groovy.lang.MissingPropertyException: No such property: asset for class: Script266
at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.unwrap(ScriptBytecodeAdapter.java:65)
at org.codehaus.groovy.runtime.callsite.PogoGetPropertySite.getProperty(PogoGetPropertySite.java:51)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callGroovyObjectGetProperty(AbstractCallSite.java:341)
at Script266.run(Script266.groovy:13)

I'm using the below groovy script to get attribute types of any asset that I selected.

import com.collibra.dgc.core.api.component.assignment.AssignmentApi
import com.collibra.dgc.core.api.component.logger.LoggerApi
import com.collibra.dgc.core.api.model.assignment.AssignedAttributeType
import com.collibra.dgc.core.api.model.assignment.Assignment
import com.collibra.dgc.core.api.model.instance.Asset
import com.collibra.dgc.workflow.api.bean.WorkflowBusinessItem
import com.collibra.dgc.core.api.model.workflow.WorkflowBusinessItemType

LoggerApi loggerApi;
AssignmentApi assignmentApi;
Asset asset;

loggerApi.info("****Start Workflow*****");

List<Assignment> assignments = assignmentApi.getAssignmentsForAssetType(asset.getId());

loggerApi.info("assignments:::${assignments}");

for (Assignment assignment : assignments) {
    List<AssignedAttributeType> assignedAttribute = assignment.getAssignedAttributeTypes();
}

loggerApi.info("assignedAttribute:::${assignedAttribute}");

The expected result is to get all the attribute types present in the asset that I selected(any asset can be selected during the process)

0 Answers0