How do you update a locked record in Documentum using DQL? - documentum

I'm unable to update the record with DQL due to a lock. Is it possible to unlock the record, update it and lock it again?
I'm running the following code in idql64.exe on the content server.
UPDATE dm_document objects SET keywords = 'D' WHERE r_object_id = '90000000000000001'
GO
Error message:
[DM_SYSOBJECT_E_LOCKED]error:
"The operation on sysobject was unsuccessful because it is locked by user

You have to either unlock it by API, user interface or reset the attributes r_lock_owner and r_lock_machine. I would prefer using API or user interface. API command is
unlock,c,{object id}
and it can be easily scripted.
The issue is caused by a checkout - the user which is stated in the property above.
dqMan from FME is your friend!
Br, Henning

Yes, you need to be a member of dm_escalated_allow_save_on_lock group, in this case Documentum will do everything automatically.

I was able to achieve this by updating the r_immutable_flag column.
UPDATE dm_document(all) objects SET r_immutable_flag = 0 WHERE r_object_id = '90000000000000001'
GO
UPDATE dm_document(all) objects SET keywords = 'D' WHERE r_object_id = '90000000000000001'
GO
UPDATE dm_document(all) objects SET r_immutable_flag = 1 WHERE r_object_id = '90000000000000001'
GO

Related

Polarion API: How to update multiple work items in the same action

I created a script which updates work items in a polarion document. However, right now each workitem update is a single save. But my script updates all work items in the document, which results in a large number of save actions in the api and thus a large set of clutter in the history.
If you edit a polarion document yourself, it will update all workitems.
Is it possible to do this same thing with the polarion API?
I tried
Using the tracker service to update work items. This only allows a single work item to be updated.
Using the web development tools to try and get information from the API. This seems to use a UniversalService for which no documentation is available at the API site https://almdemo.polarion.com/polarion/sdk/index.html
Update 1:
I am using the python polarion package to update the workitems.Python polarion Based on the answer by #boaz I tried the following code:
project = client.getProject(project_name)
doc = project.getDocument(document_location)
workitems = doc.getWorkitems()
session_service = client.getService("Session")
tracker_service = client.getService("Tracker")
session_service.beginTransaction()
for workitem in workitems:
workitem.description = workitem._polarion.TextType(
content=str(datetime.datetime.now()), type='text/html', contentLossy=False)
update_list = {
"uri": workitem.uri,
"description": workitem.description
}
tracker_service.updateWorkItem(update_list)
session_service.endTransaction(False)
The login step that #boaz indicated is done in the backend (See: https://github.com/jesper-raemaekers/python-polarion/blob/3e61527cf0f1f3c8614a30289a0a3409d2d8712d/polarion/polarion.py#L103)
However, this gives the following Java exception:
java.lang.RuntimeException: java.lang.NullPointerException
Update 2
There seems to be an issue with the session. If I call the following code:
session_service.logIn(user, password)
print(session_service.hasSubject())
it prints False.
The same thing happens when using the transaction:
session_service.beginTransaction()
print(session_service.transactionExists())
also prints False
Try wrapping your changes in a SessionWebService transaction, see JavaDoc:
sessionService = factory.getSessionService();
sessionService.logIn(prop.getProperty("user"),
prop.getProperty("passwd"));
sessionService.beginTransaction();
// ...
// your changes
// ...
sessionService.endTransaction(false);
sessionService.endSession();
As shown in the example in Polarion/polarion/SDK/examples/com.polarion.example.importer.
This will commit all your changes in one single SVN commit.

How to add a whole package to transport request by code?

