When will EndResumeBookmark return BookmarkResumptionResult.NotReady? - workflow-foundation-4

The method WorkflowInstanceProxy.EndResumeBookmark returns an enum BookmarkResumptionResult. When will this return NotReady? What I really want to know is how I can create a scenario so that this occurs, so that I can write tests to verify that my implementation of an extension is correct.

MSDN says(http://msdn.microsoft.com/en-us/library/system.activities.bookmarkresumptionresult.aspx):
NotReady: The bookmark resumption was not scheduled because the runtime has not yet created the bookmark. The host should wait until another idle point to try resumption again.
I saw it when you want to resume the bookmark and the workflow is not unloaded yet.
I hope this helps.

Related

ProgressNotification callback not triggered without an initial download in Realm 10

We are using MongoDB Realm in our app.
The first time the user is connected to the app, the ProgressNotifcation callback is triggered correctly, and it will work and trigger whenever a new download is coming.
Even if no download is pending, the ProgressNotification callback will be triggered (the Progress object pass in the callback will contain values from the last download) at least once(when creating it). I supposed this is due to the fact that we are downloading the first data set of the user.
But after killing the app and launching it again, the ProgressNotification callback is not triggered anymore until new data are received by the app. And from this point, the callback will be called every time we need it.
It seems that now, the framework needs a first download since the app is launch to make ProgressNotification callback to be triggered every time we need it.
This was working in the previous version of Realm (5.X.X). We just finished the migration to Realm 10 and discover this issue.
I am a bit stuck here, do not know if this is an intended change or a bug on my part. But I am pretty sure this was working in the previous version of the SDK.
Can anyone help me with this? Thanks
Note: this is no more working in both mode : .forCurrentlyOutstandingWork and .reportIndefinitely
Example
self.token = syncSession.addProgressNotification(for: .download, mode: .forCurrentlyOutstandingWork) { progress in
.......Some code........ <- this part of the code is not triggered anymore
}
EDIT - 21/12/2020
For clarification, the token returned contains a value and the .invalidate is not being called.
There is no error in the session and any new download is triggering the callback. After an initial download, everything works as expected. This means that when I add a progressNotifcation later on, the callback is triggered immediately with the progress of the previous download. But if there is not an initial download, the callback is never called.
For the scope, this method is actually in the custom publisher that I created and it is not deallocated.
Realm 10.5.0
iOS 14.3

How to get the user who initiated the process in IBM BPM 8.5?

How to get the user who initiated the process in IBM BPM 8.5. I want to reassign my task to the user who actually initiated the process. How it can be achieved in IBM BPM?
There are several ways to get that who initiated a Task , But who initiated a process Instance is somewhat different.
You can perform one out of the following :
Add a private variable and assign it tw.system.user_loginName at the POST of start. you can access that variable for user who initiated the process.(It will be null or undefined for the scenario if task is initiated by some REST API or UCA.)
Place a Tracking group after Start event . Add a input variable to it as username , assign it a value same as tw.system.user_loginName. So whenever Process is started entry will be inserted to DB Table.You can retrieve this value from that view in PerformanceDB.
Also there might be some table ,logging the process Instances details , where you can find the user_id directly.
I suggest you to look in getStarter() method of ProcessInstanceData API.
Official Documentation on API
This link on IBM Developerworks should help you too: Process Starter
Unfortunately there's not an Out Of The Box way to do this - nothing is recorded in the Process Instance that indicates "who" started a process. I presume this is because there are many ways to launch a process instance - from the Portal, via a Message Event, from an API call, etc.
Perhaps the best way to handle this is to add a required Input parameter to your BPD, and supply "who" started the process when you launch it. Unfortunately you can't supply any inputs from the OOTB Portal "New", but you can easilty build your own "launcher".
If you want to route the first task in process to the user that started the process the easiest approach is to simply put the start point in the lane, and on the activity select routing to "Last User In Lane". This will take care of the use case for you without requiring that you do the book keeping to track the user.
Its been a while since I've implemented this, so I can't remember if it will work elegantly if you have system steps before the first task, but this can easily be handled by moving the system steps into the human service to be executed as part of that call, rather than as a separate step in the BPD.
Define variable as string type and using script task to define the login user that use this task and assign it to your defined variable to keep to you in all of the process as initiator of the task.
You can use this line of code to achieve the same:
tw.system.user_loginName

Retail Transaction Service Cache

I wrote some methods in Class RetailTransactionServiceEx, called them from Application.TransactionService.InvokeExtension method at POS, then I needed to do some changes in one of my methods in RetailTransactionServiceEx, but changes did not reflect, then for troubleshooting purposes I renamed my method name, but POS through error method not exists in class, I generated Incremented CIL, Full CIL, restarted AOS service, restarted my POS but it still said method does not exists.
Then I went home, and came next day at work, I found my method is working from POS, so the question is that why did it took a whole night ? I did not shut down my computer. Is there any sort of cache system and how do we clear it for quick reflection of our changes in Transaction service classes.
You can reset IIS.
open windows power shell and execute "iisreset" command
It worked for me.
though i don't know what happened at night, you can check the event viewer.

can i get more granular ami events for app_fax?

When sending a fax using spandsp/asterisk/app_fax, it would really be nice to see more granular status events being fired.
Right now, it just looks like AMI events are fired when the call is started and when the call finishes. I'm looking to get more detailed info like "DIALING", "SENDING PAGE 1", etc.
Is there a way (either using the AMI or another method) to get this information?
I know it definitely exists somewhere, as I can see DEBUG statements with this information in the logs. I can't (and don't want to) parse the log files, as the DEBUG statements don't really say which call they relate to.
Thanks!
no
but nojee fax project did special patch for app_fax.c to give more verbosity.
probably u can create patch for app_fax.c to show needed info.

wf - passing an approval value to an activity

I have an Activity( waiting for an approval ) that contains a WhileActivity. In the while activity I want to read the value of an argument - if it returns true I execute I continue with workflow execution, otherwise I stop the hanging the executing till the argument value turns true
How can I do this - for a while or other activities - ?
Thank you
If the value you are waiting on is being changed by another activity you can use a TrackingParticipant to watch for the value changing and when that happens resume a bookmark to notify your waiting activity.
Sounds more like your requirements would be better served by a State Machine workflow.
Okay, so you don't want to use a State Machine workflow. So, here's how you do it.
You have to create a custom Activity that is used in conjunction with a Workflow Extension. An Extension is just an object that can be accessed by your Activities as the workflow executes and allows your Activities to communicate with the classes that are executing the workflow.
Your custom Activity must be able to create a Bookmark and offload the Workflow. It does this while you wait for the correct value from your Extension. You don't need to do this in any While Activity loop. You just do the following
Get your Extension
Get the current value you are evaluating on
If you aren't happy, create a bookmark
When the bookmark resumes, go to step 1.
If you are happy, continue execution.

Resources