Attached is a test project.
MyBO has Field1, Field2, Field3 & Field4.
Create a new BO (Standard->New Object)
If you update Field1 with some text and move focus it updates Field2 AND runs process called Proc1 which updates Field4. This works as expected.
Clear Field4 and click the button. It runs Proc1 but nothing gets updated.
EDIT -
ok the BO is definitely not being passed to the context engine when I click the button. I tested this by adding an IF clause into the Proc1 which checked the value of Field3. When the WAS CHANGED rule fires, the value was there, when I click the button the Field3 us <UNDEFINED>. This is my issue I think. So the question becomes, how do I pass the BO from the HTMLbutton? I'm further guessing that this might be a better thing to call :
startProcess2(processName, ctxObjectName, ctxObjectId, renderOption)
but how to get the current object ID as a parameter here?
EDIT 2 -
if I set the SaveFlag to "true" (where the manual says it will then pass this BO to the Proc) it refreshes the form and loses all the data. The BO is persistent.
EDIT 3 -
Looks like what I'm seeing is related to, if not quite the same, as this :
https://forum.awareim.com/d/8934/4&hilit=get+object+id+in+html#p39668
Here's the logfile data :
Update Field1
2016-11-29 04:06:20,959 ACTION_EXECUTION ButtonProcTest#admin -31 Started re-calculating business object MyBO
2016-11-29 04:06:20,959 RULE_EVALUATION ButtonProcTest#admin -29 Started evaluation of rules
2016-11-29 04:06:20,959 RULE_EVALUATION ButtonProcTest#admin -22 Evaluating rule 'F1Rule' If MyBO.Field1 WAS CHANGED Then MyBO.Field2='F1 Was Changed' Proc1
2016-11-29 04:06:20,960 RULE_EVALUATION ButtonProcTest#admin -6 Evaluating condition MyBO.Field1 WAS CHANGED
2016-11-29 04:06:20,960 RULE_EVALUATION ButtonProcTest#admin -8 Condition evaluated to true: Yes
2016-11-29 04:06:20,960 RULE_EVALUATION ButtonProcTest#admin -2 Adding action MyBO.Field2='F1 Was Changed' to the agenda
2016-11-29 04:06:20,960 RULE_EVALUATION ButtonProcTest#admin -2 Adding action Proc1 to the agenda
2016-11-29 04:06:20,960 RULE_EVALUATION ButtonProcTest#admin -16 Finished rule evaluation
2016-11-29 04:06:20,960 RULE_EVALUATION ButtonProcTest#admin -16 Finished evaluation of rules
2016-11-29 04:06:20,960 ACTION_EXECUTION ButtonProcTest#admin -15 Executing action MyBO.Field2='F1 Was Changed' from rules of object MyBO
2016-11-29 04:06:20,960 ACTION_EXECUTION ButtonProcTest#admin -4 Field2=F1 Was Changed
2016-11-29 04:06:20,960 ACTION_EXECUTION ButtonProcTest#admin -16 Finished executing action MyBO.Field2='F1 Was Changed' from rules of object MyBO
2016-11-29 04:06:20,960 ACTION_EXECUTION ButtonProcTest#admin -15 Executing action Proc1 from rules of object MyBO
2016-11-29 04:06:20,960 GENERIC ButtonProcTest#admin -17
2016-11-29 04:06:20,960 GENERIC ButtonProcTest#admin -17
2016-11-29 04:06:20,960 GENERIC ButtonProcTest#admin -20 Executing process Proc1 with parameters: MyBO:-1
2016-11-29 04:06:20,961 RULE_EVALUATION ButtonProcTest#admin -29 Started evaluation of rules
2016-11-29 04:06:20,961 RULE_EVALUATION ButtonProcTest#admin -22 Evaluating rule 'Proc1Rule' MyBO.Field4='Button Clicked'
2016-11-29 04:06:20,961 RULE_EVALUATION ButtonProcTest#admin -2 Adding action MyBO.Field4='Button Clicked' to the agenda
2016-11-29 04:06:20,961 RULE_EVALUATION ButtonProcTest#admin -16 Finished rule evaluation
2016-11-29 04:06:20,961 RULE_EVALUATION ButtonProcTest#admin -16 Finished evaluation of rules
2016-11-29 04:06:20,961 ACTION_EXECUTION ButtonProcTest#admin -15 Executing action MyBO.Field4='Button Clicked'
2016-11-29 04:06:20,961 ACTION_EXECUTION ButtonProcTest#admin -4 Field4=Button Clicked
2016-11-29 04:06:20,961 ACTION_EXECUTION ButtonProcTest#admin -16 Finished executing action MyBO.Field4='Button Clicked'
2016-11-29 04:06:20,961 GENERIC ButtonProcTest#admin -16 Finished executing process Proc1
2016-11-29 04:06:20,961 GENERIC ButtonProcTest#admin -17
2016-11-29 04:06:20,961 GENERIC ButtonProcTest#admin -17
2016-11-29 04:06:20,961 ACTION_EXECUTION ButtonProcTest#admin -16 Finished executing action Proc1 from rules of object MyBO
2016-11-29 04:06:20,961 RULE_EVALUATION ButtonProcTest#admin -25 Started evaluation of rules after data has been changed by the actions
2016-11-29 04:06:20,961 RULE_EVALUATION ButtonProcTest#admin -6 Checking rule F1Rule
2016-11-29 04:06:20,961 RULE_EVALUATION ButtonProcTest#admin -16 Finished evaluation of rules after data has been changed by the actions
2016-11-29 04:06:20,961 ACTION_EXECUTION ButtonProcTest#admin -16 Finished re-calculating business object MyBO
Click Button
2016-11-29 04:06:43,142 GENERIC ButtonProcTest#admin -17
2016-11-29 04:06:43,142 GENERIC ButtonProcTest#admin -17
2016-11-29 04:06:43,142 GENERIC ButtonProcTest#admin -20 Executing process Proc1 with parameters: MyBO:-1
2016-11-29 04:06:43,142 RULE_EVALUATION ButtonProcTest#admin -29 Started evaluation of rules
2016-11-29 04:06:43,142 RULE_EVALUATION ButtonProcTest#admin -22 Evaluating rule 'Proc1Rule' MyBO.Field4='Button Clicked'
2016-11-29 04:06:43,142 RULE_EVALUATION ButtonProcTest#admin -2 Adding action MyBO.Field4='Button Clicked' to the agenda
2016-11-29 04:06:43,142 RULE_EVALUATION ButtonProcTest#admin -16 Finished rule evaluation
2016-11-29 04:06:43,142 RULE_EVALUATION ButtonProcTest#admin -16 Finished evaluation of rules
2016-11-29 04:06:43,142 ACTION_EXECUTION ButtonProcTest#admin -15 Executing action MyBO.Field4='Button Clicked'
2016-11-29 04:06:43,142 ACTION_EXECUTION ButtonProcTest#admin -4 Field4=Button Clicked
2016-11-29 04:06:43,142 ACTION_EXECUTION ButtonProcTest#admin -16 Finished executing action MyBO.Field4='Button Clicked'
2016-11-29 04:06:43,142 GENERIC ButtonProcTest#admin -16 Finished executing process Proc1
2016-11-29 04:06:43,142 GENERIC ButtonProcTest#admin -17
2016-11-29 04:06:43,142 GENERIC ButtonProcTest#admin -17
EDIT - log showing the BO as undefined :
2016-11-29 04:37:32,116 GENERIC ButtonProcTest#admin -17
2016-11-29 04:37:32,116 GENERIC ButtonProcTest#admin -17
2016-11-29 04:37:32,116 GENERIC ButtonProcTest#admin -20 Executing process Proc1 with parameters: MyBO:-1
2016-11-29 04:37:32,117 RULE_EVALUATION ButtonProcTest#admin -29 Started evaluation of rules
2016-11-29 04:37:32,117 RULE_EVALUATION ButtonProcTest#admin -22 Evaluating rule 'Proc1Rule' If MyBO.Field3='hi' Then MyBO.Field4='Button Clicked'
2016-11-29 04:37:32,117 RULE_EVALUATION ButtonProcTest#admin -6 Evaluating condition MyBO.Field3='hi'
2016-11-29 04:37:32,117 RULE_EVALUATION ButtonProcTest#admin -7 Condition evaluated to false: <UNDEFINED>=hi
2016-11-29 04:37:32,117 RULE_EVALUATION ButtonProcTest#admin -16 Finished rule evaluation
2016-11-29 04:37:32,117 RULE_EVALUATION ButtonProcTest#admin -16 Finished evaluation of rules
2016-11-29 04:37:32,117 GENERIC ButtonProcTest#admin -16 Finished executing process Proc1
2016-11-29 04:37:32,117 GENERIC ButtonProcTest#admin -17
2016-11-29 04:37:32,117 GENERIC ButtonProcTest#admin -17