Skip to main content

File Service Broker v2.0

 

 

 

 

This custom service broker allows the user to perform the following functions based on a full file path

 

 

  •  
  • Read from a file
  • Write a file to a folder location
  • Delete a file
  • Get a list of full path files names from a directory
  • Get a list of full path sub-directory names from a directory

     

 

 

This custom service broker is based on the original File Service Broker v1 written by Johnny Fang,

 

 

 

 

However, Please note that the two versions and function set are not compatible.

 

 

 

 

I am using the Delete method.  In IE and Edge, the file is still showing up in Windows Explorer until I close the browser window.  In Chrome the file is removed from Windows Explorer as soon as the Delete method is executed.

 

Does anyone have any insight on this?


anyone know if it possible to use the file service create to make a zip file of multiple files?


@JamesKho 

 


Hi,

I need a little help. After moving our blackpearl server i get error "SmartObject Server Exception: Could not load file or assembly 'file:///E:Program Files..." and here it points to old .dll location. Now it should point to 'file:///D:Program Files...' Is there any way to change location of this .dll in smartobject service tester at any other place?

Edit: 

I just found out that there is newer version of this service broker, how can i start using it? Do I need to add it as new service broker on my server and change all forms that are using older version to new one or is there more automatic solution especially after error with old broker that i described above?

 


Hmm can you help check the following?

1. Is the File Server broker dll found in the new directory? 

2. Can you try refreshing or re-registering the Server Broker? Re-registering may need to update the smartobjects though.

 

The new version just includes 2 new methods for workflow looping scenarios. If you are not using workflow looping it is ok not to upgrade.

 

 

 


Thank for so quick response.

1. Yes, I've copied .dll into new directory

2. What do you mean by re-registering? And how is it done? Do i need to reconfigure already existing forms after that?

Till now i only found out that i can change path to dll in BrokerManagement but it doesn't help.

 

EDIT:

After service K2 server restarted - it started to work correctly, so what i needed to do was:

1. correct path in BrokerManagement (...K2 blackpearlServiceBroker) 

2. restart just k2 server service - not whole server

Hope it will help someone in need

 


Great to hear that. I had actually assumed you restarted the service already since it was a migration. Thanks for sharing.


It did, but after migration path to this service broker did not change automatically. When i changed path to .dll manually later i had to once again restart k2 server service for that change to work.


Hello All,

We currently have the version 1 of this file service dll working on our environment, with a lot of processes running on it.

Of recent, I added the new version to our environment. What I discovered was that, the version stopped working.

while trying to refresh the service instance, there was an error saying:

"SmartObject Server Exception: API restriction: The assembly 'file:///C:Program Files (x86)K2 blackPearlServiceBrokerSourceCode.SmartObjects.Services.FileService.dll' has already loaded from a different location. It cannot be loaded from a new location within the same appdomain."

Can someone help with this, as we have a lot of processes running on the Version 1 and it will be a lot of working moving each processes to version 2.

 

Regards all,


Hello All,

We currently have the version 1 of this file service dll working on our environment, with a lot of processes running on it.

Of recent, I added the new version to our environment. What I discovered was that, the version stopped working.

while trying to refresh the service instance, there was an error saying:

"SmartObject Server Exception: API restriction: The assembly 'file:///C:Program Files (x86)K2 blackPearlServiceBrokerSourceCode.SmartObjects.Services.FileService.dll' has already loaded from a different location. It cannot be loaded from a new location within the same appdomain."

Can someone help with this, as we have a lot of processes running on the Version 1 and it will be a lot of working moving each processes to version 2.

 

Regards all,


Hi kolade,

 

  With regards to version 1, are you referring to this?

https://community.k2.com/t5/K2-blackpearl/File-Service-Broker/ba-p/65536

 

Please note that version 1 and version 2 are incompatible with each other, as they are designed differently.

If you are currently using version 1, please continue to use that version.

 


Hello JamesKho,

 

Thanks for the update.

 

My question really is that; Is it possible to have both Version1 and Version2 on the same environment without any conflict?

 

If my question from above is Yes, Then How can I achieve that.

 

Regards JamesKho


Hi kolade,

 

  Sorry for the late reply. I have not tried putting both version 1 and version 2 on the same server before, so I can't say for sure. As they both use the same code base, there could be conflicts when registering both versions with K2.

 

However, since the source code is included, I think it may be possible to modify the SystemName, GUID, Display Name and Namespace of the Fileservice broker in the source code and recompile, so that the modified version would different enough not to cause conflicts in the same K2 server.


Hi JamesKho,

 

Thanks for the response.

Myself and my colleagues have been able to work on the source code. 

We did modify the class name and also the namespace  for the Sourcecode.smartobject.fileservice.dll being reference. This way, we were able to see both the Old and the New dll being listed under the ServiceType list on the SmartObject tester.

We sure can upload that for folks who may be having the same issue, around working with the Old and the New one at the same time.

Many thanks.

 

Kind regards,

Kolade.

Lagos. Nigeria.

 


Where would you input the file location to be moved? I got the destination, but the initial file to be copied or moved always gives me an error when I put a file path or a unc path.

Hello ZackaryTee,

 

Apologies for the late response.

 

Which of the File Service method are you trying to work with?

 

If you are trying to call the 'Create' method, follow the steps below.

 

 Steps

=====

--> Define the Destination Path

             C:Folder1Folder2  ----- (If calling the service on same server)

             ComputerNameFolderFolder2  --- (If calling via a network)  Ensure that you include the Drive letter if you have more than one drive on the server.

--> Grant Full access to 'Everyone' on the destination folder

--> Ensure that, the folder has been 'Shared'. You can share the Folder, by Right Clicking the Folder, Select Properties, and then Share the Folder.

 

All the best ZacTee...


hi  kolade  And thank you for your reply. I think my issues is knowing where to put the file data or what to put in the 1st field "File Data (File) " is this a file location? or just a file name? if it is just a file name, where do I define the path so that the service knows where to go and pick it up? I created a file called test.txt in the service broker folder, c root drive and such, I tried to give the smart object a path, file name, and such but to no avail. I keep getting this error :

 


Hello ZackaryTee,

 

You are expeceted to click the "Add" button for the File Data, and attach a file.

 

The file Data is where you have to upload the file attachment. Just clicked the "Add" button to add file.

On a SmartForm, the File Data will be where you have to mapp the File Attachment you intended to create at the destination. (No need for typing the path).

 

 

Kind regards,


Thank you! that solved my issue.

Hello ,

I have using K2 5 onsite. I have copied "SourceCode.SmartObjects.Services.FileService.dll" to C:Program Files (x86)K2 blackpearlServiceBroker

what am i missing? Thanks...


Hi iscisse,

 

  The steps seem correct. Confirm that the ServiceBroker is the correct path being used? It may have been changed after the K2 Five Upgrade.


 


Hi, 

Did anyone tried this with K2 Five 5.3 or 5.4?

It works fine with K2 Five 5.2

 

 


Hi Wojciech,

 

  This works with K2 Five 5.3. I have yet to test it in K2 5.4


where i can download File Service Broker v2.0?


Reply