context.saveObject()

Which IIQ version are you inquiring about?

8.3p2

Share all details about your problem, including any error messages you may have received.

In a workflow, I have a rule where I am making changes to policy violation object. I am getting expected result with context.commitTransaction() only. Does this mean there is an implicit save happening within the workflow? Do I need to save the object if SailPoint changes internal behavior in future versions?

@Unique
Share your current code, just to make sure what exactly you are doing before commenting anything

@iamksatish

PolicyViolation p = context.getObjectById(PolicyViolation.Class,id);
p.setStatus(PolicyViolation.Status.Remediated);
p.setActive(false);

//context.saveObject(p); //is this necessary?
context.commitTransaction();
context.decache();

Hi @Unique,

I’ve noticed similar behavior in previous versions(8.2 where I used) when using workflows. In these cases, I don’t need to explicitly save the object; after setting the attributes, the commit transaction works as expected. However, when operating outside of a workflow, I need to save the object before committing. I will look into this further.

Thanks,
@SivaLankapalli

1 Like

@Unique
I would suggest to Save the object specifically, because some of the objects are saved directly internally as they are not really a direct object but still better to save

1 Like

Hi,
a commit will be called in some steps in the workflow. At the very least whenever the workflow is parked due to approval.
But its save to assume that at the very least when the workflow is finished a commit will be called.

In you case I would at least make sure to only decache the policyViolaition and not the whole session.

context.decache(p);

1 Like

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.