SoftExpertAPI 1.1.11

There is a newer version of this package available.
See the version list below for details.
dotnet add package SoftExpertAPI --version 1.1.11
NuGet\Install-Package SoftExpertAPI -Version 1.1.11
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="SoftExpertAPI" Version="1.1.11" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add SoftExpertAPI --version 1.1.11
#r "nuget: SoftExpertAPI, 1.1.11"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install SoftExpertAPI as a Cake Addin
#addin nuget:?package=SoftExpertAPI&version=1.1.11

// Install SoftExpertAPI as a Cake Tool
#tool nuget:?package=SoftExpertAPI&version=1.1.11

SoftExpertAPI

SoftExpertAPI é uma biblioteca que possui um conjunto de classes para abstrair a comunicação SOAP ou REST com a API do SoftExpert SESuite.<br> Esta biblioteca não está completa e será desenvolvida conforme necessidades e pedidos. <br> Direitos reservados a https://www.softexpert.com/<br> <br> Documentação original: https://documentation.softexpert.com/en/integration/index.html <br> <br> Se você quer falar comigo, por qualquer proposito, me mande um email. hudsonventura@outlook.com

<br> <br>

Testado no SoftExpert 2.1.7.252 e Oracle

<br> Há exemplos funcionais no diretório Examples

Importação do namespace ...

using SoftExpert.Workflow;

<br> <br>

Criar uma instancia da API de workflow para uso SEM banco de dados

string authorization = "Basic base64encode(DOMINIO\USUARIO:SENHA)"; //deve ser codificado em base64
string url = "https://se.dominio.com.br";
SoftExpertWorkflowApi wfAPI = new SoftExpertWorkflowApi(url, authorization);

<br> <br>

Criar uma instancia da API de workflow para uso COM banco de dados

Necessário para as funções: listAttachmentFromInstance<br> Necessário a implementação de um banco de dados (IDatabase). Ver exemplo de implementação no arquivo Examples/ExampleOracleImplement.cs. Podem ser implementados outros bancos de dados, desde que estes implementem a interface IDatabase.

string authorization = "Basic base64encode(DOMINIO\USUARIO:SENHA)"; //deve ser codificado em base64
string url = "https://se.dominio.com.br";

ExampleOracleImplement oracle = new ExampleOracleImplement(appsettings);
SoftExpertWorkflowApi wfAPI = new SoftExpertWorkflowApi(url, authorization, db: oracle);

<br> <br>

Usando a API - Criando uma instancia de workflow

string ProcessID = "CCF";                       //identificador do processo
string WorkflowTitle = "Teste de integração"; ; //titulo da instancia a ser criado
string UserID = "00000000000";                  //matricula do usuario

newWorkflowResponse responseNewWF;
try
{
    responseNewWF = wfAPI.newWorkflow(ProcessID, WorkflowTitle, UserID);
}
catch (Exception erro)
{
    Console.WriteLine($"Não foi possivel criar o workflow. Erro: {erro.Message}");
    return;
}
string WorkflowID = responseNewWF.RecordID;
int codigoNewWorkFlow = responseNewWF.Code;
SoftExpert.SoftExpertResponse.STATUS sucessoNewWorkFlow = responseNewWF.Status;
string detalhesNewWorkflow = responseNewWF.Detail;

<br> <br>

Usando a API - Editando dados do formulário

Dictionary<string, string> formulario = new Dictionary<string, string>();
formulario.Add("possuiendereco", "1"); //id do campo do formulário e valor (em string)
formulario.Add("ramal", "N/A");

Dictionary<string, Dictionary<string, string>> relacionamentos = new Dictionary<string, Dictionary<string, string>>();
relacionamentos.Add("tipocliente", //idrelacionamento
    new Dictionary<string, string>() {
            //{ "campodoformdorelacionamento", "valor" },
            { "tipo", "PESSOA JURIDICA (CNPJ)" },
    }
);

string EntityID = "SOLCLIENTEFORNE";

//em caso de adicionar arquivos no formulário
string filePath = "120.png";
string FileName = "logo.png";                       //Nome do arquivo com a extensão
byte[] FileContent = File.ReadAllBytes(filePath);   //Binário do arquivo
Dictionary<string, Anexo> arquivos = new Dictionary<string, Anexo>();
arquivos.Add("al5termoassinad", new Anexo() { FileName = FileName, Content = FileContent });


editEntityRecordResponse entityResponse;
try
{
    entityResponse = wfAPI.editEntityRecord(
        WorkflowID, EntityID, formulario, //campos obrigatórios
        relacionamentos, arquivos); //campos opcionais
}
catch (Exception erro)
{
    Console.WriteLine($"Não foi possivel editar o formulário. Erro: {erro.Message}");
    return;
}
int sucessoEntity = entityResponse.Code;
string detalhesEntity = entityResponse.Detail;