My task is to do all these steps programmatically:
Create a new transport request, I managed to do this with TR_INSERT_REQUEST_WITH_TASKS
Add package content to the newly created transport, this is the part I am stuck in.
Release the transport, I managed to do this with TR_RELEASE_REQUEST
My problem is that I can manually add the package to the transport request via transaction SE03 and then release it with FM TR_RELEASE_REQUEST, but that is not the goal, everything from step 1 to 3 has to happen in one program execution if anyone can guide me how to do step 2 it would be very helpful, thanks in advance.
In your program, you must :
First get the list of objects which belong to the package, via the table TADIR (object in columns PGMID, OBJECT, OBJ_NAME, and package in column DEVCLASS)
And add these objects to the task or transport request via the non-released function modules TRINT_APPEND_COMM or TR_APPEND_TO_COMM_OBJS_KEYS.
To add the whole project into request you must first select all the objects from package and add them one by one. You can do it like this:
DATA: l_trkorr TYPE trkorr,
l_package TYPE devclass VALUE 'ZPACKAGE'.
cl_pak_package_queries=>get_all_subpackages( EXPORTING im_package = l_package
IMPORTING et_subpackages = DATA(lt_descendant) ).
INSERT VALUE cl_pak_package_queries=>ty_subpackage_info( package = l_package ) INTO TABLE lt_descendant.
SELECT pgmid, object, obj_name FROM tadir
INTO TABLE #DATA(lt_segw_objects)
FOR ALL ENTRIES IN #lt_descendant
WHERE devclass = #lt_descendant-package.
DATA(instance) = cl_adt_cts_management=>create_instance( ).
LOOP AT lt_segw_objects ASSIGNING FIELD-SYMBOL(<fs_obj>).
TRY.
instance->insert_objects_in_wb_request( EXPORTING pgmid = <fs_obj>-pgmid
object = <fs_obj>-object
obj_name = CONV trobj_name( <fs_obj>-obj_name )
IMPORTING result = DATA(result)
request = DATA(request)
CHANGING trkorr = l_trkorr ).
CATCH cx_adt_cts_insert_error.
ENDTRY.
ENDLOOP.
Note, that you cannot add objects that are already locked in another request, it will give you cx_adt_cts_insert_error exception. There is no way to unlock objects programmatically, only via SE03 tool.
You can check code behind, Write Transport Entry in SE80 right click on package menu.

Maximo 7.6 Intergration Automation Script

I'm trying to create an Intergration Automation Script for a PUBLISHED Channel which updates a database field.
Basically for WOACTIVITY I just want a field value setting to 1 for the Work Order if the PUBLISHED channel is triggered.
Any ideas or example scripts that anyone has or can help with please? Just can't get it work.
What about using a SET processing rule on the publish channel? Processing rules are evaluated every time the channel is activated, and a SET action will let you set an attribute for the parent object to a specified value. You can read more about processing rules here.
Adding a new answer because experience, in case it helps anyone.
If you create an automation script for integration against a Publish Channel and then select External Exit or User Exit there's an implicit variable irData that has access to the MBO being worked on. You can then use that MBO as you would in any other script. Note that because you're changing a record that's integrated you'll probably want a skip rule in your publish channel that skips records with your value set or you may run into an infinite publish --> update --> publish loop.
woMbo = irData.getCurrentMbo()
woMboSet = woMbo.getThisMboSet()
woMbo.setValue("FIELD", 1)
woMboSet.save()

Configuration of custom database with openfire

I am using the openfire 3.7.1. I have followed this steps to configure the custom database in openfire. The main problem is that if i set the property
provider.user.className = org.jivesoftware.openfire.user.DefaultUserProvider
then I can login from admin portal but if i set the property like
provider.user.className = org.jivesoftware.openfire.user.JDBCUserProvider
then I can't be able to login with admin. So how do i set that jdbc user property ?
I am facing same problem by setting this property:
provider.auth.className = org.jivesoftware.openfire.auth.JDBCAuthProvider
You can change the property by changing the database table "ofProperty" where you can insert or change your property.
Here is the Query to change your property
update ofProperty set propValue
='org.jivesoftware.openfire.auth.JDBCAuthProvider' where name = 'provider.auth.className';
Please restart openfire after change.

Oracle global_names DELETE problem

I'm using a database link to execute a DELETE statement on another DB, but the DB link name doesn't conform to global naming, and this requirement cannot change.
Also I have global_names set to false, and cannot be changed either.
When I try to use these links however, I receive:
ORA-02069: - global_names parameter must be set to TRUE for this operation
Cause: A remote mapping of the statement is required but cannot be achieved because
GLOBAL_NAMES should be set to TRUE for it to be achieved. -
Action: Issue `ALTER SESSION SET GLOBAL_NAMES = TRUE` (if possible)
What is the alternative action when setting global_names=true is not possible?
Cheers,
Jean
That parameter can be set at the session level. Could you not set the GLOBAL_NAMES value equal to TRUE in your session, execute your delete, then set if back to FALSE? If not could you create a new connections just for this delete and update the GLOBAL_NAMES value in that session to be true?
The problem is that the GLOBAL_NAMES parameter is set to TRUE in your environment. That requires that the DB link have the same name as the GLOBAL_NAME of the remote DB.
Here's a link which describes the situation more fully.