Perforce Helix Core cancel commit inside trigger - perforce

I'm trying to check some file conditions inside change-content trigger and cancel the submit based on that condition.
If my trigger fails the operation is still submited to the server. How can I prevent submit?
Any help is much appreciated!
update:
I was using nodejs script as a trigger, exception is not enought to prevent a submit operation. There should be process.exit(1).

Your trigger needs to return a non-zero exit code in order to fail the calling operation.
Make sure that the trigger is blocking and returning its status code to the caller, rather than returning zero and forking so it can run asynchronously.
Note that triggers that run after the fact (like change-commit) can't block an operation, but change-content should be able to prevent a submit from finishing.

Related

Is there an better alternative to Condition statement to stop Logic App?

I currently have a Logic App that has an empty false path since the Logic App. The only reason I use a condition is because the LogicApp should stop when the condition is false. Is there a better alternative to stop a Logic App when a certain condition/statement is reached?
You can use Terminate action:
This action stops the run for a workflow instance, cancels any actions in progress, skips any remaining actions, and returns the specified status. For example, you can use the Terminate action when your logic app must exit completely from an error state. This action doesn't affect already completed actions and can't appear inside Foreach and Until loops, including sequential loops.
You can refer to my logic app:
This is my test result, it seems there is no problem:

Is there a way to get the status of a specific thread executed via PXLongOperation() outside of the current BLC?

I'm trying to create an INTransfer and release it after an INReceipt is made on the Release action within the Move page of the Manufacturing Module. I've been getting an error stating that no inventory is available, but it is not consistent. After doing some digging, I believe it is because the release of the receipt is not finished before I execute my call to INDocumentRelease.ReleaseDoc(). I found that if I add a thread sleep, it will execute no problem every time, but I don't want to force the user to wait X seconds every time they execute that release. Is there a way I can check if the release process thread is complete for the INReceipt and wait if it is not to execute my release?
The problems I am having is that I don't know if there is a way to grab the ID of the PXLongOperation thread that is executing the INReceipt release function. If there is, I know there is a way to execute a PXLongOperation.WaitCompletion() function I can execute. I believe I would execute that right before calling my PXLongOperation if I am able to get the threadID.
Consider usage of IPXCustomInfo. Here I've described how to react on clicking on Abort, but also you can consider how to add reaction on Completed and InProcess cases:
case PXLongRunStatus.Completed:
SomeReactionOnCompleted();
break;
case PXLongRunStatus.InProcess:
SomeReactionOnInProcess();
break;

Parse LocalDataStore queries give Warning: A long-running operation is being executed on the main thread

I'm developing an Objective C application using Parse. I understand why, when I make a Parse query to the server, that I would need to perform the query in background and run code in a completion handler / callback when that call has completed. And this is what I do when I initially launch the app and download some data tables.
However, I then pin all these Parse objects locally and subsequently make queries to this data using the LocalDataStore option. Do I still need to execute these calls in background? If I remove the background option with these calls, the code runs fine but I still get the warning in the console:
Warning: A long-running operation is being executed on the main thread.
Break on warnBlockingOperationOnMainThread() to debug.
If I'm performing local Parse queries can I treat this simply as a warning (and ignore it) or do I still need to treat these queries as operations that should be performed in a background thread ? Any advice would be appreciated. Thanks.

Cancel a scheduled task

I have a Windows Delphi application that receives events, on each of these events i'd like to run a task in a parallel way (so i can be ready for the following event). There is many way to do this through omnithread library's abstractions.
The issue is that part of my code needs to be executed immediately after the reception of the event (basically to "decode" the events params), and another part needs to be executed a few seconds after only under the condition of nothing new happend for the same context.
This behaviour should respond to "only store this new value if it last longer than 3000ms, otherwise just cancel it".
So what I need would be to "cancel" a running task (the one waiting 3000ms) if a new event arrives with the same context.
I cannot use a pipeline abstraction because when the first stage ends, it automatically fills the second stage queue without asking me if i want to cancel it or not.
Is that possible?
Thank you.
Sounds like you need a Dictionary<Context, Event> where the events also carry a "created" timestamp property, and a background tread which continuously checks if there are event entries in this dictionary with elapsed time > 3000ms.
Incoming events update the timestamp and event params, until the thread detects an entry which matches the condition and then extracts the entry from the dictionary.

How to specify dependency between multiple given, when or then in cucumber-jvm

I have a feature file which has multiple given when and then steps for ex
// File My.feature
Give doUserLogin
And changeUserPreference
When executeWhen1
And executeWhen2
Then executeThen1
And executeThen2
These are mapped to step definitions correctly, the problem i'm facing is that some are getting executed parallel for ex. in given, 'changeUserPreference' is happening before 'doUserLogin'. Similarly in Then part, 'executeThen2' is triggered before 'executeThen1' is fully completed.
How to specify the dependency between these statements.Is there any way i can say don't start execution of second statement(given, when or then) until first one is executed completely.
If your 'doUserLogin' step is exiting before the download completes, that would explain why the 'changeUserPreference' is starting up. This could happen, say, if you were connecting to an external system and initiating a download and then the api you are using is performing the download in another thread, then the main thread would continue on to the next step while the download is continuing in another thread.
My advice would be to execute this scenario in debug mode (assuming you are using an IDE that supports this) and see if your 'doUserLogin' step is finishing before the file download.

Resources