Groovy

[exception] groovy connector : script is null

Hello,

I'm using Bonita BPM Community Edition v.7.2.1

Development > Manage groovy scripts
I created groovy script named 'GetId'.
and the contents are as follows.

public def static hello()
{
    return 'hello'; 
}

And I made a service task and it has a connector. I used Groovy 2.4 connector.
and its scripts are just only GetId.hello();

Execute a stored procedure

Good Morning,

i need to execute a stored procedure that returns a row. The stored procedure requires one string parameter, and returns a row. Then, i want to save the values of the row (5 columns) in independent variables. What is the best way to do this?

I'm doing it in a groovy script but it is giving me the following error:

No suitable driver found for jdbc:sqlserver://hostSql;database=DBName.

I'm using this code in the groovy script:

`import groovy.sql.Sql;

Connector ReleaseTask not working. Please help!!

I need to release a task after the user decline for doing in two tasks (Task preview and Task register) what converges into a Service Task with this connector.
The "if" only is a filter who decline one of those tasks
userTaskId and userTaskId is the taskAssigneeId from "ProvidedVariables" each operation each Human task from diagram.

//Connector code
import org.bonitasoft.engine.api.ProcessAPI;

ProcessAPI processApi = apiAccessor.releaseUserTask();

Handle document list (delete / add) with 7.2

Hello

I have a process with a document list. The document list is created on the instantiaction form.

In one of the human tasks a user should be able to view / add / delete his documents. I first changed formInput to a Javascript expression to get the documents from the context (and other REST API variables):

return {
    "marchePublicRequestInput": $data.marchePublicRequest,
    "newStatus": "resend",
    "piecesJointesInput": $data.context.piecesJointes_ref
}

I also have an empty JSON object newDocuments

How can i retrieve the user id using Groovy Script?

Hi,
how i can to retrieve the user id using mysql query with groovy script into connector ,and save the result in a java.lang.long data type variable , because then i want to put this variable in a actor filter from Human Task, and assign this user to this Human Task.

Regards

Groovy script that count the number of lines in a files in my process

Hi everyone ,

im trying to count the number of lines in a document in my process . My script is :
//////////////////////////////////////////////////////////////////////////////////
def lines = 0
doc_Integrateur_Enseignes_CSV.eachLine {
lines++
}

////////////////////////////////////////////////////////////////////////////////

frederic.krebs's picture
frederic.krebs
Category: 

Created on Bonita BPM version : 6.3.3

Objectives: Execute an external groovy script

You can edit the script without recompiling neither redeploying the process on the server * Use as a form widget connector, it allows you to edit the script and refresh the screen to see the result * Use as a Form transiant data connector, it allows you to edit the script and refresh the screen to see the result * Use as an activity connector, it allows you to edit the script, restart a new process instance and see the changes

Groovy - Error while communicating with the engine.

Hi there,

I have a java program that works perfectly with postgres driver 9.2, and it also works in my groovy scripts except one.

Here is my code:

Basically I am trying to upload the document d1 to postgres as a byte[]. This works in java but I cannot get it to work in groovy, which it should.

Any ideas? Thanks in advance. Seán

Convert Double to String Groovy

Please i need your help, on a Groovy script i need to concat a Double value to an string as you can see on the next line of code:

Can someone explain the rational for New Groovy 1.8? ASync vs Sync

Hi there,

just looking at Bonita 6.4.0 and need to understand something.

1) Why are we still on Groovy 1.8 as Groovy 2.3 has been on General Release since May 2014?

2) What is Groovy 1.8 Depreciated in relation to Groovy 1.8? If no-one has seen this have a look at Connectors, Add A Connector->Script, there are two 1.8s.

3) How does the use of Groovy 1.8 affect transactions? It states:

Notifications