Can someone throw in their idea on how we can debug the javascript that we write from the bulk action script from ACCE? I understand that the alert or debug statement may not work there. What are the other options we have?
What I do is write the script in java.
The imports are almost the same. Variables need to be redeclared as var instead of String etc. Everything else is pretty much the same.
Some things you might want to note: You might need to call refresh right away on ceobject. You will probably want to set up a java class with a method that brings in ceobject just like the JavaScript does.
IBM provides a JavaScript example of Setting document properties. There are other examples on the same page that demonstrate the use of Java api from within ACCE JavaScript.
This is a particularly good example as it shows one of the most common uses of the Bulk Update functionality:
importClass(Packages.com.filenet.api.property.Properties);
importClass(Packages.com.filenet.api.constants.RefreshMode);
function OnCustomProcess (CEObject)
{
CEObject.refresh();
CEObject.getProperties().putValue("DocumentTitle", "Test1");
CEObject.save(RefreshMode.REFRESH);
}
The exact same code written in Java:
import com.filenet.api.property.Properties;
import com.filenet.api.constants.RefreshMode;
import com.filenet.api.core.Document;
public class Java2JavaScript {
public void OnCustomProcess (Document CEObject)
{
CEObject.refresh();
CEObject.getProperties().putValue("DocumentTitle", "Test1");
CEObject.save(RefreshMode.REFRESH);
}
The following differences can be noted:
import com.filenet.api.core.Document; however other types of CEObject can be used instead of Document.If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With