So if I understand correctly, you have the following flow:
1) The value of the variable is retrieved with a REST API call in the Data elements of the first PX.
2) The variable is set to this value in Actions tab of the first PX
3) The value of the variable retrieved in the Data tab of the second PX
4) Perform additional business logic in PX2 using the value of the variable (could be REST API calls)
Let's forget about the looping issue for now. Assuming the above is the flow, the question then what happens if the value retrieved in step 1 is null? Will it have an impact on step 4?
If the additional business process in step 4 is perfectly fine with a null value of the variable, then why not perform the following:
a) Test for null value in step 1,
b) If null then set the value in the Action tab of PX1 to the literal string NULL.
c) Retrieve variable in PX2 (this is step 3 above), and test for string value "NULL" (additional data handling logic to step 3 above)
d) If string compare matches "NULL", set the value to null (real null) and execute your business logic (step 4)
Let us know if this helps, otherwise I'm afraid we will need more information about what you're doing exactly. You can open a support case, and we can move this discussion there if there is concern about sharing additional information.
Thanks!
Original Message:
Sent: 07-07-2020 03:18 PM
From: Martin Cederbaum
Subject: Loop in Policy Xpress
Iyes,
I did what you asked me and effectively the loop didn't occur.
When I try to show it in the VST it appears empty and in the log it appears that it is a NULL value. So I guess that the policy fails because I want to set a NULL value on a PX Variable
To set the value of the variable, I do a get to a Webservice which, when answering me timeout, cannot set the value in the variable (NULL)
On the other hand, I tried to put a condition in the PX action rules to set the value of the variable as long as it has been possible to obtain a value but it's never executed.
Is there a way to avoid this problem or to resolve the NULL value?
Regards
Martin
Original Message:
Sent: 07-06-2020 07:44 PM
From: IYES DENDENI
Subject: Loop in Policy Xpress
As a test please try to set the variable to a constant value and then retrieve it in the next PX. If you don't get the looping error then, revert back to original and write message to VST with the value of the variable that you are setting.
thanks!
Original Message:
Sent: 07-06-2020 07:32 PM
From: Adam Moore
Subject: Loop in Policy Xpress
Looking back at your original message, it looks like the error is occurring trying to set the PX variable instead of during the get operation. I don't know enough about the Policies you have to provide meaningful input.
The best I can say is just generic suggestions, such as can the entry or action rules be adjusted to accommodate for the scenario you are attempting to test? Is it something like if "PX Variable" equals "", then redo current policy on the "Error Event"?
I'd definitely would be interested to see what you have if you could scrub any sensitive data from the .xml files for the policies in question.
Original Message:
Sent: 07-06-2020 02:54 PM
From: Martin Cederbaum
Subject: Loop in Policy Xpress
Adam,
the policies are of the same type. What's more, if I don't force the error to occur, the second policy correctly receives the data, so I don't think that's the problem
And you're right, Variable = PX Variable, sorry about that
Regards
Martin
Original Message:
Sent: 07-03-2020 05:01 PM
From: Adam Moore
Subject: Loop in Policy Xpress
This is just my best guess currently...
Possibly the variable is not available due to using different PX policy "TYPES". Maybe the variable is being set on an EVENT like, before AssignProvisiongRoleEvent and you are trying to get the variable with a TASK Failed type of PX Policy on a failure. Since the variable cannot be read, it causes a loop.
If I recall correctly, the PX variables can only be used within the same TYPE of PX Policy.
I could be way off base, when you say variable, I'm assuming PX variable.
Original Message:
Sent: 07-03-2020 04:31 PM
From: Martin Cederbaum
Subject: Loop in Policy Xpress
Adam,
thanks for answering
Let me explain a little more what was done:
1) A first policy calls a WebService to obtain X data (to replacate the loop I forced a connection error timeout to happen). This policy runs when an Error in the AssignProvisioningRole happens.
2) This first policy (Action Rules) sets the value of X in a variable that is used by a second policy and sends X to a second WebService
3) The second policy gets the value of the variable from the first policy and sends an email if the value could be obtained or not.
4) When you see the log, you could see
Regards
Martin
Original Message:
Sent: 07-03-2020 03:08 PM
From: Adam Moore
Subject: Loop in Policy Xpress
It's difficult to determine what is causing the loop without a better description of the PX Policy or Policies that are triggering the loop.
If I have specifically configured a PX Policy that has the potential to loop, I'll use a variable or logical attribute as a "counter" to run it a maximum number of times. If that's not possible, I'd try to solve the problem so that the condition creating the loop is not possible.
Example 1. We had a case where we were trying to assign a RSA SecurID token, but wanted to execute an external script to perform a single explore/correlate for the user if the tool was not aware of the endpoint account. In this scenario, I'd put a counter in place to run the policy I set number of times when using a "redo policy" type of action.
Example 2. We once hit a loop because we had a PX Policy that would write information to a logical attribute and send a message to a staging table via stored procedure. I also had another PX Policy that would run on an error to update the staging table with a message of why the task failed. The first PX was attempting to call a stored procedure and sending a "dumb apostrophe" in the message to the staging table. This would create an error trying to insert the data to the table, then attempt to retry over and on the failed event policy. In this scenario we ensured no "dumb apostrophes" in messages written that were going to the staging table. If I could not control the data, I'd perform a check and replace "dumb apostrophes" with "closing apostrophes" before sending the data to a staging table.
Original Message:
Sent: 07-02-2020 04:49 PM
From: Martin Cederbaum
Subject: Loop in Policy Xpress
Hi,
I have the following issue:
I created a policy that runs on "Event Error".
When this policy is executed and an environment error happens, it starts executing indefinitely. The policy has been configured to ignore environment errors but the error still persists. I would like to know if there is any way to solve this problem.
Log Message:
ERROR [ims.tmt.IMSMessageListener] (Thread-45988 (HornetQ-client-global-threads-1380903202)) Exception occured during event processing: EventExecuteStateException: An error occurred while executing AssignProvisioningRoleEvent.
ERROR MESSAGE:
PxSystemException: A loop has been detected in the evaluation of data elements. Canceling ...
An error occurred while performing the action type Action.name.set.string.variable
An error occurred while executing the workflow Set Variable. Stopping event.
at com.ca.identitymanager.policyxpress.listeners.PxStateListener.execute(PxStateListener.java:152) [identitymanager.jar:]
Thanks in advance
Regards
Martin