<br> <br>

Usando a API - Editando dados da grid do formulário

//Os campos são os mesmo da função editEntityRecord, adicionando o `ChildRelationshipID` que é o ID do relacionamento


newChildEntityRecordResponse entityResponse;
try
{
    entityResponse = wfAPI.newChildEntityRecord(WorkflowID, EntityID, ChildRelationshipID,  formulario, //campos obrigatórios
                                                                            relacionamentos, arquivos); //campos opcionais
}
catch (Exception erro)
{
    Console.WriteLine($"Não foi possivel editar o formulário. Erro: {erro.Message}");
    return;
}
int sucessoEntity = entityResponse.Code;
string detalhesEntity = entityResponse.Detail;

<br> <br>

Usando a API - Execução de atividade

string ActivityID = "ATIV-SOLCCF";      //ID da atividade do fluxograma
int ActionSequence = 3;                 //Sequence da ação da atividade. Veja na lista de ações da atividade

executeActivityResponse executeResponse;
try
{
    executeResponse = wfAPI.executeActivity(WorkflowID, ActivityID, ActionSequence, UserID);
}
catch (Exception erro)
{
    Console.WriteLine($"Não foi possivel executar a atividade. Erro: {erro.Message}");
    return;
}
var houveSucesso = executeResponse.Code;
var detalhes = executeResponse.Detail;

<br> <br>

Usando a API - Anexar arquivo (menu do lado esquerdo de uma instancia)

string filePath = "120.png";                                           
byte[] FileContent = File.ReadAllBytes(filePath);   //Binário do arquivo
string ActivityID = "ATIV-SOLCCF";                  //ID da atividade em que o arquivo será anexado
string WorkflowID = "CCF202323106";                 //ID da instancia
Anexo Arquivo = new Anexo() {                       //pode-se passar também uma List<Anexo>
    FileName = "logo.png",                          //Nome do arquivo com a extensão
    Content = FileContent                           //Binário do arquivo
};

newAttachmentResponse newAttachment;
try
{
    newAttachment = wfAPI.newAttachment(WorkflowID, ActivityID, Arquivo);
}
catch (Exception erro)
{
    Console.WriteLine($"Não foi possivel anexar o arquivo a instancia de Workflow. Erro: {erro.Message}");
    return;
}

<br> <br>

Usando a API - Listar arquivos (menu do lado esquerdo de uma instancia)

Necessário a implementação de um banco de dados.

string WorkflowID = "TESTE2023000001";                                           
List<Anexo> anexos;
try
{
    anexos =  wfAPI.listAttachmentFromInstance(WorkflowID);
}
catch (Exception erro)
{
    Console.WriteLine($"Não foi possivel criar o workflow. Erro: {erro.Message}");
    return;
}

foreach (var anexo in anexos)
{
    File.WriteAllBytes($"{Environment.CurrentDirectory}{anexo.FileName}", anexo.Content);
}

<br> <br>

Usando a API - Listar itens de uma grid de uma instancia de WF

string WorkflowID = "IR090867";
string MainEntityID = "IR";
string ChildEntityID = "IRCOMENTARIO";
string ChildOID = "OIDABCX0LIPROHT4H2";


List<dynamic> itens_grid;
try
{
    itens_grid =  wfAPI.listGridItems(WorkflowID, MainEntityID, ChildEntityID, ChildOID);
}
catch (Exception erro)
{
    Console.WriteLine($"Não foi possivel criar o workflow. Erro: {erro.Message}");
    return;
}
Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.2.12 84 4/24/2024
1.2.11 80 4/24/2024
1.2.10 99 3/20/2024
1.2.9 95 3/12/2024
1.2.8 96 3/4/2024
1.2.7 92 3/4/2024
1.2.6 90 3/4/2024
1.2.5 104 2/20/2024
1.2.4 92 2/20/2024
1.2.3 94 2/20/2024
1.2.2 91 2/20/2024
1.2.1 85 2/20/2024
1.2.0 94 2/20/2024
1.1.15 161 10/9/2023
1.1.14 116 10/9/2023
1.1.13 115 10/9/2023
1.1.12 120 10/9/2023
1.1.11 118 10/3/2023
1.1.10 118 10/3/2023
1.1.9 125 9/26/2023
1.1.8 114 9/19/2023
1.1.7 159 8/17/2023
1.1.6 130 8/17/2023
1.0.6 286 2/8/2023
1.0.5 255 2/8/2023
1.0.4 250 2/7/2023
1.0.3 418 5/18/2022
1.0.2 432 3/18/2022
1.0.1 401 3/18/2022
1.0.0 406 3/10/2022